WE USE THE LAW OF COSINES to solve triangles that are not right-angled.  In particular, when we know two sides of a triangle and their included angle, then the Law of Cosines enables us to find the third side.

The the Law of Cosines

Thus if we know sides a and b and their included angle θ, then the Law of Cosines states:

c = a + b − 2ab cos θ

(The Law of Cosines is a extension of the Pythagorean theorem; because if θ were a right angle, we would have c = a + b.)


Proof of the Law of Cosines

The Law of Cosines

Let ABC be a triangle with sides a, b, c.  We will show

c = a + b − 2ab cos C

Draw BD perpendicular to CA, separating triangle ABC into the two right triangles BDC, BDA.  BD is the height h of triangle ABC.

Call CD x.  Then DA is the whole b minus the segement x:  b − x.

Also, since

x
a
 = cos C,

then

x  =  a cos C .  .  .  .  .  .  . (1)

Now, in the right triangle BDC, according to the Pythagorean theorem,

h + x = a,

so that

h = ax.  .  .  .  .  .  (2)

In the right triangle BDA,

c = h + (bx)

c = h + b − 2bx + x

For h, let us substitute line (2):

c = ax + b − 2bx + x

c = a + b − 2bx

Finally, for x, let us substitute line (1):

c = a + b − 2b a cos C

That is,

c = a + b − 2ab cos C

This is what we wanted to prove.

In the same way, we could prove that

a = b + c − 2bc cos A

and

b = a + c − 2ac cos B.

This is the Law of Cosines.