Lesson Explainer: Law of Cosines Mathematics • 11th Grade

In this explainer, we will learn how to find the sides and angles in non-right triangles using the law of cosines.

The law of cosines, also known as the cosine rule, allows us to relate all three sides of a triangle with one of its angles.

Definition: The Law of Cosines

Let us consider a triangle 𝐴𝐵𝐶, with corresponding sides of lengths 𝑎, 𝑏, and 𝑐. For this triangle, each side has been labeled with the lower case letter of its opposite angle.

The law of cosines tells us that 𝑎=𝑏+𝑐2𝑏𝑐𝐴.cos

It may be useful to see that the law of cosines can be viewed as a generalized form of the Pythagorean theorem. In order to see this, let us consider an arbitrary triangle with an angle 𝐴=90.

Inputting this value into the law of cosines, we can see that our final term becomes 2𝑏𝑐90cos: 𝑎=𝑏+𝑐2𝑏𝑐90.cos

Since we know that cos90=0, we can see the last term will vanish from our equation: 𝑎=𝑏+𝑐2𝑏𝑐0𝑎=𝑏+𝑐.

Here, we can see that, for the special case of a right triangle, the law of cosines reduces to the Pythagorean theorem, with side length 𝑎 being defined as the hypotenuse.

The law of cosines can be used in a couple of different cases. The first case is when finding an unknown side length when given its opposite angle and the two adjacent side lengths. You may see the angle referred to as “the enclosed angle” in this situation.

Understanding each of the terms will help us correctly utilize the cosine rule: 𝐴,𝑎,𝑏,𝑐.theangleenclosedbytwoknownsidesthesideoppositetheenclosedangleoneoftheadjacentsidestotheenclosedangleoneoftheadjacentsidestotheenclosedangle

In this case, we have chosen to observe the relationship between the side lengths with respect to the enclosed angle 𝐴. It is worth noting that the law of cosines can be applied to a triangle with respect to any of its angles.

We could instead observe the relationship between the side lengths with respect to either of the remaining two angles (bottom left and bottom right in the diagram), simply by relabeling our triangle to fit the known information.

Let us now look at some examples where the law of cosines is used to find an unknown length in a triangle.

Example 1: Using the Law of Cosines to Calculate an Unknown Length in a Triangle

𝐴𝐵𝐶 is a triangle where 𝐵𝐶=25cm, 𝐴𝐶=13cm, and 𝑚𝐶=142. Find length 𝐴𝐵 giving the answer to three decimal places.

Answer

Often, sketching out a triangle can be helpful for visualizing this type of problem (diagram not to scale).

Looking at our triangle, we can see that we have two side lengths, 𝐵𝐶 and 𝐴𝐶, and the enclosed angle, 𝐶. This situation tells us that we can use the law of cosines: 𝑎=𝑏+𝑐2𝑏𝑐𝐴.cos

We can define the values of our triangle with respect to the law of cosines, starting with the enclosed angle. The final term of our equation will therefore contain the following element: coscos𝐴142.

As required, the unknown side length, 𝐴𝐵, is opposite the enclosed angle. We therefore define the side lengths as follows: 𝑎𝐴𝐵,𝑏25,𝑐13.cmcm

Substituting these values into the law of cosine, we find the following equation: 𝐴𝐵=25+132(25)(13)142.cos

Finally, we can simplify and take the square root of both sides of our equation. We can also ignore the negative solution to our square root, since we are solving to find a length: 𝐴𝐵=1306.2069=36.1414836.141.cm

Our answer has been round to three decimal places as required by the question.

Example 2: Using the Law of Cosines to Calculate an Unknown Length in a Triangle

𝐴𝐵𝐶 is a triangle where 𝑎=13cm, 𝑏=10cm, and cos𝐶=0.2. Find the value of 𝑐 giving the answer to three decimal places.

Answer

When approaching this type of problem, it can be helpful to sketch out the triangle, as shown below (not to scale).

Looking at our triangle, we can see that we have two side lengths, 𝑎 and 𝑏, and a trigonometric evaluation for the enclosed angle, 𝐶. This situation tells us that we can use the law of cosines: 𝑐=𝑎+𝑏2𝑎𝑏𝐶.cos

Substituting these values into the law of cosines, we find the following equation: 𝑐=13+102(13)(10)0.2.

Simplifying our equation and solving for 𝑐, we get the following side length, which we round to three decimal places: 𝑐=217=14.7309114.731.cm

Let us now consider the second case in which the law of cosines can be used to solve problems. The questions we have looked at so far involved finding an unknown side length when given its opposite angle and the two adjacent side lengths.

Let now us consider a new case where we have a triangle with the side lengths 𝑎, 𝑏, and 𝑐 and we wish to find an unknown angle 𝐴.

How To: Rearranging the Law of Cosines

To help us solve this problem, we can rearrange our current equation to a more convenient form. To start, we can add 2𝑏𝑐𝐴cos to both sides of the law of cosines: 𝑎=𝑏+𝑐2𝑏𝑐𝐴𝑎+2𝑏𝑐𝐴=𝑏+𝑐.coscos

