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.
Subsection8.3.2Law 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,
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.
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 = \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).