Law of cosines

The law of cosines finds the third side of a triangle when you know two sides and the angle between them (the included angle). cos C is a number determined by the size of angle C, and cos⁡60∘=12\cos 60^\circ = \frac{1}{2}. If angle C is a right angle, cos⁡90∘=0\cos 90^\circ = 0, and the formula becomes the Pythagorean theorem.

Chalcack concept card · Reviewed by the Chalcack team ·

Knowing sides 5 and 8 and the 60° angle between them, the law of cosines gives c = 7.

Formulas

  • c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C
  • cos⁡C=a2+b2−c22ab\cos C = \frac{a^2 + b^2 - c^2}{2ab}

When to use it

Use it when you know two sides of a triangle and the angle between them and need the third side, or when you know all three sides and need an angle.

Worked example

A triangle has sides 5 and 8 with a 60∘60^\circ angle between them; find the third side c. c2=52+82−2×5×8×12=25+64−40=49c^2 = 5^2 + 8^2 - 2 \times 5 \times 8 \times \frac{1}{2} = 25 + 64 - 40 = 49. So c=7c = 7.

Common mistake

A common mistake is to put an angle that is not between the two known sides in place of C. Check that you use the angle opposite the side c you want, which is the angle between a and b.

Related concepts

All 181 math concepts