Skip to content
MathsMaths
Start learning

Maths · Lesson 12.2

Law of Cosines

The law of cosines and its use in SAS and SSS triangles.

Core syllabus1 linked experiment
01

Learning objectives

By the end of this lesson, you should be able to:

  • State and apply the law of cosines.
  • Solve a triangle given two sides and the included angle.
  • Solve a triangle given three sides.
  • Use the cosine rule to find an angle.
02

Lesson

The cosine rule is Pythagoras with a correction term. When the angle between two sides is not 90°, the square of the opposite side is larger or smaller than the sum of the squares of the other two. The correction is −2ab cos C, which vanishes exactly when C = 90°.

This rule handles the two cases the sine rule cannot: two sides with the included angle (SAS), and all three sides (SSS). It is the standard tool for finding a side or an angle in an oblique triangle.

A triangle with all three sides and angles labelled.
The cosine rule extends Pythagoras to any angle

Finding a side

Label the side you want to find as c and the angle opposite it as C. Then c2 = a2 + b2 − 2ab cos C. The two known sides are a and b, and C is the angle between them. Take the positive square root at the end because a side length cannot be negative.

If C is obtuse, cos C is negative, so the correction term becomes positive and c2 exceeds a2 + b2. This matches the geometry: the side opposite an obtuse angle is longer than the hypotenuse of the right triangle with the same legs.

Finding an angle

Rearranging the formula gives cos C = (a2 + b2 − c2)/(2ab). Compute the cosine first, then take the inverse cosine. The result lies between 0° and 180°, which is exactly the valid range for a triangle angle.

When all three sides are known, find the largest angle first. It is opposite the longest side, and if the triangle is obtuse this is the angle that reveals it. The remaining angles can then be found with the sine rule, which is usually faster.

03

Worked example

A triangle has sides a = 7 cm, b = 9 cm and included angle C = 120°. Find the third side c.

Use c2 = a2 + b2 − 2ab cos C.

Substitute: c2 = 49 + 81 − 2(7)(9)cos 120°.

cos 120° = −1/2, so the correction is −126(−1/2) = +63.

Thus c2 = 49 + 81 + 63 = 193, and c = √193 ≈ 13.9 cm.

04

Equations

Law of cosinesc2 = a2 + b2 − 2ab cos C
Angle formcos C = (a2 + b2 − c2)/2ab
Pythagoras linkC = 90° ⇒ c2 = a2 + b2
05

Key points

  • c2 = a2 + b2 − 2ab cos C.
  • Use it for SAS and SSS triangles.
  • If C = 90° the rule reduces to Pythagoras.
  • Find the largest angle first when all three sides are known.
06

Common misconceptions

Common mistake

The cosine rule is c2 = a2 + b2 + 2ab cos C.

Correct understanding

The sign is minus. For an obtuse angle the negative cosine makes the term positive, increasing c2.

Common mistake

Any angle can be found with the cosine rule using the same side order.

Correct understanding

The angle must be opposite the side on the left. Match the labels before substituting.

07

Check your understanding

1. Which case is solved directly by the cosine rule?

2. If cos C is negative, what kind of angle is C?

08

Frequently asked questions

Why does the rule reduce to Pythagoras at 90°?

Because cos 90° = 0, the correction term disappears.

Can the cosine rule produce an impossible triangle?

If the three sides violate the triangle inequality, the computed cosine falls outside [−1, 1] and no triangle exists.

NERDLYY · FEEDBACK

Help shape Nerdlyy

Your feedback goes directly to the team. We read every submission.

No reply needed — you can send feedback without sharing contact details.