The Cosine Rule
On this page
How to use the cosine rule in a triangle with no right angle: a side from two sides and the angle between them, an angle from three sides, an exact angle without a calculator, and a side inside a polygon.
Builds on: Trigonometry, Exact Trig Values - Higher
Key ideas
Sides b and c meet at angle A, and a is opposite it. To find a side: a^2=b^2+c^2-2bc\cos A
To find an angle from three sides, subtract the square of the side opposite it: \cos A=\dfrac{b^2+c^2-a^2}{2bc}
An obtuse angle has a negative cosine. It is opposite the longest side.
- Use the cosine rule when you know two sides and the angle between them, or all three sides. The triangle has no right angle, so Pythagoras and \sin, \cos, \tan of a right-angled triangle don't work.
- Recent Edexcel papers give the side form on a formulae sheet, but not the angle form: learn it, or substitute into the side form and rearrange.
- Calculator in degrees. Keep full values until the last line, then round as the question asks.
Worked example 1: A side from two sides and the angle between them
Here is triangle PQR.
Find the length of QR.
Give your answer correct to 3 significant figures.
- QR is opposite angle QPR, the angle between the two sides you know.
- QR^2=7.3^2+10.4^2-2\times7.3\times10.4\times\cos64^\circ
- QR^2=161.45-151.84\cos64^\circ=94.887\ldots
- QR=\sqrt{94.887\ldots}=9.74 cm
- Work out 151.84\cos64^\circ before you subtract: (161.45-151.84)\times\cos64^\circ is wrong. And 94.887\ldots is QR^2: take the square root.
Now try this
Here is triangle DEF.
Find the length of EF.
Give your answer correct to 3 significant figures.
- EF^2=6.5^2+8^2-2\times6.5\times8\times\cos118^\circ
- EF^2=106.25-104\cos118^\circ=155.07\ldots
- EF=\sqrt{155.07\ldots}=12.5 cm. The cosine of 118° is negative, so the last term is added and EF is the longest side.
Worked example 2: An angle from three sides
Here is triangle ABC.
Calculate the size of angle BAC.
Give your answer correct to 1 decimal place.
- Angle BAC is at A, between AB and AC. The side opposite it is BC=12 cm.
- \cos BAC=\dfrac{7^2+9^2-12^2}{2\times7\times9}=\dfrac{-14}{126}=-\dfrac19
- Angle BAC=\cos^{-1}\left(-\dfrac19\right)=96.379\ldots=96.4^\circ
- Name the corner of the angle first: subtracting the wrong side's square gives a different angle. A negative cosine gives an obtuse angle, so keep the minus sign.
Now try this
Here is triangle LMN.
Calculate the size of angle MLN.
Give your answer correct to 1 decimal place.
- Angle MLN is at L. The side opposite it is MN=13.4 cm.
- \cos MLN=\dfrac{8.2^2+6.9^2-13.4^2}{2\times8.2\times6.9}=\dfrac{-64.71}{113.16}
- Angle MLN=\cos^{-1}\left(-\dfrac{64.71}{113.16}\right)=124.878\ldots=124.9^\circ
Worked example 3: An exact angle without a calculator
Here is triangle JKL.
Find the size of angle JKL.
You must show all your working.
- Angle JKL is at K, between JK and KL. The side opposite it is JL=2\sqrt{13} cm.
- (2\sqrt{13})^2=4\times13=52
- \cos JKL=\dfrac{2^2+6^2-52}{2\times2\times6}=\dfrac{-12}{24}=-\dfrac12
- \cos60^\circ=\frac12, so the angle whose cosine is -\frac12 is 180^\circ-60^\circ=120^\circ. Angle JKL=120^\circ
- Square the whole side, in brackets: (2\sqrt{13})^2 is 52, not 26. A side written with x works the same way: (2x)^2=4x^2.
Now try this
Here is triangle RST.
Find the size of angle RST.
You must show all your working.
- Angle RST is at S. The side opposite it is RT=\sqrt{58} cm, and (3\sqrt2)^2=9\times2=18
- \cos RST=\dfrac{4^2+18-58}{2\times4\times3\sqrt2}=\dfrac{-24}{24\sqrt2}=-\dfrac{1}{\sqrt2}=-\dfrac{\sqrt2}{2}
- \cos45^\circ=\frac{\sqrt2}{2}, so angle RST=180^\circ-45^\circ=135^\circ
Worked example 4: The angle between the sides from the shape
ABCDE is a regular pentagon with sides of length 8 cm.
Calculate the length of the diagonal AC.
Give your answer correct to 3 significant figures.
- In triangle ABC, AB=BC=8 cm. The angle between them, angle ABC, is an interior angle of the pentagon: (5-2)\times180^\circ\div5=108^\circ
- AC^2=8^2+8^2-2\times8\times8\times\cos108^\circ=128-128\cos108^\circ=167.55\ldots
- AC=\sqrt{167.55\ldots}=12.9 cm
- The cosine rule needs the angle between the two sides. Where it isn't given, find it first from the shape, from angle facts or from bearings.
Now try this
ABCDEFGH is a regular octagon with sides of length 5 cm.
Calculate the length of the diagonal AC.
Give your answer correct to 3 significant figures.
- Angle ABC is an interior angle of the octagon: (8-2)\times180^\circ\div8=135^\circ
- AC^2=5^2+5^2-2\times5\times5\times\cos135^\circ=50-50\cos135^\circ=85.355\ldots
- AC=\sqrt{85.355\ldots}=9.24 cm
Next: Mixed Sine and Cosine Rule Problems, Area of a Triangle Using Sine
More on this topic: The Cosine Rule worksheet with full solutions