GCSE, A-Level & IB Maths

The Cosine Rule: Both Forms, and How to Know When You Need It

IB Demystified maths teamEvery answer checked symbolically15 min read

The cosine rule

a² = b² + c² − 2bc cos A  —  use this form to find a side. Rearranged, cos A = (b² + c² − a²) ÷ 2bc finds an angle. Reach for it when you know two sides and the angle between them, or all three sides. In every other case you want the sine rule.

The Cosine Rule, Both Ways Round

The cosine rule connects all three sides of a triangle to one of its angles. It works in any triangle, not just right-angled ones, and that is the whole point of it.

Before anything else, get the labelling straight, because every mistake on this topic starts here.

How a triangle is labelled for the cosine ruleA triangle with vertices A, B and C. The side opposite angle A is called a, the side opposite angle B is called b, and the side opposite angle C is called c. Capital letters mark the angles and small letters mark the sides.ABCabcSide a is always opposite angle ASide b opposite B, side c opposite C
Capital letters are angles, small letters are sides, and each small letter sits opposite its own capital. Side a is across the triangle from angle A, never next to it.

Scroll the diagram sideways →

With that in place, here is the rule in the form you use to find a side:

a² = b² + c² − 2bc cos A

Use this when you know two sides and the angle between them.

And here it is rearranged to find an angle:

cos A = b² + c² − a²2bc

Use this when you know all three sides.

They are the same statement. The second is just the first with cos A made the subject, and it is worth doing that rearrangement yourself once so you trust it. Which of these you are handed in the exam depends entirely on your qualification, and the next section sets that out.

The letters are interchangeable, as long as you keep each pair together. If the angle you want is B, write b² = a² + c² − 2ac cos B. The squared side on the left always matches the angle on the right, and the two sides in the 2bc term are the other two.

The side you are solving for and the angle you are using must be opposite each other. Everything else follows.

Is the Cosine Rule Given in Your Exam?

This is worth knowing before you spend any time memorising, and the answer is different for every qualification. No revision site seems to say so, which is why students arrive at A level assuming it will be printed for them.

What you are given, by qualification
QualificationSide form
a² = b² + c² − 2bc cos A
Angle form
cos A = …
GCSE Higher
AQA, Edexcel, OCR
Given on the formula sheetNot given — rearrange it yourself
GCSE FoundationNot on the sheet — and not on the syllabus eitherNot needed
AS and A-Level
all boards
Not given. You must recall itNot given
IB
AA and AI, SL and HL
Given in the formula bookletAlso given

At GCSE it is Higher tier only, and all three boards print the same thing: the side form and nothing else. So the skill that actually earns marks is rearranging it to find an angle, under time pressure, from a formula sheet that will not help you do it.

At A level there is no formula sheet entry at all. The cosine rule sits on the national list of formulae students are expected to recall, and it is deliberately left out of every board’s booklet — Pearson’s own specification says in so many words that it “will not appear in the booklet”. Worth knowing because it used to be there: the old 2009 Edexcel booklet printed it in the C2 section. If an older textbook or an older teacher tells you it is given, they are remembering a booklet that no longer exists.

IB students have it easiest. Both forms are printed, in both the Analysis and Approaches booklet and the Applications and Interpretation one, and in the SL and HL band of each — so every IB maths student has both. There is no reason ever to rearrange it by hand. It sits at syllabus point 3.2 in both courses.

One thing that catches IB students out

The IB booklet writes the rule with different letters. UK boards print a² = b² + c² − 2bc cos A; the IB prints c² = a² + b² − 2ab cos C. These are the same rule — somebody simply chose a different letter to solve for. The pattern is identical: the squared letter on the left matches the angle on the right, and the other two letters fill the rest. If you are moving between a UK textbook and the IB booklet, expect the swap and do not let it throw you.

Sine Rule or Cosine Rule?

This is the decision that costs more marks than the arithmetic ever does. Students who know both formulas perfectly still pick the wrong one, because they go looking for the formula before they look at what the question has given them.

There are only four ways a triangle question can be set up, and each one points at a single rule.

