Skip to the page
Home Campus
Start free

The Cosine Rule: Finding a Side

When two sides and the angle between them are known, the sine rule cannot start. The cosine rule finds the third side of any triangle.

Before you start

  • The sine rule needs a complete pair: a side and the angle opposite it, both known (lesson 6.3). With two sides and the angle between them there is none, and the sine rule cannot start.
  • Pythagoras' theorem (Secondary 2): in a right-angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides, a2+b2=c2a^2 + b^2 = c^2. With a=6a = 6 cm and b=8b = 8 cm, c2=36+64=100c^2 = 36 + 64 = 100 and c=10c = 10 cm.
  • The cosine of an obtuse angle is negative: cos⁡120∘=−cos⁡60∘=−0.5\cos 120^{\circ} = -\cos 60^{\circ} = -0.5 (lesson 6.1).

Two Sides and the Angle Between Them

In △ABC\triangle ABC, let a=7a = 7 cm, b=9b = 9 cm and ∠C=60∘\angle C = 60^{\circ}. The angle CC is the included angle of aa and bb: the angle between the two sides. The side aa faces AA and bb faces BB, and neither angle is known; cc faces CC, but cc is the side wanted. No pair is complete.

The cosine rule finds cc straight from aa, bb and the angle CC between them.

Triangle ABC with BC = a, AC = b, and the side c facing the angle C between them, c and C in one colourCBAcba

The cosine rule

In any triangle ABCABC,

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

and in the same way, for the other two sides,

a2=b2+c2−2bccos⁡Aa^2 = b^2 + c^2 - 2bc\cos A

b2=a2+c2−2accos⁡Bb^2 = a^2 + c^2 - 2ac\cos B

The side on the left faces the angle on the right. The two sides on the right are the two that make that angle.

Why the Cosine Rule Is True

Draw the height AD=hAD = h from AA, at right angles to BCBC, and let CD=xCD = x. Then DB=a−xDB = a - x.

Triangle ABC with BC = a, AC = b, AB = c and the angle C marked; the height h from A meets BC at D, with CD = x and DB = a − xCBADxa − xacbh

In the right-angled triangle ADCADC, the hypotenuse is bb: x=bcos⁡Cx = b\cos C, and by Pythagoras' theorem x2+h2=b2x^2 + h^2 = b^2.

In the right-angled triangle ADBADB, the hypotenuse is cc: c2=h2+(a−x)2=h2+a2−2ax+x2.c^2 = h^2 + (a - x)^2 = h^2 + a^2 - 2ax + x^2\text{.}

Put x2+h2=b2x^2 + h^2 = b^2 and x=bcos⁡Cx = b\cos C into the last line:

c2=a2+(x2+h2)−2ax=a2+b2−2a(bcos⁡C),c^2 = a^2 + (x^2 + h^2) - 2ax = a^2 + b^2 - 2a(b\cos C)\text{,} that is,

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

If CC is obtuse, DD falls outside the triangle, beyond CC. Then CD=bcos⁡(180∘−C)=−bcos⁡CCD = b\cos(180^{\circ} - C) = -b\cos C and DB=a+CDDB = a + CD, and the same steps give the same rule: it holds in every triangle.

Finding a Side

Finding a side by the cosine rule

1. Check the facts: two sides and the angle between them. The side wanted faces that angle.

2. Write the form with the side wanted on the left, such as c2=a2+b2−2abcos⁡C.c^2 = a^2 + b^2 - 2ab\cos C\text{.}

3. Work out 2abcos⁡C2ab\cos C as one product first, then subtract it from a2+b2a^2 + b^2.

4. Take the square root. Key it in one go and round only the answer.

Example 1: The third side

In △ABC\triangle ABC, a=7a = 7 cm, b=9b = 9 cm and ∠C=60∘\angle C = 60^{\circ}. Find cc.

Triangle ABC with BC = 7 cm, AC = 9 cm and the angle C between them 60°; AB = c cm is to be foundCBAc cm9 cm7 cm60°

Solution

Two sides, 77 cm and 99 cm, and the angle CC between them; cc faces CC.

c2=72+92−2×7×9×cos⁡60∘c^2 = 7^2 + 9^2 - 2 \times 7 \times 9 \times \cos 60^{\circ}

c2=49+81−126×0.5=130−63=67c^2 = 49 + 81 - 126 \times 0.5 = 130 - 63 = 67

c=67=8.185…c = \sqrt{67} = 8.185\ldots

Triangle ABC with BC = 7 cm, AC = 9 cm, the angle C 60° and AB about 8.19 cmCBA≈ 8.19 cm9 cm7 cm60°

