# How do you use the law of cosines to find the area of a triangle?

Dec 6, 2014

The area of a triangle is defined as: The law of cosines is useful when you know two sides and the angle between them, or when you know all three sides. Lets take a look at a generic triangle, ABC; In the case that you know two sides and an angle, say sides a and b and angle C, you would simply use the area formula;

$a r e a = \frac{a b \sin \left(C\right)}{2}$

and there is no need to use the law of cosines. Therefore, lets look at the case where we know the three sides of a triangle, a, b, and c. In this case we cannot find the height by using sin(C). We can, however, use Pythagoras' theorem.

In the second image above, we would use Pythagoras' theorem to find the length of $a \sin \left(C\right)$, the height of the triangle.

${\left(a \sin \left(C\right)\right)}^{2} = {a}^{2} - {\left(a \cos \left(C\right)\right)}^{2}$

Now we use the law of cosines to find $\cos \left(C\right)$. The law of cosines is given as;

$\cos \left(C\right) = \frac{{a}^{2} + {b}^{2} - {c}^{2}}{2 a b}$

so we now have;

${\left(a \sin \left(C\right)\right)}^{2} = {a}^{2} - {\left(a \left(\frac{{a}^{2} + {b}^{2} - {c}^{2}}{2 a b}\right)\right)}^{2}$

or;

$a \sin \left(C\right) = \sqrt{{a}^{2} - {\left(\frac{{a}^{2} + {b}^{2} - {c}^{2}}{2 b}\right)}^{2}}$

It's not pretty, but we can plug this equation into our area equation to get;

$A r e a = \frac{b \times \sqrt{{a}^{2} - {\left(\frac{{a}^{2} + {b}^{2} - {c}^{2}}{2 b}\right)}^{2}}}{2}$

where side $b$ is the base of the triangle and $a \sin \left(C\right)$ is the height.