Precalculus

Trigonometry

Trigonometry Logo

Law of Cosines

The Law of Cosines (also known as the Cosine Rule) allows to find the length of the third side of a triangle knowing two other sides and the angle between them.

Theorem (Law of Cosines)

Consider a triangle with the sides a, b, c and angles α, β, γ.

An arbitrary triangle in the Cosine Rule
Figure 1.

The Law of Cosines states that

c2=a2+b22abcosγ

where γ denotes the angle between the sides a and b.

The sides a and b can also be expressed in terms of two other sides and angle between them:

a2=b2+c22bccosα
b2=a2+c22accosβ

When the angle between the sides and is a right angle, the Law of Cosines reduces to the Pythagorean Identity:

So the law of cosines is a generalization of the Pythagorean Theorem for an arbitrary triangle.

Proof

We consider separately the cases of acute and obtuse triangles.

In the first case, assume that the angle is an acute angle.

Proving the Law of Cosines for an acute triangle
Figure 2.

Draw the altitude from the vertex to the side Its height can be found from the trigonometric identity for the right triangle

The line segment (the projection of side onto the side ) has the length

In the right traingle the side is given by

Using the Pythagorean Identity for , we get:

Notice that

Therefore

Let now the angle be obtuse.

Proving the Law of Cosines for an obtuse triangle
Figure 3.

In this case, the altitude is given by

By the reduction identity, Hence, the height is expressed by the same formula:

Again, by the reduction identity, the length of the line segment is given by

From the right triangle we have

Similarly, the Law of Cosines can be proved for two other sides of the triangle.

See solved problems on Page 2.

Page 1 Page 2