c=8.19c = 8.19 cm (3 s.f.).

Example 2: Other letters

In △PQR\triangle PQR, PQ=12PQ = 12 cm, PR=15PR = 15 cm and ∠QPR=38∘\angle QPR = 38^{\circ}. Find QRQR.

Solution

The angle given is at PP, between PQPQ and PRPR. The side wanted, QRQR, does not touch PP, so it faces PP. Write the rule with QRQR on the left and the angle PP on the right:

QR2=PQ2+PR2−2×PQ×PR×cos⁡PQR^2 = PQ^2 + PR^2 - 2 \times PQ \times PR \times \cos P

QR2=122+152−2×12×15×cos⁡38∘=369−283.68…=85.316…QR^2 = 12^2 + 15^2 - 2 \times 12 \times 15 \times \cos 38^{\circ} = 369 - 283.68\ldots = 85.316\ldots

QR=85.316…=9.236…QR = \sqrt{85.316\ldots} = 9.236\ldots

QR=9.24QR = 9.24 cm (3 s.f.).

An Obtuse Included Angle

When the angle between the two sides is obtuse, its cosine is negative (lesson 6.1). Then 2abcos⁡C2ab\cos C is negative, and subtracting it adds: the third side comes out longer than it would with a right angle.

Example 3: An obtuse angle between the sides

In △ABC\triangle ABC, a=5a = 5 cm, b=8b = 8 cm and ∠C=130∘\angle C = 130^{\circ}. Find cc.

Triangle ABC with BC = 5 cm, AC = 8 cm and the angle C between them 130°; AB = c cm is to be foundCBAc cm8 cm5 cm130°

Solution

c2=52+82−2×5×8×cos⁡130∘c^2 = 5^2 + 8^2 - 2 \times 5 \times 8 \times \cos 130^{\circ}

cos⁡130∘=−0.6427…,\cos 130^{\circ} = -0.6427\ldots\text{,} so 2×5×8×cos⁡130∘=−51.423…2 \times 5 \times 8 \times \cos 130^{\circ} = -51.423\ldots

c2=89−(−51.423…)=89+51.423…=140.423…c^2 = 89 - (-51.423\ldots) = 89 + 51.423\ldots = 140.423\ldots

c=140.423…=11.850…c = \sqrt{140.423\ldots} = 11.850\ldots

Check: with a right angle at CC the side would be 89=9.43…\sqrt{89} = 9.43\ldots cm; the obtuse angle opens the triangle wider, so cc is longer. It is the longest side, facing the largest angle.

c=11.9c = 11.9 cm (3 s.f.).

At 90°: Pythagoras' Theorem

When C=90∘C = 90^{\circ}, cos⁡90∘=0\cos 90^{\circ} = 0, so the last term is 00 and the cosine rule becomes c2=a2+b2c^2 = a^2 + b^2: Pythagoras' theorem, with cc the hypotenuse. The cosine rule is Pythagoras' theorem with a correction, −2abcos⁡C-2ab\cos C, for an angle that is not a right angle.

Triangle ABC with a right angle at C, BC = 6 cm and AC = 8 cm; AB = c cmCBAc cm8 cm6 cm

Here c2=62+82−2×6×8×0=100,c^2 = 6^2 + 8^2 - 2 \times 6 \times 8 \times 0 = 100\text{,} so c=10c = 10 cm, as Pythagoras' theorem gives. The sign of cos⁡C\cos C tells how c2c^2 compares with a2+b2a^2 + b^2:

The angle CCcos⁡C\cos Cc2c^2
acutepositiveless than a2+b2a^2 + b^2
90∘90^{\circ}00equal to a2+b2a^2 + b^2
obtusenegativemore than a2+b2a^2 + b^2

Then an Angle

Once the third side is known, the triangle has a complete pair (the side found and the angle opposite it), and the sine rule of lesson 6.4 can find another angle. Choose an angle that faces a side shorter than the longest: it cannot be obtuse, so the acute answer is the only one. Lesson 6.7 says more about choosing.

Example 4: Paths round an HDB block

From the foot HH of an HDB block, a straight path runs 8585 m to a playground PP, and another runs 120120 m to a bus stop BB. The angle PHBPHB between the paths is 64∘64^{\circ}. Find (a) the distance PBPB, (b) the angle HBPHBP.

Triangle HPB with HP = 85 m, HB = 120 m and the angle PHB between them 64°; PB is to be foundHBP?85 m120 m64°

Solution

(a) Two sides and the angle between them; PBPB faces HH:

PB2=852+1202−2×85×120×cos⁡64∘=21 625−8942.7…=12 682.2…PB^2 = 85^2 + 120^2 - 2 \times 85 \times 120 \times \cos 64^{\circ} = 21\,625 - 8942.7\ldots = 12\,682.2\ldots

PB=12 682.2…=112.61…PB = \sqrt{12\,682.2\ldots} = 112.61\ldots m

(b) Now PBPB and ∠H=64∘\angle H = 64^{\circ} make a complete pair. ∠HBP\angle HBP faces HP=85HP = 85 m, the shortest side, so it is acute.

sin⁡B85=sin⁡64∘112.61…,\dfrac{\sin B}{85} = \dfrac{\sin 64^{\circ}}{112.61\ldots}\text{,} so sin⁡B=85sin⁡64∘112.61…=0.6783…,\sin B = \dfrac{85\sin 64^{\circ}}{112.61\ldots} = 0.6783\ldots\text{,} and B=42.718…∘B = 42.718\ldots^{\circ}, using the unrounded PBPB.

(a) PB=113PB = 113 m (3 s.f.) (b) ∠HBP=42.7∘\angle HBP = 42.7^{\circ} (1 d.p.).

Common Mistakes

  • Working (a2+b2−2ab)×cos⁡C.(a^2 + b^2 - 2ab) \times \cos C\text{.} The cosine belongs to 2ab2ab only: work 2abcos⁡C2ab\cos C as one product, then subtract it from a2+b2a^2 + b^2.
  • Losing the sign with an obtuse angle. cos⁡130∘\cos 130^{\circ} is negative, so −2abcos⁡130∘-2ab\cos 130^{\circ} adds to a2+b2a^2 + b^2. Key the whole line in one go, or put the cosine in brackets.
  • Using the rule with an angle that is not between the two sides. The angle on the right must be the one the two sides make; the side on the left faces it.
  • Stopping at c2c^2. The rule gives the square of the side: take the square root.
  • Rounding cos⁡C\cos C or c2c^2 before the end. Keep the values in the calculator and round only the answer.

Practice Questions

Give lengths correct to 3 significant figures and angles to 1 decimal place. Check first that the angle given is between the two sides. Try each question before opening its solution.

Question 1

In △ABC\triangle ABC, a=6a = 6 cm, b=10b = 10 cm and ∠C=50∘\angle C = 50^{\circ}. Find cc.

ShowHide solution

c2=62+102−2×6×10×cos⁡50∘=136−77.134…=58.865…c^2 = 6^2 + 10^2 - 2 \times 6 \times 10 \times \cos 50^{\circ} = 136 - 77.134\ldots = 58.865\ldots

c=58.865…=7.672…c = \sqrt{58.865\ldots} = 7.672\ldots

c=7.67c = 7.67 cm

Question 2

Find LMLM.

Triangle KLM with KL = 8 cm, KM = 11 cm and the angle K between them 75°; LM is to be foundKML?8 cm11 cm75°
ShowHide solution

LMLM faces KK, the angle between KLKL and KMKM.

LM2=82+112−2×8×11×cos⁡75∘=185−45.552…=139.44…LM^2 = 8^2 + 11^2 - 2 \times 8 \times 11 \times \cos 75^{\circ} = 185 - 45.552\ldots = 139.44\ldots

LM=139.44…=11.808…LM = \sqrt{139.44\ldots} = 11.808\ldots

LM=11.8LM = 11.8 cm

Question 3

In △XYZ\triangle XYZ, XY=4XY = 4 cm, XZ=7XZ = 7 cm and ∠YXZ=115∘\angle YXZ = 115^{\circ}. Find YZYZ.

ShowHide solution

YZ2=42+72−2×4×7×cos⁡115∘=65−(−23.666…)=88.666…YZ^2 = 4^2 + 7^2 - 2 \times 4 \times 7 \times \cos 115^{\circ} = 65 - (-23.666\ldots) = 88.666\ldots

YZ=88.666…=9.416…YZ = \sqrt{88.666\ldots} = 9.416\ldots

Check: the angle is obtuse, so YZYZ is longer than 65=8.06…\sqrt{65} = 8.06\ldots cm, the side for a right angle.

YZ=9.42YZ = 9.42 cm

Question 4

In △ABC\triangle ABC, b=12b = 12 cm, c=9c = 9 cm and ∠A=40∘\angle A = 40^{\circ}. Write the form of the cosine rule you need, and find aa.

ShowHide solution

The angle given is AA, between bb and cc, and aa faces it: a2=b2+c2−2bccos⁡A.a^2 = b^2 + c^2 - 2bc\cos A\text{.}

