In Section TheLawofSines, we developed the Law of Sines (Theorem lawofsines) to enable us to solve triangles in the ‘Angle-Angle-Side’ (AAS), the ‘Angle-Side-Angle’ (ASA) and the ambiguous ‘Angle-Side-Side’ (ASS) cases.

In this section, we develop the Law of Cosines which handles solving triangles in the ‘Side-Angle-Side’ (SAS) and ‘Side-Side-Side’ (SSS) cases. We state and prove the theorem below.

To prove the theorem, we consider a generic triangle with the vertex of angle \(\alpha \) at the origin with side \(b\) positioned along the positive \(x\)-axis as sketched in the diagram below.

From this set-up, we immediately find that the coordinates of \(A\) and \(C\) are \(A(0,0)\) and \(C(b,0)\). From Theorem cosinesinecircle, we know that since the point \(B(x,y)\) lies on a circle of radius \(c\), the coordinates of \(B\) are \(B(x,y) = B(c \cos (\alpha ), c \sin (\alpha ))\). (This would be true even if \(\alpha \) were an obtuse or right angle so although we have drawn the case when \(\alpha \) is acute, the following computations hold for any angle \(\alpha \) drawn in standard position where \(0 < \alpha < 180^{\circ }\).)

We note that the distance between the points \(B\) and \(C\) is none other than the length of side \(a\). Using the distance formula, Equation distanceformula, we get

\[\begin{array}{rclr} a & = & \sqrt {(c \cos (\alpha ) - b)^{2} + (c \sin (\alpha ) - 0)^2} & \\ a^{2} & = & \left (\sqrt {(c \cos (\alpha ) - b)^{2} + c^2 \sin ^2(\alpha )}\right )^2 & \\ a^2 & = & (c \cos (\alpha ) - b)^{2} + c^2 \sin ^2(\alpha ) & \\ a^2 & = & c^2 \cos ^2(\alpha ) - 2bc \cos (\alpha ) + b^2 + c^2 \sin ^2(\alpha ) & \\ a^2 & = & c^2\left (\cos ^2(\alpha ) + \sin ^2(\alpha )\right ) + b^2 - 2bc \cos (\alpha ) & \\ a^2 & = & c^2(1) + b^2 - 2bc \cos (\alpha ) & \text {Since $\cos ^2(\alpha ) + \sin ^2(\alpha ) = 1$}\\ a^2 & = & c^2 + b^2 - 2bc \cos (\alpha ) & \\ \end{array} \]

The remaining formulas given in Theorem lawofcosines can be shown by simply reorienting the triangle to place a different vertex at the origin. We leave these details to the reader.

What’s important about \(a\) and \(\alpha \) in the above proof is that \((\alpha ,a)\) is an angle-side opposite pair and \(b\) and \(c\) are the sides adjacent to \(\alpha \) – the same can be said of any other angle-side opposite pair in the triangle.

Notice that the proof of the Law of Cosines relies on the distance formula which has its roots in the Pythagorean Theorem. That being said, the Law of Cosines can be thought of as a generalization of the Pythagorean Theorem.

Indeed, in a triangle in which \(\gamma = 90^{\circ }\), (i.e., a right triangle) then \(\cos (\gamma ) = \cos \left (90^{\circ }\right ) = 0\) and we get the familiar relationship \(c^2 = a^2 + b^2\). What this means is that in the larger mathematical sense, the Law of Cosines and the Pythagorean Theorem amount to pretty much the same thing.

We note that, depending on how many decimal places are carried through successive calculations, and depending on which approach is used to solve the problem, the approximate answers you obtain may differ slightly from those the authors obtain in the Examples and the Exercises.

A great example of this is number locsss in Example locex, where the approximate values we record for the measures of the angles sum to \(180.01^{\circ }\), which is geometrically impossible.

In Section TheLawofSines, we used the proof of the Law of Sines to develop Theorem areaformulasine as an alternate formula for the area enclosed by a triangle. In this section, we use the Law of Cosines to derive another such formula, the so-called Heron’s Formula.

We prove Theorem HeronsFormula using Theorem areaformulasine. Using the convention that the angle \(\gamma \) is opposite the side \(c\), we have \(A = \frac {1}{2} ab \sin (\gamma )\) from Theorem areaformulasine.

In order to simplify computations, we start by manipulating the expression for \(A^2\).