We can now subtract 𝑎 from both sides: 2𝑏𝑐𝐴=𝑏+𝑐𝑎.cos

Finally, we can divide both sides by 2𝑏𝑐, giving us the cosine of angle 𝐴 in terms of the side lengths of our triangle: cos𝐴=𝑏+𝑐𝑎2𝑏𝑐.

In this example, we have chosen to focus on angle 𝐴; however, this form of the law of cosines can be used to find any of the angles in a triangle by observing the following relationships between the variables: 𝐴,𝑎,𝑏,𝑐.theunknownangletobefoundthesideoppositetheunknownangleoneoftheadjacentsidestotheunknownangleoneoftheadjacentsidestotheunknownangle

Example 3: Using the Law of Cosines to Calculate an Angle in a Triangle

𝐴𝐵𝐶 is a triangle where 𝑎=12cm, 𝑏=20cm, and 𝑐=26cm. Find the smallest angle in 𝐴𝐵𝐶 giving the answer to the nearest second.

Answer

As with most problems of this type, it may be helpful to sketch out the triangle (not to scale) to help visualize the problem.

We know that, for any triangle, the smallest side will be opposite to the smallest angle.

Inspecting our side lengths, we can see that 𝑎<𝑏<𝑐. We can therefore conclude that angle 𝐴 is the smallest, since it is opposite side 𝑎.

In order to find 𝐴, we can use the following form of the law of cosines: cos𝐴=𝑏+𝑐𝑎2𝑏𝑐. Our side lengths then take the following values: 𝑎12,𝑏20,𝑐26.cmcmcm

Substituting these values into the law of cosines, we find the following equation: cos𝐴=20+2612(2)(20)(26). We can then multiply out each of the terms and simplify the right-hand side of the equation: cos𝐴=400+6761441040=233260.

Lastly, we solve for angle 𝐴: 𝐴=233260=26.342975.cos

We have now found 𝐴 in degrees; however, the question requires us to give a solution to the nearest second. In order to do this, we can recall the following relationship between degrees (), minutes (), and seconds (). 1=60,1=60.

Looking at our solution, we can see that 𝐴=26 with a remainder of 0.342975. We can multiply this remainder by 60 to find the number of minutes in our solution: 60×0.342975=20.578532.

Using the same method, we see that this remainder contains 20 with a remainder of 0.578532. Again multiplying this by 60, we can calculate the number of seconds: 60×0.578532=34.71195935.

We can now write our solution to the nearest second: 𝐴=262035.

Some questions may require you to use a combination of both forms of the law of cosines in order to solve a triangle. We will now explore examples where the equation is used in both forms sequentially.

Example 4: Using the Law of Cosines to Find Unknown Angles and Lengths of a Triangle

𝐴𝐵𝐶 is a triangle where 𝑎=28cm, 𝑏=17cm, and 𝑚𝐶=60. Find the missing length rounded to three decimal places and the missing angles rounded to the nearest degree.

Answer

We first sketch our triangle to visualize the problem.

Upon inspection, we see that the our triangle contains one known angle enclosed between two known side lengths: 𝐶,𝑐,𝑎,𝑏.theangleenclosedbytwoknownsidesthesideoppositetheenclosedangleoneoftheadjacentsidestotheenclosedangleoneoftheadjacentsidestotheenclosedangle

This situation tells us that we can use the first form of the law of cosines. Using this form of the equation, we can formulate a relationship between angle 𝐶 and the three sides of our triangle: 𝑐=𝑎+𝑏2𝑎𝑏𝐶.cos

We can now substitute in the known information from our triangle: 𝑐=28+172(28)(17)60.cos

Next, we evaluate each individual term on the right-hand side of our equation and simplify it. In doing this, we can recognize that cos60 is one of the exact trigonometric ratios: 𝑐=784+28995212=597.

We can now take the square root of both sides of our equation, ignoring the negative solution since we are solving to find the length, 𝑐. We round our answer to three decimal places, as stated in the question: 𝑐=597=24.43358324.434.

Let us now redraw our triangle with the newly found information.

We now have a triangle with three known sides and one known angle. In order to find either of the two remaining angles, we can use the second form of the law of cosines. Let us find angle 𝐴 using the following equation: cos𝐴=𝑏+𝑐𝑎2𝑏𝑐.

We now substitute our side lengths into the equation. Here we have chosen to use the exact length of side 𝑐=597, instead of the rounded answer, to maintain precision: cos𝐴=17+59728(2)(17)597.

We can then multiply out each of the terms and simplify the right-hand side of the equation: cos𝐴=289+597784830.741=102830.741.

We now solve for 𝐴 and round to the nearest degree as stated in the question: 𝐴==82.94783.cos

Finally, we know that angles in a triangle sum to 180. Since two of the angles in the triangle are now known, we are able to find the third by substituting into the following equation: 𝐴+𝐵+𝐶=18082.947+𝐵+60=180.

Solving for 𝐵, we complete the information for the triangle giving our final answer to the nearest degree: 𝐵=18082.94760=37.05337.