a2=122+92−2×12×9×cos⁡40∘=225−165.46…=59.534…a^2 = 12^2 + 9^2 - 2 \times 12 \times 9 \times \cos 40^{\circ} = 225 - 165.46\ldots = 59.534\ldots

a=59.534…=7.715…a = \sqrt{59.534\ldots} = 7.715\ldots

a2=b2+c2−2bccos⁡A;a^2 = b^2 + c^2 - 2bc\cos A\text{;} a=7.72a = 7.72 cm

Question 5

In △ABC\triangle ABC, a=5a = 5 cm, b=7b = 7 cm and ∠C=60∘\angle C = 60^{\circ} (the triangle of lesson 6.3, Question 7). Ravi works out c2=(25+49−70)×cos⁡60∘=2c^2 = (25 + 49 - 70) \times \cos 60^{\circ} = 2 and gives c=1.41c = 1.41 cm. Find his mistake and the correct cc.

ShowHide solution

He multiplied the whole of a2+b2−2aba^2 + b^2 - 2ab by cos⁡60∘\cos 60^{\circ}. Only 2ab2ab is multiplied by the cosine.

c2=25+49−2×5×7×cos⁡60∘=74−35=39,c^2 = 25 + 49 - 2 \times 5 \times 7 \times \cos 60^{\circ} = 74 - 35 = 39\text{,} so c=39=6.244…c = \sqrt{39} = 6.244\ldots

A side of 1.411.41 cm could not join the ends of sides of 55 cm and 77 cm: the answer should have looked wrong.

c=6.24c = 6.24 cm

Question 6

In △ABC\triangle ABC, a=6a = 6 cm, b=9b = 9 cm and ∠C=120∘\angle C = 120^{\circ}. Siti gets c=7.94c = 7.94 cm. Without finding her mistake, explain why her answer must be wrong. Then find cc.

ShowHide solution

The 120∘120^{\circ} angle is the largest angle, so cc faces it and must be the longest side, longer than 99 cm. (7.947.94 cm comes from 36+81−5436 + 81 - 54, the sign of cos⁡120∘\cos 120^{\circ} lost.)

c2=36+81−2×6×9×cos⁡120∘=117−(−54)=171c^2 = 36 + 81 - 2 \times 6 \times 9 \times \cos 120^{\circ} = 117 - (-54) = 171

c=171=13.076…c = \sqrt{171} = 13.076\ldots

cc must be more than 99 cm; c=13.1c = 13.1 cm

Question 7

In △ABC\triangle ABC, a=9a = 9 cm, b=12b = 12 cm and ∠C=90∘\angle C = 90^{\circ}. Find cc by the cosine rule, and check it by Pythagoras' theorem.

ShowHide solution

c2=81+144−2×9×12×cos⁡90∘=225−0=225,c^2 = 81 + 144 - 2 \times 9 \times 12 \times \cos 90^{\circ} = 225 - 0 = 225\text{,} so c=15c = 15.

Pythagoras' theorem: c2=92+122=225c^2 = 9^2 + 12^2 = 225, the same.

c=15c = 15 cm

Question 8

A tunnel is to be dug straight through a hill from AA to BB. From a point CC, a surveyor measures CA=420CA = 420 m, CB=350CB = 350 m and ∠ACB=78∘\angle ACB = 78^{\circ}. Find the length of the tunnel.

Triangle ACB with CA = 420 m, CB = 350 m and the angle ACB 78°; the tunnel AB is to be foundCAB?350 m420 m78°
ShowHide solution

AB2=4202+3502−2×420×350×cos⁡78∘=298 900−61 126.0…=237 773.9…AB^2 = 420^2 + 350^2 - 2 \times 420 \times 350 \times \cos 78^{\circ} = 298\,900 - 61\,126.0\ldots = 237\,773.9\ldots

AB=237 773.9…=487.62…AB = \sqrt{237\,773.9\ldots} = 487.62\ldots m

The tunnel is 488488 m long.

Question 9

A parallelogram ABCDABCD has AB=9AB = 9 cm, AD=6AD = 6 cm and ∠DAB=50∘\angle DAB = 50^{\circ}. Find the lengths of its diagonals BDBD and ACAC.

Parallelogram ABCD with AB = 9 cm, AD = 6 cm, the angle DAB 50°, and the diagonals BD and ACABCD9 cm6 cm50°
ShowHide solution

BDBD: in △ABD\triangle ABD, BDBD faces the 50∘50^{\circ} angle between ABAB and ADAD. BD2=92+62−2×9×6×cos⁡50∘=117−69.421…=47.578…,BD^2 = 9^2 + 6^2 - 2 \times 9 \times 6 \times \cos 50^{\circ} = 117 - 69.421\ldots = 47.578\ldots\text{,} so BD=47.578…=6.897…BD = \sqrt{47.578\ldots} = 6.897\ldots

