Skip to main content

Section 8.3 Law of Cosines

With the law of sines, we can solve many triangles. However, some triangles can’t be solved only with the law of sines.

Example 8.3.1.

For example,
Figure 8.3.2. Triangle with three known sides
This triangle has known side lengths of 5, 6, and 7. However, there is no angle given, so we can’t use the law of sines.

Subsection 8.3.1 Law of Cosines

The law of cosines is like the Pythagorean theorem, except it is a generalization, because it works for any triangle, not just a right triangle. If the angle \(C = 90°\) is a right angle, then \(\cos{C} = \cos{90°} = 0\text{,}\) and then the law of cosines reduces down to \(c^2 = a^2 + b^2\text{,}\) which is the Pythagorean theorem.
The law of cosines can be written equivalently as,
\begin{align*} b^2 \amp= a^2 + c^2 - 2ac \cos{B}\\ a^2 \amp= b^2 + c^2 - 2bc \cos{A} \end{align*}

Subsection 8.3.2 Law of Cosines as a Placeholder Formula

Again, the law of cosines is somewhat of a placeholder formula, in that labelling of the sides and angles are somewhat arbitrary, but their relative positions matter. Recall that the law of cosines says that,
\begin{equation*} c^2 = a^2 + b^2 - 2ab \cos{C} \end{equation*}
This means that the square of the side opposite a given angle (\(c\) opposite \(C\)) is equal to the sum of the squares of the other two sides (\(a\) and \(b\)), minus two times the product of those two sides and the cosine of the given angle (\(C\)).
The crucial requirement is that the angle \(C\) must be opposite to the side \(c\) specified on the left-hand side of the equation. The roles of \(a\) and \(b\) are symmetrical, so it doesn’t matter which of the other two sides you choose as \(a\) or \(b\text{.}\) In other words, the law of cosines says that the side on the LHS must be opposite the angle included in the formula.

Subsection 8.3.3 Law of Cosines Solving for Angle

As written, the law of cosines is made to solve for the side \(c\text{.}\) However, sometimes, we want to solve for the angle, in particular for the SSS case when we know \(a, b\text{,}\) and \(c\text{.}\) To do this, solve for \(\cos{C}\text{,}\) and then use the inverse cosine,
\begin{equation*} c^2 = a^2 + b^2 - 2ab \cos{C} \end{equation*}
First, move \(a^2\) and \(b^2\) to the left-hand side,
\begin{equation*} c^2 - a^2 - b^2 = -2ab \cos{C} \end{equation*}
Then, divide both sides of the equation by \(-2ab\text{,}\) to isolate \(\cos{C}\text{,}\)
\begin{equation*} \frac{c^2 - a^2 - b^2}{-2ab} = \cos{C} \end{equation*}
Then, \(\cos{C}\) is isolated, and we can rewrite the equation to make it look a bit nicer,
\begin{equation*} \cos{C} = \frac{a^2 + b^2 - c^2}{2ab} \end{equation*}
Then, to solve for the angle \(C\text{,}\) we use the cosine inverse function \(\cos^{-1}\text{,}\)
\begin{equation*} C = \cos^{-1}\left(\frac{a^2 + b^2 - c^2}{2ab}\right) \end{equation*}
  • When using law of cosines in the SSS case, you can solve for any of the 3 angles at first. However, because of the issue with acute and obtuse angles, it is ideal to start with solving for the largest angle first, to determine if it’s obtuse or acute. That way, you know the other two angles will be acute, and don’t have to worry about acute or obtuse for those angles (with the law of sines). To do this, note that the largest angle will always be opposite the largest side of the triangle (e.g. if \(b\) is the largest side, then \(B\) will be the largest angle).
  • Ideally, use the law of cosines only when you can’t use the law of sines, because of the law of sines is easier.