Choosing between the sine rule and the cosine ruleFour triangles show the four cases. Two sides with the angle between them, written SAS, and all three sides, written SSS, both need the cosine rule. A side with two angles, written ASA, and two sides with an angle that is not between them, written SSA, both need the sine rule. The short test is whether the angle you know sits between the two sides you know.Which rule do I use?SAStwo sides +the angle betweenCOSINE RULESSSall threesidesCOSINE RULEASAone side +two anglesSINE RULESSAtwo sides +a non-included angleSINE RULEIf the angle you know sits BETWEEN the two sides you know, use the cosine rule.If you have a side and the angle opposite it, use the sine rule.
Thick lines and arcs mark what the question gives you. SAS and SSS need the cosine rule. ASA and SSA need the sine rule.

Scroll the diagram sideways →

The quickest test is a single question: does the angle you know sit between the two sides you know?

Cosine rule

  • Two sides and the angle between them. You want the third side.
  • All three sides. You want any angle.
  • No complete side-and-opposite-angle pair exists yet.

Sine rule

  • A side and the angle opposite it, plus one more piece.
  • Two angles and any side.
  • Quicker than the cosine rule whenever it works at all.

Notice the asymmetry. The sine rule needs a matching pair — a side together with the angle directly opposite it — and it simply cannot start without one. The cosine rule needs no pair at all. That is why the cosine rule is the one that rescues you: it works on exactly the triangles the sine rule cannot touch.

A useful habit in the exam: label the triangle first, tick off what you have been given, and only then choose. If you have a pair, use the sine rule because the arithmetic is lighter. If you have no pair, you need the cosine rule.

Worth knowing

Many questions need both. You use the cosine rule once to get a missing side or angle, which creates a complete pair, and then the sine rule is available for everything after that. If a question seems to need three steps, this is usually why.

Finding a Missing Side

This is the straightforward direction. You know two sides, you know the angle wedged between them, and you want the side opposite that angle.

Two sides and the angle between themA triangle with side b of 8 centimetres, side c of 5 centimetres and an angle of 60 degrees between them at A. The unknown side a is opposite the 60 degree angle.60°a = ?b = 8 cmc = 5 cmTwo sides and the angle between them
Two sides of 8 cm and 5 cm with a 60° angle between them. The unknown side sits opposite the known angle, which is exactly what the cosine rule needs.

Scroll the diagram sideways →

In triangle ABC, b = 8 cm, c = 5 cm and angle A = 60°. Find side a.

  1. Check the setup. You have two sides with the angle between them, so this is the cosine rule, not the sine rule.
  2. Write the side form with the letters that match: a² = b² + c² − 2bc cos A.
  3. Substitute everything at once. Do not work out parts of it in your head.
  4. Square root at the very end, not before.

The rule

a² = b² + c² − 2bc cos A

Substitute

a² = 8² + 5² − 2(8)(5)cos 60°

Work out each piece

a² = 64 + 25 − 80 × 0.5

a² = 89 − 40

a² = 49

a = 7 cm

That one comes out exactly, which is a gift from the question setter rather than the norm. Most will leave you rounding to three significant figures. The method does not change.

The classic slip

The term is 2bc cos A, all multiplied together. It is not (2bc) − cos A, and the minus sign in front applies to that whole product. Students who get a² = 89 − 80 × 0.5 right but then compute 89 − 80 first and multiply after will get 4.5 instead of 49.

Finding a Missing Angle

When you know all three sides you can find any angle you like. Choose which one by choosing which letter goes on the left of the formula.

All three sides, find the angleA triangle with sides of 7, 3 and 5 centimetres. The angle A sits opposite the longest side, the 7 centimetre one, and turns out to be obtuse.A = ?a = 7 cmb = 3 cmc = 5 cmAll three sides, find the angle
Sides of 7 cm, 3 cm and 5 cm. Angle A sits opposite the 7 cm side, so a = 7 and the other two sides are b and c.

Scroll the diagram sideways →

A triangle has sides a = 7 cm, b = 3 cm and c = 5 cm. Find angle A.

  1. Identify a. Angle A is opposite side a, so a is the 7 cm side. The other two are b and c, in either order.
  2. Use the angle form: cos A = (b² + c² − a²) ÷ 2bc.
  3. Substitute, keeping the whole numerator in brackets.
  4. Inverse cosine at the end. Make sure your calculator is in degrees.

The rule

cos A = (b² + c² − a²) / 2bc

Substitute

cos A = (9 + 25 − 49) / (2×3×5)

