USA - Geometry
Right triangles and trigonometry
Law of Cosines
20 practice questions
2 video lessons
Theory + worked examples
Theory
The Law of Cosines relates all three sides of a triangle to one angle:
\[c^2=a^2+b^2-2ab\cos C,\]
where \(C\) is the angle included between sides \(a\) and \(b\). Use it for:
- SAS — two sides and the included angle \(\Rightarrow\) the third side;
- SSS — all three sides \(\Rightarrow\) any angle.
It generalizes the Pythagorean theorem: when \(C=90^\circ\), \(\cos C=0\) and it becomes \(c^2=a^2+b^2\).
The included angle \(C\) sits between \(a\) and \(b\), opposite \(c\).
The Law of Cosines and when to use it.
The two forms:
\[c^2=a^2+b^2-2ab\cos C,\qquad \cos C=\dfrac{a^2+b^2-c^2}{2ab}\]
A negative \(\cos C\) means an obtuse angle — the formula handles it automatically.
How to use the Law of Cosines
- SAS: put the known angle as \(C\), its opposite side as \(c\), and solve for \(c\).
- SSS: use the rearranged form for \(\cos C\), then \(\cos^{-1}\).
- Finish the triangle with the Law of Sines if needed.
Example 1 — SAS: find the third side
Sides \(a=7\), \(b=10\) meet at \(C=60^\circ\). Find side \(c\).
Solution
Apply the Law of Cosines.
| \(c^2\) | \(=\) | \(7^2+10^2-2(7)(10)\cos 60^\circ\) |
| \(=\) | \(149-140(0.5)=79\) | |
| \(c\) | \(=\) | \(\sqrt{79}\approx 8.9\) |
Example 2 — SSS: find an angle
A triangle has sides \(5,6,7\). Find the angle \(C\) opposite the side \(7\).
Solution
Rearrange for \(\cos C\).
| \(\cos C\) | \(=\) | \(\dfrac{5^2+6^2-7^2}{2(5)(6)}=\dfrac{12}{60}=0.2\) |
| \(C\) | \(=\) | \(\cos^{-1}(0.2)\approx 78.5^\circ\) |
Example 3 — A real distance
Two paths leave a point at \(70^\circ\); a hiker walks \(12\) and \(9\) miles along them. How far apart are the endpoints?
Solution
SAS with the \(70^\circ\) angle between the two distances.
| \(d^2\) | \(=\) | \(12^2+9^2-2(12)(9)\cos 70^\circ\approx 151.1\) |
| \(d\) | \(\approx\) | \(12.3\ \text{mi}\) |
Example 4 — When to use it
Which triangle cases need the Law of Cosines?
Solution
SAS (two sides and the included angle) and SSS (all three sides) — where the Law of Sines has no starting pair.
Common pitfalls
The included angle pairs with the opposite side. \(\cos C\) goes with side \(c\).
Compute \(2ab\cos C\) as one term before subtracting.
Use it for SAS/SSS, not when you already have an angle-opposite-side pair (that's the Law of Sines).
Frequently asked questions
What is the Law of Cosines?
\(c^2=a^2+b^2-2ab\cos C\), relating all three sides of a triangle to one angle.
When do you use the Law of Cosines?
For SAS (two sides and the included angle) or SSS (all three sides).
How does it relate to the Pythagorean theorem?
When the included angle is \(90^\circ\), the cosine term is zero and it becomes \(c^2=a^2+b^2\).
How do you find an angle with the Law of Cosines?
Rearrange to \(\cos C=\dfrac{a^2+b^2-c^2}{2ab}\) and take the inverse cosine.
More in Right triangles and trigonometry