The Law of Cosines

The law of cosines, a² = b² + c² − 2bc cos A, extends Pythagoras to every triangle by adding a correction term built from the included angle.

--

Pythagoras' theorem only speaks about right triangles. The law of cosines extends it to every triangle by adding one correction term built from the included angle.

Theorem Law of cosines

 a^2 = b^2 + c^2 - 2bc\cos A

A B C c a b
a: the unknown side, opposite angle A.
b and c: the two sides enclosing angle A.
−2bc cos A: the extra term Pythagoras does not have.

Each side has its own version — the pattern is always "square of the unknown side = sum of the squares of the other two, minus twice their product times the cosine of the angle between them":

 a^2 = b^2 + c^2 - 2bc\cos A
 b^2 = a^2 + c^2 - 2ac\cos B
 c^2 = a^2 + b^2 - 2ab\cos C
Note Pythagoras is the special case

At  A = 90° we have  \cos A = 0 , the extra term vanishes, and the law becomes  a^2 = b^2 + c^2 — Pythagoras' theorem.

The term also explains how the third side reacts: a small angle gives a large positive cosine, so more is subtracted and  a comes out short. An obtuse angle makes the cosine negative, so the term is added and  a comes out long.

Example Finding a side with an obtuse angle

In triangle ABC:  b = 7 ,  c = 9 and  \angle A = 120° . Find  a .

 a^2 = 7^2 + 9^2 - 2(7)(9)\cos 120°
 \cos 120° = -0.5 , so the last term is  -126 \times (-0.5) = +63
 a^2 = 49 + 81 + 63 = 193
 a = \sqrt{193}
⟹ a ≈ 13.89 cm
Reference Which form to use
Unknown Formula Given
Side a a² = b² + c² − 2bc cos A SAS
Side b b² = a² + c² − 2ac cos B SAS
Side c c² = a² + b² − 2ab cos C SAS
An angle cos A = (b² + c² − a²) ÷ 2bc SSS

SAS — two sides and the angle between them known: find the third side. SSS — all three sides known: rearrange to find any angle.

Summary
  1. a² = b² + c² − 2bc cos A generalises Pythagoras to any triangle.
  2. Each side has its own form, always using the angle opposite it.
  3. At 90° the cosine term disappears and Pythagoras returns.
  4. Use SAS to find a missing side, and the rearranged form with SSS to find a missing angle.