Top and bottom

cos A = −15 / 30

cos A = −0.5

Inverse cosine

A = 120°

Two things in that answer are worth pausing on. The cosine came out negative, and the angle came out obtuse. Those two facts are the same fact, and the next section is about why.

Obtuse Angles and the Negative Cosine

Between 0° and 90°, cosine is positive. Between 90° and 180°, cosine is negative. Since every angle in a triangle lies somewhere in that range, the sign of your answer tells you the shape of the angle before you even press the inverse cosine button.

cos A is positive

  • A is acute, under 90°
  • a² is less than b² + c²
  • Side a is shorter than Pythagoras would predict

cos A is negative

  • A is obtuse, over 90°
  • a² is greater than b² + c²
  • Side a is longer than Pythagoras would predict

Check it against the example above. There a² = 49 while b² + c² = 9 + 25 = 34. The 49 is bigger, so the angle opposite is obtuse — which is exactly the 120° we got.

You can use this as a free sanity check on every question. Square the side opposite your angle, compare it with the sum of the other two squares, and you will know whether to expect an acute or an obtuse answer. If your calculator disagrees with that prediction, you have made a slip.

Bigger than the sum of the other two squares means obtuse. Smaller means acute. Equal means exactly 90°.

Why There Is No Ambiguous Case

If you have met the sine rule, you will know it has a trap: when you use it to find an angle, there are sometimes two valid answers, because sin 30° and sin 150° are both 0.5. Your calculator hands you one and silently drops the other.

The cosine rule has no such problem, and it is worth understanding why rather than just being grateful.

Across the range that matters — 0° to 180° — the cosine function never repeats a value. It starts at 1, falls steadily through 0 at 90°, and ends at −1. Every possible angle in a triangle has its own cosine, and no two share one. So when your calculator returns an inverse cosine, that is the only answer there is.

Sine does not behave like that. It rises to 1 at 90° and then falls back, so it hits every value twice on the way up and down. That symmetry is the whole source of the ambiguous case.

If a question gives you three sides and you are worried about a second answer, stop worrying. With the cosine rule there is never one.

IB students should note where this sits in the syllabus, because the two maths courses differ. The ambiguous case is explicitly excluded from topic 3.2, where the sine and cosine rules live. It comes back at 3.5 in Analysis and Approaches, so every AA student meets it — but in Applications and Interpretation it is HL only. An AI SL student is never examined on it at all.

This also gives you a practical strategy. If a triangle could be set up for either rule and you are asked for an angle, the cosine rule is the safer choice, because it cannot give you the wrong one of two answers.

Pythagoras Is Just the Special Case

Put A = 90° into the cosine rule and watch what happens. Since cos 90° = 0, the last term vanishes completely:

a² = b² + c² − 2bc × 0

which is simply a² = b² + c²

When A is a right angle the cosine rule becomes PythagorasA right-angled triangle with sides 3, 4 and 5. Because the cosine of 90 degrees is zero, the final term of the cosine rule disappears and the formula reduces to a squared equals b squared plus c squared.a = 5b = 4c = 3When A is a right angle the cosine rule becomes Pythagoras
The 3-4-5 triangle. With A at 90°, the cosine rule gives 5² = 4² + 3² — Pythagoras, falling straight out of the general formula.

Scroll the diagram sideways →

So Pythagoras’ theorem is not a separate fact you also have to know. It is the cosine rule applied to one particular triangle. The − 2bc cos A term is the correction you need when the angle is not a right angle, and it quietly disappears when it is.

That is a genuinely useful way to remember the formula. Start from Pythagoras, which you already know, and add the correction on the end.

Where the Rule Comes From

You will not often be asked to prove it, but seeing the derivation once makes the formula much harder to misremember — especially the sign.

Deriving the cosine rule from PythagorasA perpendicular of height h is dropped from vertex B onto side AC. It splits side b into a piece of length c cos A next to angle A and a remaining piece of length b minus c cos A. Pythagoras in each right-angled triangle gives h equals c sin A, and a squared equals h squared plus the square of b minus c cos A, which simplifies to the cosine rule.Ahc cos Ab − c cos Athe whole base is bcaDrop a perpendicular, then use Pythagoras twiceh = c sin A and a² = h² + (b − c cos A)²
Dropping a perpendicular from B splits the triangle into two right-angled ones, and splits side b into c cos A and whatever is left.

