In this tutorial, we’ll look at the law of cosines – a critical concept when it comes to solving triangles.
But before we dive into the law, here’s a quick summary of the convention we use to denote angles and side-lengths in a triangle.
The key idea is the length of each side is represented by the small case version of the letter for the opposite angle.
For example, the angle opposite to the side AB is angle C. So the side and its length are represented by c.
The law of cosines gives the relationship between the side lengths of a triangle and the cosine of any of its angles.
It says –
a2=b2+c2−2bccosA We can re-frame the formula above for other sides/angles.
b2=a2+c2−2accosBc2=a2+b2−2abcosC Now, the most common use cases for the law of cosines are –
- to find a side (length), when the other two sides and their included angle is known, or
- to find an angle if all three sides are known.
For cases where we need to find angles using the cosine rule, the three formulas can be rearranged as –
cosA=2bcb2+c2−a2cosB=2aca2+c2−b2cosC=2aba2+b2−c2 The law of cosines is also known as the cosine rule.
Law of Cosines – Proof
To prove the cosine law, we will make use of the following figure.
In △ABD,
cosAr=br=bcosA(1) Also, in the same triangle,
sinBh=bh=bsinB(2) In △ADC,
a2a2=h2+(c−r)2=h2+c2+r2−2⋅c⋅r Substituting the values of r and h from equations (1) and (2), we have
a2=(bsinA)2+c2+(bcosA)2−2⋅c⋅bcosA=b2sin2A+c2+b2cos2A−2⋅c⋅bcosA=b2(sin2A+cos2A)+c2−2⋅c⋅bcosA=b2+c2−2⋅c⋅bcosA a2=(bsinA)2+c2+(bcosA)2−2⋅c⋅bcosA=b2sin2A+c2+b2cos2A−2⋅c⋅bcosA=b2(sin2A+cos2A)+c2−2⋅c⋅bcosA=b2+c2−2⋅c⋅bcosA And that’s it. We just proved the law of cosines.
In the last three steps, we factored out b2 from two terms (in red) and then made use of the following trigonometric identity –
sin2A+cos2A=1 Solving Triangles Using Law of Cosines
Alright, now it’s time to cement our understanding of the law of cosines and learn how to use it to solve triangles.
Note – In most cases, we need to use the sine rule along with the cosine rule to solve triangles. However, since the focus of this tutorial is on the cosine rule, we will only use examples that do not need the sine rule.
Also, in the following examples, I would encourage you to pay special attention to how the cosine rule is being used in the solution and not worry too much about how to solve triangles.
Example
Solve the triangle below for the missing sides and angles.
Solution
Here are the steps to solve this triangle.
Step 1. Use the Cosine Rule to find the missing side
When we have two sides and the included angle, the law of cosines allows us to find the third side.
Applying the cosine rule for side b,
a2=b2+c2−2bccosA=102+62−2⋅10⋅6cos88°≈131.81 Taking the square root on both sides
a≈11.48 Step 2. Use the Cosine Rule for one of the remaining angles
Using the law of cosines (arranged for angles),
cosB=2aca2+c2−b2≈2⋅6⋅11.4862+11.482−102≈0.4921 Taking cos inverse on both sides,
B≈60.52° Step 3. Finally, we can use the "Sum of Angles" property to find ∠C,
A+B+C88°+60.52°+CC=180°≈180°≈31.48° Example
The sides of a triangle measure 5, 8, and 9. Find the measure of its angles.
Solution
This time, the question doesn't contain the drawing. So, let's start by drawing a rough sketch of the triangle and labeling the information given in the question. It’s not necessary but often makes things easier and helps avoid silly mistakes.
Step 1. Use the Cosine Rule to find the largest angle
When we know all the side lengths, we can use the cosine rule to find any of the angles. But it’s best to start with the largest angle – the angle opposite to the longest side. Why?
Because if there is an obtuse angle (>90°) in the triangle, it has to be this angle. The other two angles must be acute. And that’s useful to know when using the sine rule.
Here the largest angle would be A. So let’s work on that.
cosA=2bcb2+c2−a2=2⋅5⋅852+82−92=0.1 Taking cos inverse on both sides, we have
A≈84.26° Step 2. Use the Cosine Rule for another angle
Because this is a tutorial on the law of cosines, here we are using it to find this angle. However, in general, I would suggest using the sine rule. It involves simpler calculations, and so is less error-prone.
cosB=2aca2+c2−b2=2⋅9⋅892+82−52≈0.8333 Again, taking cos inverse on both sides, we have
B≈33.56° Step 3. Finally, we can use the "Sum of Angles" property to find ∠C,
A+B+C84.26°+33.56°+CC=180°≈180°≈62.18°
And that brings us to the end of this tutorial on the law of cosines. Until next time.