Trigonometry

Cosine Rule Calculator

Use the cosine rule to find a missing side when you know two sides and the angle between them, or to find an angle when you know all three sides. Full step-by-step working is shown, including obtuse angles.

ABCabc

Find

Angle A must be the angle between sides b and c. Finds side a, opposite A. Rename your triangle to match the diagram.

Missing side

a = 7

How it works

  1. Write the cosine rule

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

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

  2. Substitute the values

    a2=52+82−2×5×8×cos⁡60°a^2 = 5^2 + 8^2 - 2 \times 5 \times 8 \times \cos 60°

    b = 5, c = 8, A = 60°.

  3. Work out each part

    a2=25+64−80×0.5=49a^2 = 25 + 64 - 80 \times 0.5 = 49

    cos 60° = 0.5.

  4. Square root

    a=49=7a = \sqrt{49} = 7

    a = 7 (to 2 decimal places).

    Result:a = 7

The cosine rule

a2=b2+c2−2bccos⁡Acos⁡A=b2+c2−a22bca^2 = b^2 + c^2 - 2bc\cos A \qquad \cos A = \frac{b^2 + c^2 - a^2}{2bc}
aaThe side opposite angle A
b,cb, cThe two sides either side of angle A
AAThe angle between sides b and c

Example substitution

a2=62+92−2(6)(9)cos⁡40°=34.27⇒a=5.85a^2 = 6^2 + 9^2 - 2(6)(9)\cos 40° = 34.27 \Rightarrow a = 5.85

Two sides (6 and 9) and the angle between them (40°) give the third side.

Worked examples

Find side a when b = 6 cm, c = 9 cm and A = 40°.

  1. 1
    Cosine rule: a² = 6² + 9² − 2 × 6 × 9 × cos 40°
  2. 2
    Calculate: a² = 36 + 81 − 82.73 = 34.27
  3. 3
    Square root: a = √34.27 = 5.85
Answer: a = 5.85 cm

A triangle has sides 7 cm, 8 cm and 9 cm. Find the angle opposite the 7 cm side.

  1. 1
    Cosine rule for an angle: cos A = (8² + 9² − 7²) ÷ (2 × 8 × 9)
  2. 2
    Calculate: cos A = 96 ÷ 144 = 0.6667
  3. 3
    Inverse cosine: A = cos⁻¹(0.6667) = 48.2°
Answer: A = 48.2°

Find side a when b = 5 cm, c = 7 cm and A = 120°.

  1. 1
    Cosine rule: a² = 5² + 7² − 2 × 5 × 7 × cos 120°
  2. 2
    cos 120° = −0.5: a² = 25 + 49 + 35 = 109
  3. 3
    Square root: a = √109 = 10.44
Answer: a = 10.44 cm

Frequently asked questions

What is the cosine rule?+

a² = b² + c² − 2bc cos A. Rearranged to find an angle: cos A = (b² + c² − a²)/(2bc). Side a is always the side opposite angle A.

When do you use the cosine rule?+

When you know two sides and the angle between them (to find the third side), or all three sides (to find an angle). Otherwise use the sine rule.

How do you find an angle using the cosine rule?+

Substitute into cos A = (b² + c² − a²)/(2bc), then use inverse cosine (SHIFT then cos on your calculator). Side a must be opposite the angle you want.

What if the angle is obtuse?+

The cosine of an obtuse angle is negative, so −2bc cos A becomes positive and the missing side is longer. The calculator handles this automatically.

How is the cosine rule related to Pythagoras?+

When A = 90°, cos A = 0 and the cosine rule becomes a² = b² + c², which is Pythagoras’ theorem. The cosine rule is the general version for any triangle.

Related calculators