# Derivation of the Cosine Law

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 $ABC$

$a^2 = b^2 + c^2 - 2bc \cos A$
$b^2 = a^2 + c^2 - 2ac \cos B$
$c^2 = a^2 + b^2 - 2ab \cos C$.

The proof is as follows.

Theorem

Let $ABC$ be a triangle,

$a^2 = b^2 + c^2 - 2bc \cos A$
$b^2 = a^2 + c^2 - 2ac \cos B$
$c^2 = a^2 + b^2 - 2ab \cos C$.

Proof

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

$a^2 = (c - x)^2 + h^2$

$a^2 = c^2 -2cx + x^2 + h^2$ (1).

However, in triangle $ADC$

$b^2 = x^2 + h^2$

therefore, substituting in (1), we have

$a^2 = c^2 - 2cx + b^2$ (2).

Also, in triangle $ADC$,

$\cos A = \frac{x}{b}$

so, $x = b \cos A$.  Substituting in (2), we have

$a^2 = c^2 - 2c b \cos A + b^2$.

Rearranging the terms on the equation, we have,

$a^2 = b^2 + c^2 - 2bc \cos A$.

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