TOPIC

Cosine rule

MY PROGRESS

Pug Score

0%

Study Points

+0

Overview

Watch

Read

Next Steps


Get Started

Get unlimited access to all videos, practice problems, and study tools.

Unlimited practice
Full videos

Back to Menu

Topic Progress

Pug Score

0%

Videos Watched

0/0

Read

Not viewed


Study Points

+0

Read

Law of Cosines

The law of cosines (cosine rule) relates the three sides of any triangle to one of its angles: c² = a² + b² - 2ab cos(C). Use it to find a missing side (SAS) or a missing angle (SSS) in any triangle, with worked examples.

What the law of cosines is

The law of cosines (also called the cosine rule) relates the three sides of any triangle to one of its angles. It works for every triangle, not just right triangles, which makes it the tool for solving oblique triangles. For a triangle with sides a, b, and c, where angle C is opposite side c:

Law of cosines triangle CBA abc C
Angle C is the included angle between sides a and b, and it sits opposite side c.

The formula

The law of cosines has one form for each side:

  • c² = a² + b² - 2ab cos(C)
  • a² = b² + c² - 2bc cos(A)
  • b² = a² + c² - 2ac cos(B)

Notice that if the angle is 90°, its cosine is 0 and the last term disappears — the formula collapses to the Pythagorean theorem. The law of cosines is really the Pythagorean theorem generalised to any angle.

When to use it: SAS and SSS

Use the law of cosines in exactly two situations:

  • SAS (two sides and the included angle): find the third side.
  • SSS (all three sides): find any angle.

For the other cases (ASA, AAS, and the ambiguous SSA), the law of sines is usually the simpler choice.

Finding a missing side (SAS)

When you know two sides and the angle between them, put the known angle on the right side of the formula and take the square root:

c = √(a² + b² - 2ab cos(C))

The angle you use must be the included angle — the one between the two known sides.

Finding a missing angle (SSS)

When you know all three sides, rearrange the formula to solve for the cosine of the angle, then take the inverse cosine:

cos(C) = (a² + b² - c²) / (2ab), so C = arccos((a² + b² - c²) / (2ab)).

This step relies on the same cosine ratio you use in right-triangle trigonometry.

Worked example

A triangle has a = 8, b = 5, and the included angle C = 60°. Find side c.

  • c² = 8² + 5² - 2(8)(5) cos(60°)
  • c² = 64 + 25 - 80(0.5) = 89 - 40 = 49
  • c = √49 = 7

Law of cosines vs law of sines

Reach for the law of cosines when the law of sines cannot start — that is, when you do not have a matching side-and-opposite-angle pair. SAS and SSS both lack that pair, so they need the cosine rule. Once you have found one more part, you can often switch to the law of sines to finish. For triangle word problems that mix both, see applications of the sine and cosine law.

Common mistakes

  • Using a non-included angle for SAS. The angle must sit between the two known sides.
  • Forgetting the square root. The formula gives c²; you still need to take the root for c.
  • Sign slips with the cosine. For an obtuse angle the cosine is negative, which makes the third side longer — keep the sign.

Related lessons