ACAC: in △ABC\triangle ABC, BC=AD=6BC = AD = 6 cm, and ∠ABC=180∘−50∘=130∘\angle ABC = 180^{\circ} - 50^{\circ} = 130^{\circ} (co-interior angles, ADAD parallel to BCBC).

AC2=92+62−2×9×6×cos⁡130∘=117−(−69.421…)=186.421…,AC^2 = 9^2 + 6^2 - 2 \times 9 \times 6 \times \cos 130^{\circ} = 117 - (-69.421\ldots) = 186.421\ldots\text{,} so AC=186.421…=13.653…AC = \sqrt{186.421\ldots} = 13.653\ldots

BD=6.90BD = 6.90 cm, AC=13.7AC = 13.7 cm (3 s.f.)

Question 10

A triangular garden plot has two sides of 77 m and 1010 m, with an angle of 48∘48^{\circ} between them. Find the length of fencing needed to go all the way round it.

ShowHide solution

The third side: 72+102−2×7×10×cos⁡48∘=149−93.678…=55.321…,7^2 + 10^2 - 2 \times 7 \times 10 \times \cos 48^{\circ} = 149 - 93.678\ldots = 55.321\ldots\text{,} so it is 55.321…=7.437…\sqrt{55.321\ldots} = 7.437\ldots m.

Perimeter =7+10+7.437…=24.437…= 7 + 10 + 7.437\ldots = 24.437\ldots m.

24.424.4 m

Question 11

In △ABC\triangle ABC, a=9a = 9 cm, b=14b = 14 cm and ∠C=55∘\angle C = 55^{\circ}. Find (a) cc, (b) ∠A\angle A.

ShowHide solution

(a) c2=81+196−2×9×14×cos⁡55∘=277−144.54…=132.45…,c^2 = 81 + 196 - 2 \times 9 \times 14 \times \cos 55^{\circ} = 277 - 144.54\ldots = 132.45\ldots\text{,} so c=11.509…c = 11.509\ldots

(b) ∠A\angle A faces a=9a = 9 cm, the shortest side, so it is acute. sin⁡A=9sin⁡55∘11.509…=0.6405…,\sin A = \dfrac{9\sin 55^{\circ}}{11.509\ldots} = 0.6405\ldots\text{,} so A=39.834…∘A = 39.834\ldots^{\circ}, using the unrounded cc.

(a) c=11.5c = 11.5 cm (b) ∠A=39.8∘\angle A = 39.8^{\circ}

Question 12

In △ABC\triangle ABC, a=6a = 6 cm, b=8b = 8 cm and ∠C=95∘\angle C = 95^{\circ}. Without working out cc, say whether it is more or less than 1010 cm, and why. Then find cc.

ShowHide solution

a2+b2=36+64=100=102.a^2 + b^2 = 36 + 64 = 100 = 10^2\text{.} The angle CC is obtuse, so cos⁡C\cos C is negative and c2c^2 is more than a2+b2a^2 + b^2: cc is more than 1010 cm.

c2=100−2×6×8×cos⁡95∘=100+8.366…=108.36…,c^2 = 100 - 2 \times 6 \times 8 \times \cos 95^{\circ} = 100 + 8.366\ldots = 108.36\ldots\text{,} so c=10.409…c = 10.409\ldots

More than 1010 cm; c=10.4c = 10.4 cm

Key Points

  • With two sides and the angle between them (the included angle), the sine rule cannot start; the cosine rule finds the third side.
  • The cosine rule: c2=a2+b2−2abcos⁡C.c^2 = a^2 + b^2 - 2ab\cos C\text{.} The side on the left faces the angle on the right, and the other two sides make that angle.
  • Work 2abcos⁡C2ab\cos C as one product, subtract it, then take the square root.
  • An obtuse included angle has a negative cosine, so the third side is longer than with a right angle.
  • At C=90∘C = 90^{\circ} the cosine rule is Pythagoras' theorem, c2=a2+b2c^2 = a^2 + b^2.

Previous lesson6.4 The Sine Rule: Finding an Angle Next lesson6.6 The Cosine Rule: Finding an Angle

All Secondary 3 (Grade 9) lessons

Home Campus has lessons for Primary 3 to Secondary 4, and practice questions with worked solutions and worksheets for Primary 3 to Secondary 2. Register free to practise and keep track of progress.

This lesson follows the Singapore Secondary 3 syllabus and was checked question by question before it was published. Spotted a mistake? Tell us.