In some situations, we may not be able to use the law of cosines immediately. In such cases, it may be necessary to first use other geometric methods to find an angle or side length. Doing this will allow us to proceed using one of the methods described above in this explainer.

Here we show an example using the area of a triangle and standard trigonometric techniques.

Example 5: Solving a Triangle by Using Trigonometry in Combination with the Law of Cosines

𝐴𝐵𝐶 is a triangle where 𝐵𝐶=38cm, 𝑚𝐴𝐶𝐵=60, and the area is 3993 cm2. Find the other lengths and angles, giving the lengths to the nearest centimetre and the angles to the nearest minute.

Answer

Here we sketch the triangle using the known information.

Looking at our triangle, we have one known angle and one of its adjacent side lengths. Unfortunately, this information is not sufficient to use the law of cosines in either form! In order to proceed, we will need to make use of a combination of techniques:

  1. Use the given area to find the height of the triangle.
  2. Use trigonometry in conjunction with triangle height to find the side length (𝑏).
  3. Use the law of cosines to solve for the remaining unknowns.

1. Use the Given Area to Find the Height of the Triangle

Alongside the given angle and the side length, the question also provides us with the area of the triangle. Let us recall the formula for the area of a triangle: areabaseheight=×2. Taking 𝐵𝐶 to be the base of our triangle, let us now redraw our diagram. A new point, 𝐷, has been marked on the base of the triangle directly below point 𝐴. The line segment 𝐴𝐷 is therefore the perpendicular height () of the triangle.

Using the formula for area of a triangle, we can substitute in the known information: 3993=38×2. We can now solve to find by multiplying both sides of the equation by 2 and dividing by 38: =(2)399338=213.cm

2. Use Trigonometry in Conjunction with Triangle Height to Find Side Length 𝑏

Now that we have found the height of the triangle, let us observe triangle 𝐴𝐶𝐷. Upon inspection, we see this is a right triangle with one unknown side (𝑏) and one known angle (𝐶).

We can therefore use the rules of trigonometry to find side length 𝑏: sinoppositehypotenuse𝜃=. Looking at angle 𝐶, we find that is the opposite side and 𝑏 is the hypotenuse (within triangle 𝐴𝐶𝐷): sin𝐶=𝑏. We can substitute in the known information and rearrange our equation to find 𝑏:sinsinsin60=213𝑏𝑏(60)=213𝑏=21360. Recognizing that sin60 is one of the exact trigonometric ratios then allows us to solve:𝑏=213=(2)2133=(2)(21)=42.cm

Here we see our triangle with the new information.

3. Use the Law of Cosines to Solve for the Remaining Unknowns

Now that we have found 𝑏, we have a familiar situation within triangle 𝐴𝐵𝐶, where a known angle is enclosed between two known side lengths: 𝐶,𝑐,𝑎,𝑏.theangleenclosedbytwoknownsidesthesideoppositetheenclosedangleoneoftheadjacentsidestotheenclosedangleoneoftheadjacentsidestotheenclosedangle Using the first form of the law of cosines, we formulate a relationship between angle 𝐶 and the three sides of our triangle: 𝑐=𝑎+𝑏2𝑎𝑏𝐶.cos We now substitute in the known information from our triangle: 𝑐=38+422(38)(42)60.cos Next, we simplify the right-hand side of our equation, recognizing that cos60 is one of the exact trigonometric ratios: 𝑐=1444+1764319212=1612.

We can now take the square root of both sides of our equation, ignoring the negative solution since we are solving to find the length, 𝑐. Our answer is rounded to one decimal place, as stated in the question: 𝑐=1612=40.149.

Since we have been asked to give our answer to the nearest centimetre, we write 𝑏=40cm.

The second form of the law of cosines can be used to find either of the remaining angles, but let’s choose angle 𝐵 and construct a relationship using the following equation: cos𝐵=𝑎+𝑐𝑏2𝑎𝑐. We first substitute in our side lengths into the equation: cos𝐵=38+161242(2)(38)1612. We can now solve for 𝐵, by simplifying our terms and taking the inverse cosine of both sides. Our answer is rounded to the nearest degree as stated in the question: 𝐵=12923051.378=64.949.cos

Since we have been asked to give our answer to the nearest minute, we write 𝐵=553.

Now that we have found two angles, we can use the fact that angles in a triangle sum to 180 to solve for 𝐴, giving our answer to the nearest degree: 𝐴=18064.94960=55.051.

Since we have been asked to give our answer to the nearest minute, we write 𝐴=6457.

Key Points

  • The law of cosines allows us to relate all three sides of a triangle with one of its angles.
  • The law of cosines can be viewed as a generalized form of the Pythagorean theorem and will work for all triangles.
  • In order to find an unknown side length in a triangle when given its opposite angle and the two adjacent side lengths, we can use the following form of the law of cosines: 𝑎=𝑏+𝑐2𝑏𝑐𝐴.cos
  • In order to find an unknown angle in a triangle when given all three side lengths, we can use the following rearranged form of the law of cosines: cos𝐴=𝑏+𝑐𝑎2𝑏𝑐.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.