Scroll the diagram sideways →

Drop a perpendicular of height h from vertex B down onto side AC. That creates two right-angled triangles, and now ordinary trigonometry works.

In the left-hand triangle, h = c sin A and the base is c cos A. The remaining piece of the base must therefore be b − c cos A. Now apply Pythagoras in the right-hand triangle:

Pythagoras on the right

a² = h² + (b − c cos A)²

Put h = c sin A in

a² = c²sin²A + b²

    − 2bc cos A + c²cos²A

Group the two c² terms

a² = c²(sin²A + cos²A)

    + b² − 2bc cos A

And sin²A + cos²A = 1

a² = b² + c² − 2bc cos A

The minus sign comes from expanding the bracket, which is why it is there and why it belongs to the whole 2bc cos A product rather than to the cosine alone.

Common Mistakes

Pairing the wrong side with the wrong angle

The side squared on the left must be opposite the angle on the right. If you are finding angle B, the formula starts b², not a². Label the diagram before you write anything and this one disappears.

Doing the subtraction before the multiplication

a² = 64 + 25 − 80 × 0.5 means multiply 80 by 0.5 first, then subtract. Ordinary order of operations, but under exam pressure people subtract left to right and end up with a wildly wrong answer.

Forgetting the square root

The formula gives you a², not a. Writing 49 as the final answer when the side is 7 is one of the most common lost marks on the whole topic.

Panicking at a negative cosine

cos A = −0.5 is not an error. It means the angle is obtuse. Put it straight into inverse cosine and you get 120°. Students who assume they have slipped and change the sign lose the question.

Using the cosine rule when the sine rule would do

It is not wrong, but it is slower and gives more places to go astray. If you have a side with its opposite angle, the sine rule is one line.

Calculator in radians

If cos 60° gives you −0.952 instead of 0.5, your calculator is in radian mode. Worth checking before the exam starts rather than halfway through.

Rounding too early

Keep the full value in your calculator until the last line. Rounding cos A to two decimal places before taking the inverse cosine can shift the final angle by a degree or more, which is enough to lose accuracy marks.

Practice Questions

Work each one through before you open the answer.

1. In triangle ABC, b = 12 cm, c = 9 cm and A = 110°. Find a to 3 s.f.

Two sides, angle between: cosine rule

a² = 12² + 9² − 2(12)(9)cos 110°

a² = 144 + 81 − 216 × (−0.342)

a² = 225 + 73.9

a = 17.3 cm (3 s.f.)

2. A triangle has sides 4 cm, 5 cm and 7 cm. Find its largest angle.

Largest angle is opposite the longest side

so a = 7, b = 4, c = 5

cos A = (16 + 25 − 49) / (2×4×5)

cos A = −8 / 40 = −0.2

A = 101.5° (1 d.p.)

3. Check: is the triangle with sides 7, 3 and 5 acute or obtuse? Answer without a calculator.

Compare the longest side squared

7² = 49

3² + 5² = 9 + 25 = 34

49 is greater than 34

Obtuse

4. Two paths leave a point at 48° to each other. One walker goes 6 km along the first, the other 9 km along the second. How far apart are they?

Two sides with the angle between

a² = 6² + 9² − 2(6)(9)cos 48°

a² = 36 + 81 − 108 × 0.6691

a² = 117 − 72.26

a = 6.69 km (3 s.f.)

5. In triangle ABC, a = 10, b = 6 and C = 90°. Find c, using the cosine rule.

The angle form with C on the right

c² = a² + b² − 2ab cos 90°

cos 90° = 0, so the last term goes

c² = 100 + 36 = 136

c = 11.7 (3 s.f.) — Pythagoras

FAQs

What is the cosine rule?

The cosine rule links all three sides of a triangle to one of its angles, and it works in any triangle, not just right-angled ones. To find a side it is written a squared equals b squared plus c squared minus 2bc cos A. Rearranged to find an angle it becomes cos A equals b squared plus c squared minus a squared, all divided by 2bc. Side a is always the side opposite angle A.

When do you use the cosine rule instead of the sine rule?

Use the cosine rule when you know two sides and the angle between them, or when you know all three sides. Use the sine rule when you have a side together with the angle directly opposite it. The quick test is whether the angle you know sits between the two sides you know: if it does, you need the cosine rule.

