Key takeaway: The law of cosines finds the side across from a known angle using the other two sides, and it extends the Pythagorean theorem to triangles that have no right angle.
Grade 10 – GeometryG-SRT.D.10Trigonometry
Definition of Law of Cosines
The law of cosines is the Pythagorean theorem with a correction. Square the two sides that enclose a corner, add them, and then subtract a term built from the cosine of that corner. The result is the square of the side facing the corner.
Reach for it when two sides and the corner between them are known, or when all three sides are known and an angle is wanted. For a square corner the cosine is 0 and the correction disappears. For a wide corner the cosine is negative, so the subtraction turns into an addition and the third side grows.
Formula and notation
The law of cosines, with sides \(p\) and \(q\) enclosing corner \(R\) and \(r\) facing it, reads:
\[ r^2 = p^2 + q^2 – 2pq\cos R \]
Solved for the corner: \(\cos R = \frac{p^2 + q^2 – r^2}{2pq}\). Rotate the letters for the other sides.
Key facts
- The angle used must sit between the two sides that are multiplied.
- Square each side before subtracting the cosine term.
- Wide corners have negative cosines, which lengthen the opposite side.
- It works for SAS to find a side and for SSS to find an angle.
Law of Cosines example
Two trails leave a campsite \(C\) and spread apart by \(117^{\circ}\). One runs 8 mi to a lake and the other 13 mi to a tower. How far apart are the lake and tower? Use \(\cos 117^{\circ} \approx -0.4540\).
-
The \(117^{\circ}\) corner sits between the two known trails, so the lake-to-tower distance \(r\) faces it.
-
Plug in: \(r^2 = 8^2 + 13^2 – 2(8)(13)(-0.4540) = 64 + 169 + 94.4\).
-
Add and root: \(r^2 \approx 327.4\), so \(r \approx 18.1\) mi.
The lake and tower are about 18.1 mi apart.
Common mistake
Watch out
Pablo reads the minus in the formula as final and computes \(64 + 169 – 94.4 = 138.6\), so \(r \approx 11.8\) mi.
Why it is wrong
The law of cosines needs care with signs: the cosine of \(117^{\circ}\) is negative, so subtracting \(2pq\cos R\) means subtracting a negative number, which adds 94.4. A trail pair that spreads wider than a right angle must produce a distance longer than the hypotenuse \(\sqrt{8^2 + 13^2} \approx 15.3\) mi.
Related terms and lessons
- Geometry · Law of Sines, Law of Cosines and Triangle AreaLessonWorksheetQuiz
- Precalculus · Laws of Sines and Cosines and Triangle AreaLessonWorksheetQuiz
Browse the glossary: A–Z list · Geometry vocabulary · Trigonometry

