3.3 The Law of Cosines
If we know two angles and one side of a triangle, we can use the Law of Sines to solve the triangle. We can also use the Law of Sines when we know two sides and the angle opposite one of them. But the Law of Sines is not helpful for the problem that opened this chapter, finding the distance from Avery to Clio. In this case we know two sides of the triangle, and , and the included angle, .
To solve a triangle when we know two sides and the included angle, we will need a generalization of the Pythagorean theorem known as the Law of Cosines.
In a right triangle, with , the Pythagorean theorem tells us that
If we allow angle to vary, but keep and the same length, the side will grow or shrink, depending on whether we increase or decrease the angle , as shown below.
The Pythagorean theorem is actually a special case of a more general law that applies to all triangles, no matter what the size of angle . The equation relating the three sides of a triangle is
You can see that when is a right angle, , so the equation reduces to the Pythagorean theorem.
We can write similar equations involving the angles or or . The three equations are all versions of the Law of Cosines.
Finding a Side
Now we can solve the problem of the distance from Avery to Clio. Here is the figure from Section 3.1 showing the location of the three towns.
In , , and . Find , and round your answer to two decimal places.
We use the Law of Cosines.
so .
Finding an Angle
We can also use the Law of Cosines to find an angle when we know all three sides of a triangle. Pay close attention to the algebraic steps used to solve the equation in the next example.
In , , and . Find angle , and round your answer to two decimal places.
Substitute the known values into the Law of Cosines to get
from which we find , so
.
Once we have calculated one of the angles in a triangle, we can use either the Law of Sines or the Law of Cosines to find a second angle. Here is how we would use the Law of Sines to find angle in the previous Example.
Thus, . There are two angles with sine , but we know that is an acute angle because it is opposite the shortest side of the triangle. Finally,
Alternatively, we can use the Law of Cosines to find angle .
Navigation
Even with the aid of GPS (Global Positioning System) instruments, aircraft pilots and ship captains need to understand navigation based on trigonometry.
Howard wants to fly from Anchorage to Nome, Alaska, a distance of 540 miles on a heading west of north. After flying for some time, he discovers that his heading is in error, and he is actually flying west of north. Howard corrects his flight plan and changes course when he is exactly 200 miles from Anchorage. What is his new heading, and how far is he from Nome?
We use the Law of Cosines to find his distance from Nome:
Solving for gives 344.8. Next, use either law to find that angle is . The new heading is plus the supplement of , or west of north, and the distance is 344.8 miles.
Which Law to Use
How can we decide which law, the Law of Sines or the Law of Cosines, is appropriate for a given problem?
- If we are solving a right triangle, we don't need the Laws of Sines and Cosines; all we need are the definitions of the trigonometric ratios.
- But for oblique triangles, we can identify the following cases:
In the triangle at right, which part of the triangle can you find, and which law should you use?
We know two sides and the included angle, so we can find side using the Law of Cosines.
In the previous Example we used the Law of Sines to find an angle. Because there are always two angles with a given sine, we should check whether both possible angles result in a triangle. But here is another approach: We can apply the Law of Cosines to find the third side first. With that method, we'll need the quadratic formula.
Using the Law of Cosines for the Ambiguous Case
In Section 3.2 we encountered the ambiguous case:
If we know two sides and of a triangle and the acute angle opposite one of them, there may be one solution, two solutions, or no solution, depending on the size of in relation to and , as shown below.
To discover which case applies (no triangle, one triangle, or two triangles), we can begin by using the Law of Cosines to find the third side. As we saw in the previous Example, for this method we need the quadratic formula.
A quadratic equation can have one solution, two solutions, or no solution, depending on the value of the discriminant, . (Note that the discriminant is the expression under the radical in the quadratic formula. Perhaps you recall how the discriminant determines the number of solutions, and why.)
- If , the equation has two solutions.
- If , the equation has one solution.
- If , the equation has no (real) solution.
And the number of solutions determines the number of triangles that fit the given properties.
- If the quadratic equation has one positive solution, there is one triangle.
- If the quadratic equation has two positive solutions, there are two triangles.
- If the quadratic equation has no positive solutions, there is no triangle with the given properties.
Use the Law of Cosines to find all triangles with , and .
Using the Law of Cosines to find side , we get the equation
Putting this quadratic equation into standard form we get
The discriminant is
Because the discriminant is negative, the equation has no solution, and there is no triangle satisfying the stated conditions.
Review the following skills you will need for this section.
Section 3.3 Summary
Vocabulary
- Quadratic equation
- Quadratic formula
- Discriminant
Concepts
- The Law of Sines is not helpful when we know two sides of the triangle and the included angle. In this case we need the Law of Cosines.
- We can also use the Law of Cosines to find an angle when we know all three sides of a triangle.
- We can use the Law of Cosines to solve the ambiguous case.
Study Questions
- The Law of Cosines is really a generalization of what familiar theorem?
- If you know all three sides of a triangle and one angle, what might be the advantage in using the Law of Cosines o find another angle, instead of the Law of Sines?
- State the quadratic formula from memory. Try to sing the quadratic formula to the tune of "Pop Goes the Weasel."
- Francine is solving a triangle in which , and . She finds that . How does she know that , and not ?
Skills
- Use the Law of Cosines to find the side opposite an angle #7-12
- Use the Law of Cosines to find an angle #13-20
- Use the Law of Cosines to find a side adjacent to an angle #21-26
- Decide which law to use #27-34
- Solve a triangle #35-42
- Solve problems using the Law of Cosines #43-56
Homework 3.3
- Simplify
- Evaluate the expression in part (a) for
- Evaluate the expression in part (a) for
- 12.78
- 135.22
- Simplify
- Evaluate the expression in part (a) for
- Evaluate the expression in part (a) for
- Solve for
- For the equation in part (a), find if , and .
- Solve for
- For the equation in part (a), find if , and .
- The equation is quadratic in . Write the equation in standard form.
- Solve the equation in part (a) for if .
- The equation is quadratic in . Write the equation in standard form.
- Solve the equation in part (a) for if .
For Problems 7–12, use the Law of Cosines to find the indicated side. Round to two decimal places.
7.70
13.44
5.12
For Problems 13–16,use the Law of Cosines to find the indicated angle. Round to two decimal places.
For Problems 17–20, find the angles of the triangle. Round answers to two decimal places.
For Problems 21–26, use the Law of Cosines to find the unknown side. Round your answers to two decimal places.
6.30 or 2.70
29.76 or 5.91
16.00
For Problems 27–34, which law should you use to find the labeled unknown value, the Law of Sines or the Law of Cosines? Write an equation you can solve to find the unknown value. For Problems 31-34, you may need two steps to find the unknown value.
Law of Cosines:
Law of Sines:
First the Law of Cosines: , then either the Law of Sines: or the Law of Cosines:
Law of Cosines: , or use the Law of Sines first to find the (acute) angle opposite the side of length 4, then find the angle opposite the side of length by subtracting the sum of the known angles from , then using the Law of Sines again.
For Problems 35–42,
- Sketch and label the triangle.
- Solve the triangle. Round answers to two decimal places.
- , ,
- , ,
- , , or , ,
- , ,
For Problems 43–52,
- Sketch and label a triangle to illustrate the problem.
- Solve the problem. Round answers to one decimal place.
A surveyor would like to know the distance across a small lake, as shown in the figure. She stands at point and measures the angle between the lines of sight to points and at . She also finds meters and meters. Calculate the distance .
- 1383.3 m
Highway engineers plan to drill a tunnel through Boney Mountain from to , as shown in the figure. The angle at point is , and the distances to and are 900 yards and 2500 yards, respectively. How long will the tunnel be?
Two pilots leave an airport at the same time. One pilot flies east of north at a speed of 320 miles per hour, the other flies east of north at a speed of 406 miles per hour. How far apart are the two pilots after 3 hours? What is the heading from the first plane to the second plane at that time?
- 2123 mi, east of north
Two boats leave port at the same time. One boat sails due west at a speed of 17 miles per hour, the other powers east of north at a speed of 23 miles per hour. How far apart are the two boats after 2 hours? What is the heading from the first boat to the second boat at that time?
Caroline wants to fly directly south from Indianapolis to Cancun, Mexico, a distance of 1290 miles. However, to avoid bad weather, she flies for 400 miles on a heading east of south. What is the heading to Cancun from that location, and how far is it?
- west of south, 917.9 mi
Alex sails 8 miles from Key West, Florida on a heading east of south. He then changes course and sails for 10 miles due east. What is the heading back to Key West from that point, and how far is it?
The phone company wants to erect a cell tower on a steep hill inclined to the horizontal. The installation crew plans to run a guy wire from a point on the ground 20 feet uphill from the base of the tower and attach it to the tower at a height of 100 feet. How long should the guy wire be?
- 92.99 ft
Sandstone Peak rises 3500 feet above the desert. The Park Service plans to run an aerial tramway up the north face, which is inclined at an angle of to the horizontal. The base station will be located 500 feet from the foot of Sandstone Peak. Ignoring any slack in the cable, how long should it be?
The sides of a triangle are 27 cm, 15 cm, and 20 cm. Find the area of the triangle. (Hint: Find one of the angles first.)
The sides of a parallelogram are 10 inches and 8 inches, and form an angle of . Find the lengths of the diagonals of the parallelogram.
For Problems 53–56, find , the distance from one vertex to the foot of the altitude.
10.53
4.08
Problems 57 and 58 prove the Law of Cosines.
- Copy the three figures above showing the three possibilities for an angle in a triangle: is acute, obtuse, or a right angle. For each figure, explain why it is true that , then rewrite the right side to get .
- For each figure, explain why it is true that .
- For all three figures, is the distance from the origin to the point . Use the definition of cosine to write in terms of and , then solve your equation for .
- Start with the last equation from (a), and substitute expressions from (b) and (c) to conclude one case of the Law of Cosines.
- First figure: is the base of the small right triangle. Second: is the horizontal distance between and the -axis, so or is the base of the large right triangle. Third: , and is the base of a right triangle.
- First: and are the legs of a right triangle, is the hypotenuse. Second: and are the legs of a right triangle with hypotenuse . Third: and
Demonstrate the other two cases of the Law of Cosines:
(Hint: See Problem 57 and switch the roles of and , etc.)
Use the Law of Cosines to prove the projection laws:
Illustrate with a sketch. (Hint: Add together two of the versions of the Law of Cosines.)
so , and dividing both sides by yields
If is isosceles with , show that .
Use the Law of Cosines to prove:
For the first equation, start with the Law of Cosines in the form
Add to both sides of the equation, factor the right side, then divide both sides by .
For the second equation, start with the Law of Cosines in the form
Add to both sides of the equation, factor the right side, then divide both sides by .
Prove that
Trigonometry by Katherine Yoshiwara (yoshiwarabooks.org), GNU Free Documentation License 1.2 or later. Adapted for the XYZ HTML edition with the authors' permission (recorded 2026-07-04). License: GFDL-1.2-or-later.