What is the cosine rule for finding an angle?

cos A equals b squared plus c squared minus a squared, all over 2bc. You then take the inverse cosine to get the angle. Remember that a is the side opposite the angle you are finding, so if you want angle B the formula starts with b squared on the subtracted side instead.

Is the cosine rule given in the exam?

It depends on your qualification. At GCSE Higher all three boards print the side form on the formula sheet, but not the rearrangement for finding an angle. At AS and A level it is not given at all, on any board, because it sits on the national list of formulae students must recall. At IB both forms are printed in the formula booklet, for Analysis and Approaches and for Applications and Interpretation, at SL and at HL.

Is the cosine rule Higher tier only at GCSE?

Yes. The sine rule, the cosine rule and the half a b sin C area formula are all Higher tier content, and they appear only on the Higher tier formula sheet. The Foundation sheet has right-angled trigonometry and nothing beyond it.

Why does my IB formula booklet write the cosine rule differently?

Because it solves for a different letter. UK exam boards print a squared equals b squared plus c squared minus 2bc cos A, while the IB booklet prints c squared equals a squared plus b squared minus 2ab cos C. They are the same rule. The squared letter on the left always matches the angle on the right, and the other two letters make up the rest, so you can switch between them freely.

Does the cosine rule work for right-angled triangles?

Yes, and it reduces to Pythagoras when it does. Putting A equal to 90 degrees makes cos A zero, so the final term disappears and the formula becomes a squared equals b squared plus c squared. In practice you would just use Pythagoras directly because it is quicker, but the cosine rule gives the same answer.

Why is my cosine negative?

Because the angle is obtuse. Cosine is positive for angles under 90 degrees and negative for angles between 90 and 180 degrees. A negative value is not a mistake, so put it straight into the inverse cosine and you will get an angle above 90 degrees. It also tells you that the side opposite is longer than Pythagoras would predict.

Does the cosine rule have an ambiguous case like the sine rule?

No. Across the range 0 to 180 degrees the cosine function never takes the same value twice, so every cosine corresponds to exactly one angle and the inverse cosine gives the only answer. The sine rule has an ambiguous case because sine does repeat values, for example sin 30 degrees and sin 150 degrees are both 0.5.

How do you find the largest angle in a triangle?

The largest angle is always opposite the longest side, so label the longest side a and use the angle form of the cosine rule to find A. For a triangle with sides 4, 5 and 7, the largest angle is opposite the 7, and cos A works out as minus 0.2, giving 101.5 degrees.

What is the difference between the cosine rule and the law of cosines?

They are the same thing. Cosine rule is the usual name in the UK, including at GCSE, A level and IB. Law of cosines is the American name, so you will see it on international sites and in some textbooks. The formula is identical.

Can you use the cosine rule to find the area of a triangle?

Not directly, but it often gets you there. The area formula for any triangle is one half times a times b times sin C, which needs two sides and the angle between them. If a question gives you three sides, you can use the cosine rule to find an angle first and then the area formula, or use Heron’s formula instead.

Why does the cosine rule have a minus sign?

It comes from expanding a bracket in the derivation. Dropping a perpendicular splits the base into c cos A and b minus c cos A, and squaring that second piece produces the minus 2bc cos A term. The minus sign belongs to the whole 2bc cos A product, not to the cosine on its own.

Do I need to be in degrees or radians?

Degrees, for almost every exam question at GCSE and A level, and for most at IB. If cos 60 degrees gives you minus 0.952 instead of 0.5, your calculator is in radian mode. Check the mode before the exam starts rather than discovering it halfway through a question.

Choosing the wrong rule costs more marks than the arithmetic

Most students who lose marks on triangle questions know both formulas perfectly well. What goes wrong is the thirty seconds before they start writing. Our tutors teach GCSE, A‑level and IB maths and work through your own past papers, so the habits we fix are the ones actually costing you marks.

Book a free 30-minute meeting

Still on the other rule? Our guide to the sine rule and its ambiguous case is the companion to this one, and the exact value chart covers the angles worth knowing by heart.

Subscribe to our newsletter

Get free IB notes, exam tips and new resources in your inbox.

We will ask you to confirm by email. Unsubscribe any time.