5.1: Non-right Triangles - Law of Cosines
( \newcommand{\kernel}{\mathrm{null}\,}\)
Learning Objectives
- Understand how the Law of Cosines is derived.
- Apply the Law of Cosines when you know two sides and the inclusion of an oblique (non-right) triangle (SAS).
- Apply the Law of Cosines when you know all three sides of an oblique triangle.
- Identify accurate drawings of oblique triangles.
- Use the Law of Cosines in real-world and applied problems.
Suppose a boat leaves port, travels

Unfortunately, while the Law of Sines enables us to address many non-right triangle cases, it does not help us with triangles where the known angle is between two known sides, a SAS (side-angle-side) triangle, or when all three sides are known, but no angles are known, a SSS (side-side-side) triangle. In this section, we will investigate another tool for solving oblique triangles described by these last two cases.
Using the Law of Cosines to Solve Oblique Triangles
The tool we need to solve the problem of the boat’s distance from the port is the Law of Cosines, which defines the relationship among angle measurements and side lengths in oblique triangles. Three formulas make up the Law of Cosines. At first glance, the formulas may appear complicated because they include many variables. However, once the pattern is understood, the Law of Cosines is easier to work with than most formulas at this mathematical level.
Understanding how the Law of Cosines is derived will be helpful in using the formulas. The derivation begins with the Generalized Pythagorean Theorem, which is an extension of the Pythagorean Theorem to non-right triangles. Here is how it works: An arbitrary non-right triangle

We can drop a perpendicular from
In terms of
The formula derived is one of the three equations of the Law of Cosines. The other equations are found in a similar fashion.
Keep in mind that it is always helpful to sketch the triangle when solving for angles or sides. In a real-world scenario, try to draw a diagram of the situation. As more information emerges, the diagram may have to be altered. Make those alterations to the diagram and, in the end, the problem will be easier to solve.
The LAW OF COSINES
The Law of Cosines states that the square of any side of a triangle is equal to the sum of the squares of the other two sides minus twice the product of the other two sides and the cosine of the included angle.

For triangles labeled as in Figure
To solve for a missing side measurement, the corresponding opposite angle measure is needed.
When solving for an angle, the corresponding opposite side measure is needed. We can use another version of the Law of Cosines to solve for an angle.
How to: Given two sides and the angle between them (SAS), find the measures of the remaining side and angles of a triangle
- Sketch the triangle. Identify the measures of the known sides and angles. Use variables to represent the measures of the unknown sides and angles.
- Apply the Law of Cosines to find the length of the unknown side or angle.
- Apply the Law of Sines or Cosines to find the measure of a second angle.
- Compute the measure of the remaining angle.
Example
Find the unknown side and angles of the triangle in Figure

Solution
First, make note of what is given: two sides and the angle between them. This arrangement is classified as SAS and supplies the data needed to apply the Law of Cosines.
Each one of the three laws of cosines begins with the square of an unknown side opposite a known angle. For this example, the first side to solve for is side
Because we are solving for a length, we use only the positive square root. Now that we know the length
The other possibility for
The complete set of angles and sides is
Exercise
Find the missing side and angles of the given triangle:
- Answer
-
, , .
Example
Find the angle
Solution
For this example, we have no angles. We can solve for any angle using the Law of Cosines. To solve for angle
See Figure

Analysis
Because the inverse cosine can return any angle between
Exercise
Given
- Answer
-
, ,
Solving Applied Problems Using the Law of Cosines
Just as the Law of Sines provided the appropriate equations to solve a number of applications, the Law of Cosines is applicable to situations in which the given data fits the cosine models. We may see these in the fields of navigation, surveying, astronomy, and geometry, just to name a few.
Example
On many cell phones with GPS, an approximate location can be given before the GPS signal is received. This is accomplished through a process called triangulation, which works by using the distances from two known points. Suppose there are two cell phone towers within range of a cell phone. The two towers are located
Solution
For simplicity, we start by drawing a diagram similar to Figure

Using the Law of Cosines, we can solve for the angle
To answer the questions about the phone’s position north and east of the tower, and the distance to the highway, drop a perpendicular from the position of the cell phone, as in Figure

Using the angle
The cell phone is approximately
Example
Returning to our problem at the beginning of this section, suppose a boat leaves port, travels

Solution
The boat turned 20 degrees, so the obtuse angle of the non-right triangle is the supplemental angle,
The boat is about
Key Equations
Law of Cosines |
|
Key Concepts
- The Law of Cosines defines the relationship among angle measurements and lengths of sides in oblique triangles.
- The Generalized Pythagorean Theorem is the Law of Cosines for two cases of oblique triangles: SAS and SSS. Dropping an imaginary perpendicular splits the oblique triangle into two right triangles or forms one right triangle, which allows sides to be related and measurements to be calculated. See Example
and Example . - The Law of Cosines is useful for many types of applied problems. The first step in solving such problems is generally to draw a sketch of the problem presented. If the information given fits one of the three models (the three equations), then apply the Law of Cosines to find a solution. See Example
and Example .
Contributors and Attributions
Jay Abramson (Arizona State University) with contributing authors. Textbook content produced by OpenStax College is licensed under a Creative Commons Attribution License 4.0 license. Download for free at https://openstax.org/details/books/precalculus.