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 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":

Note Pythagoras is the special case

At we have , the extra term vanishes, and the law becomes — Pythagoras' theorem.

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

Example Finding a side with an obtuse angle

In triangle ABC: , and . Find .

, so the last term is
⟹ 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.