topic badge

4.03 Cosine rule

Lesson

The sine rule showed that the use of the trigonometric ratios is not limited to right-angled triangles. It provided a tool that allows angles or sides of non right-angled triangles to be calculated provided you had either: two angles and one opposite side, or two sides and at least one opposite angle. There are scenarios where the sine rule is not helpful. For example, we cannot use the sine rule for the triangles below as either no angles are provided or the angles are not in the correct orientation.

 

Two side lengths and one angle are known, but we can't match the known sides with a known angle to use the sine rule. Three side lengths are known, but there is no known angle to match with these sides.

This is where the cosine rule comes in.

The cosine rule

If the three side lengths in a triangle are $a$a, $b$b and $c$c, with an angle $C$C opposite the side with length $c$c, then:

$c^2=a^2+b^2-2ab\cos C$c2=a2+b22abcosC


When looking to solve for an unknown angle, the equation can also be rearranged and written as:

$\cos C=\frac{a^2+b^2-c^2}{2ab}$cosC=a2+b2c22ab.

The cosine rule relates the lengths of all three sides in a triangle and the cosine of one of its angles. Therefore, the cosine rule will help us to find:

  • the third side of a triangle when you know two sides and the included angle(the angle between the two known sides)
  • the angles of a triangle when you know all three sides

Note that the formula can be written in terms of any of the sides or angles in a similar fashion as the sine rule. As is true for the sine rule the position of the sides relative to the angle is vitally important when utilising this rule.

Cosine rule forms

$a^2=b^2+c^2-2bc\cos A$a2=b2+c22bccosA

$b^2=a^2+c^2-2ac\cos B$b2=a2+c22accosB

$c^2=a^2+b^2-2ab\cos C$c2=a2+b22abcosC

This rule can be proven using Pythagoras' theorem and right-angled trigonometry. The proof is shown below.

Cosine Rule Proof

 

Note that this proof can be completed for any orientation of the altitude $h$h.

Worked examples

Example 1

In the triangle shown, find the length marked $x$x, correct to the nearest whole number.

The first thing to do is identify which side is opposite the given angle. This side is the subject of the formula. To find out which other values we are given we label the sides using $a$a,$b$b and $c$c.

Add the following labels to the triangle:

So, $x$x corresponds to $c$c in the cosine rule formula. We substitute the values into the right places in the formula and solve for $x$x. The side of length $c$c must always be the side opposite the angle $C$C, but $a$a and $b$b can represent either of the other two side lengths.

$c^2$c2 $=$= $a^2+b^2-2ab\cos C$a2+b22abcosC
$x^2$x2 $=$= $10^2+4^2-2\times10\times4\cos32^\circ$102+422×10×4cos32°
  $=$= $100+16-80\cos32^\circ$100+1680cos32°
  $=$= $48.15615$48.15615$\ldots$
$x$x $=$= $\sqrt{48.15615\ldots}$48.15615
  $=$= $7$7 (to the nearest whole number)
example 2

Solve for the unknown angle $x$x in the triangle below, correct to the nearest minute.


All three side lengths are known, so we can apply the cosine rule. The unknown angle $x$x appears opposite the side with length $9$9, so we should label this side with a $c$c. Since we are finding an angle, we should use the second, rearranged version of the cosine rule given above.

Add the following labels to the triangle:

Substitute these values, including $C=x$C=x, into the rearranged version of the cosine rule. Remember that $c$c must be the side opposite angle $C$C, and $a$a and $b$b can represent either of the other two side lengths.

$\cos C$cosC $=$= $\frac{a^2+b^2-c^2}{2ab}$a2+b2c22ab
$\cos x$cosx $=$= $\frac{6^2+7^2-9^2}{2\times6\times7}$62+72922×6×7
  $=$= $\frac{4}{84}$484
$x$x $=$= $\cos^{-1}\left(\frac{4}{84}\right)$cos1(484)
  $=$= $87^\circ16'$87°16 (to the nearest minute)

 

Pythagoras again?

What happens when the angle $C$C is $90^\circ$90°? This means the triangle is right-angled, and the side $c$c is the hypotenuse. Putting this into the cosine rule, we get:

$c^2$c2 $=$= $a^2+b^2-2ab\cos C$a2+b22abcosC
  $=$= $a^2+b^2-2ab\cos\left(90^\circ\right)$a2+b22abcos(90°)
  $=$= $a^2+b^2-2ab\times0$a2+b22ab×0
  $=$= $a^2+b^2$a2+b2

which is Pythagoras' theorem! This is why we say that the cosine rule is a generalisation of Pythagoras' theorem.

Practice questions

Question 1

Find the length of $a$a using the cosine rule.

Give your answer correct to $2$2 decimal places.

Question 2

Find the value of angle $B$B using the cosine rule.

Write your answer correct to two decimal places.

Question 3

Find the length of $c$c using the cosine rule.

Write your answer correct to two decimal places.

Outcomes

MA11-1

uses algebraic and graphical techniques to solve, and where appropriate, compare alternative solutions to problems

MA11-3

uses the concepts and techniques of trigonometry in the solution of equations and problems involving geometric shapes

What is Mathspace

About Mathspace