Euler Hall — free maths guides

Solve a non-right triangle with the law of cosines

Use the law of cosines to find a side from two sides and the included angle. The idea in plain words, a worked example, and a check with the answers shown — part of the free Trigonometry guides.

Pythagoras, corrected for the angle

side2=side2+side2−2 (side)(side)cos⁡(angle)\text{side}^2 = \text{side}^2 + \text{side}^2 - 2\,(\text{side})(\text{side})\cos(\text{angle})

Written with the standard labels, if the angle isCC and the side opposite it iscc:

c2=a2+b2−2abcos⁡C.c^2 = a^2 + b^2 - 2ab\cos C.

Everything about it is worth reading twice. The side you get is the one opposite the angle you use, and the two products before the cosine term are the sides that contain that angle.

WhenC=90∘C = 90^\circ the cosine is zero, the last term vanishes, and what is left is the Pythagorean theorem. So this is not a replacement for Pythagoras: it is Pythagoras with the correction the angle demands.

Why the cosine term has that size

Drop a perpendicular from the far end of sidebb onto sideaa. It lands a distancebcos⁡Cb\cos C alongaa, and the height isbsin⁡Cb\sin C. The third side is the hypotenuse of a right triangle with legsa−bcos⁡Ca - b\cos C andbsin⁡Cb\sin C, so

c2=(a−bcos⁡C)2+(bsin⁡C)2=a2−2abcos⁡C+b2cos⁡2C+b2sin⁡2C.c^2 = (a - b\cos C)^2 + (b\sin C)^2 = a^2 - 2ab\cos C + b^2\cos^2 C + b^2\sin^2 C.

The last two terms collapse tob2b^2 becausecos⁡2+sin⁡2=1\cos^2 + \sin^2 = 1, and the result is the law of cosines. So the correction is exactly the amount the foot of the perpendicular moves away from the end ofaa.

Worked example: find a side

In triangleABCABC,a=8a = 8,b=5b = 5 andC=60∘C = 60^\circ. Findcc.

Step one. Write the formula for the side oppositeCC:c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C.

Step two. Substitute:c2=64+25−2⋅8⋅5⋅12=89−40=49c^2 = 64 + 25 - 2 \cdot 8 \cdot 5 \cdot \frac12 = 89 - 40 = 49.

Step three.c=7c = 7.

Check the triangle inequality:7<8+57 < 8 + 5 and7>8−57 > 8 - 5, so it is a legitimate triangle. Agrees.

By the end you can
  • Use the law of cosines to find a side from two sides and the included angle
  • Recognise that a right angle reduces it to the Pythagorean theorem
  • Use it to find an angle from all three sides
  • Decide when the law of cosines is the right tool
Check yourself
  1. 1. Findcc whena=6a = 6,b=7b = 7 andC=90∘C = 90^\circ.
  2. 2. Find the largest angle of a triangle with sides 5, 5 and 5.
  3. 3. Findcc whena=5a = 5,b=8b = 8 andC=60∘C = 60^\circ.
  4. 4. Two sides and a non-included angle are given. Is that the law of cosines' input?
Answers

1.36+49=85\sqrt{36 + 49} = \sqrt{85}. 2. All three angles are60∘60^\circ, so the largest is60∘60^\circ. 3.c2=25+64−40=49c^2 = 25 + 64 - 40 = 49, soc=7c = 7. 4. No: the law of cosines needs the angle BETWEEN the two sides, or all three sides. Two sides with a non-included angle is the law of sines' ambiguous case.

Work out where to start — free, no accountAnswer six real questions — free, no account