**Introduction**

In the previous post, we have discussed an elementary proof of the sine law. In this post, we derive the cosine law. Just like the sine law, the cosine law relates the sides and angles of a triangle.

The cosine law states that for any triangle ,

.

The proof is as follows.

**Theorem**

Let be a triangle,

.

**Proof**

Let be the height of triangle as shown in the figure above. Triangle is a right triangle, so by the Pythagorean theorem,

(1).

However, in triangle

therefore, substituting in (1), we have

(2).

Also, in triangle ,

so, . Substituting in (2), we have

.

Rearranging the terms on the equation, we have,

.

The proof above can be also used to derive the other two equations.