\[ \begin{array}{rclr} A^2 & = & \left (\frac {1}{2} ab \sin (\gamma )\right )^2 &\\ & = & \frac {1}{4} a^2 b^2 \sin ^{2}(\gamma ) & \\ & = & \frac {a^2b^2}{4} \left (1 - \cos ^{2}(\gamma )\right ) & \text {since $\sin ^2(\gamma ) = 1 - \cos ^{2}(\gamma )$.} \\ \end{array}\]

The Law of Cosines tells us \(\cos (\gamma ) = \frac {a^2 + b^2 - c^2}{2ab}\), so substituting this into our equation for \(A^2\) gives

\[ \begin{array}{rclr} A^2 & = & \frac {a^2b^2}{4} \left (1 - \cos ^{2}(\gamma )\right ) & \\ & = & \frac {a^2b^2}{4} \left [1 - \left ( \frac {a^2 + b^2 - c^2}{2ab} \right )^2\right ] & \\ & = & \frac {a^2b^2}{4} \left [1 - \frac {\left (a^2 + b^2 - c^2\right )^2}{4a^2b^2} \right ] & \\ & = & \frac {a^2b^2}{4} \left [\frac {4a^2 b^2 - \left (a^2 + b^2 - c^2\right )^2}{4a^2b^2} \right ] & \\ & = & \frac {4a^2 b^2 - \left (a^2 + b^2 - c^2\right )^2}{16} & \\ \end{array} \]

Recognizing \(4a^2 b^2\) as a perfect square, \(4a^2 b^2 = (2ab)^2\), we can factor the resulting difference of squares:

\[ \begin{array}{rclr} A^2 & = & \frac {(2ab)^2 - \left (a^2 + b^2 - c^2\right )^2}{16} & \\ & = & \frac {\left ( 2ab - \left [a^2+b^2 - c^2\right ]\right ) \left ( 2ab + \left [a^2+b^2 - c^2\right ]\right )}{16} & \text {difference of squares.} \\ & = & \frac {\left (c^2 - a^2 + 2ab - b^2 \right )\left ( a^2 + 2ab + b^2- c^2\right )}{16} & \\ \end{array} \]

Next, we regroup \(c^2 - a^2 + 2ab - b^2 = c^2 - \left [a^2 - 2ab + b^2\right ]\) and \(a^2 + 2ab + b^2- c^2 = \left [a^2 + 2ab + b^2\right ]- c^2\). Recognizing \(a^2 - 2ab + b^2 = (a-b)^2\) and \(a^2 + 2ab + b^2 = (a+b)^2\), we continue factoring:

\[ \begin{array}{rclr} A^2 & = & \frac {\left (c^2 - \left [a^2 - 2ab + b^2\right ] \right ) \left ( \left [a^2 + 2ab + b^2\right ]- c^2\right )}{16} & \\ & = & \frac {\left (c^2 - (a-b)^2 \right ) \left ( (a+b)^2- c^2\right )}{16} & \text {perfect square trinomials.}\\ & = & \frac { (c-(a-b))(c+(a-b))((a+b) -c)((a+b)+c)}{16} & \text {difference of squares.} \\ & = & \frac { (b+c-a)(a+c-b)(a+b-c)(a+b+c)}{16} & \\ & = & \frac {(b+c-a)}{2} \cdot \frac {(a+c-b)}{2} \cdot \frac {(a+b-c)}{2} \cdot \frac {(a+b+c)}{2} & \\ \end{array} \]

At this stage, we recognize the last factor as the semiperimeter, \(s = \frac {1}{2}(a+b+c) = \frac {a+b+c}{2}\). To complete the proof, we note that

\[ (s - a) = \frac {a+b+c}{2} - a = \frac {a+b+c-2a}{2} = \frac {b+c-a}{2} \]

Similarly, we find \((s-b) = \frac {a+c-b}{2}\) and \((s-c) = \frac {a+b-c}{2}\). Hence, we get

\[ \begin{array}{rclr} A^2 & = & \frac {(b+c-a)}{2} \cdot \frac {(a+c-b)}{2} \cdot \frac {(a+b-c)}{2} \cdot \frac {(a+b+c)}{2} & \\ & = & (s-a) (s-b) (s-c) s & \\ \end{array} \]

so that \(A = \sqrt {s(s-a)(s-b)(s-c)}\) as required.

We close with an example of Heron’s Formula.