Skip to main content

The cosine rule

A non-right-angled triangle with internal angles A, B and C. The sides opposite these angles are labelled a, b and c, respectively. Underneath is the cosine rule which reads a squared equals b squares plus c squares minus 2 times b times c times cosine of angle A.

Like the sine rule, the cosine rule comes in handy for triangles that are not right-angled. Use this resource to learn about the cosine rule, how it is applied to find unknown sides and angles, and its importance in solving complex geometric problems involving any type of triangle.

The cosine rule is a generalisation of Pythagoras’ theorem. If you have any two sides of a triangle, as long as you know the angle between them, you can calculate the length of the third side.

Consider the triangle.

A non-right-angled triangle with internal angles A, B and C. The sides opposite these angles are labelled a, b and c, respectively.

Here:

  • the vertices \(A\), \(B\) and \(C\) have the angles \(A\), \(B\) and \(C\), respectively
  • \(a\), \(b\) and \(c\) are the side lengths opposite to the angles \(A\), \(B\) and \(C\), respectively.

The cosine rule states that:

\[\begin{align*} a^{2} & = b^{2}+c^{2}-2bc\,\cos (A)\\
b^{2} & = a^{2}+c^{2}-2ac\,\cos(B)\\
c^{2} & = a^{2}+b^{2}-2ab\,\cos(C)
\end{align*}\]

You might notice that the side of the triangle on the left-hand side of the equation is opposite the angle at the end of the equation:

\[\boldsymbol{\underline{a^{2}}} = b^{2}+c^{2}-2bc\,\cos(\boldsymbol{\underline{A}})\]

This rule can be used to find angles and sides in any triangle (not just a right-angled triangle) when given:

  • two sides and the angle between them; or
  • all three sides of the triangle.

Example 1 – using the cosine rule

Find the value of \(a\) in the triangle shown.

Triangle with internal angle of 83 degrees opposite side a. The length of the side on the left is 12 and the length of the side on right is 15.
\[\begin{align*} a^{2} & = b^{2}+c^{2}-2bc\,\cos(A)\\
a^{2} & = 12^{2}+15^{2}-2\times12\times15\times\cos(83^{\circ})\\
a^{2} & = 144+225-360\times\cos(83^{\circ})\\
a^{2} & = 369-43.87\\
a^{2} & = 325.13\\
a & = 18.03
\end{align*}\]

Find the size of angle \(B\) in the triangle.
Triangle with internal angles A, B and C. Length of sides opposite these angles are 5, 11 and 7, respectively.
\[\begin{align*} b^{2} & = a^{2}+c^{2}-2ac\,\cos(B)\\
11^{2} & = 5^{2}+7^{2}-2\times5\times7\times\cos(B)\\
121 & = 25+49-70\times\cos(B)\\
121-25-49 & = -70\times\cos(B)\\
47 & = -70\times\cos(B)\\
\frac{47}{-70} & = \cos(B)\\
B & = \cos^{-1}\left(-\frac{47}{70}\right)\\
B & = 132^{\circ}11^{\prime}
\end{align*}\]

Your turn – using the cosine rule

  1. Find the unknown sides for the following triangles.
    1. Triangle with internal angle of 84 degrees. Side a is opposite this angle. Left-hand side is of length 23.1. Right-hand side length is 19.6.
    2. Triangle with internal angle of 161 degrees. Length of side opposite this angle is 6.6. Other sides are of length b and 2.3.
    3. Triangle with internal angle of 35 degrees. Side opposite this angle is c. Top side length is 13.6. Length of remaining side is 8.2.
    4. Triangle with internal angle of 78 degrees. Opposite side is of length 1.25. Left-hand side length is d. Right-hand side length is 0.93.
  2. Find the unknown angle for the following triangles.
    1. Triangle with internal angle of alpha degrees. Opposite side is of length 9.2. Top side is of length 15.6. Bottom side is of length 10.1.
    2. Triangle with internal angle of beta degrees. Opposite side has length 7.21. Right-hand side has length 4.93. Lower side has length 9.99.

    1. \(a=28.7\)
    2. \(b=4.38\)
    3. \(c=8.33\)
    4. \(d=1.05\)
    1. \(\alpha=34.2^{\circ}\quad\)
    2. \(\beta=42.9^{\circ}\)

Images on this page by RMIT, licensed under CC BY-NC 4.0