Toby draws a triangle that has two side lengths of 8 inches and 5 inches. He measures the included angle with a protractor and gets \begin{align*}75^\circ\end{align*}. What is the length of the third side?

### Law of Cosines

The Law of Cosines can be used to solve for the third side of a triangle when two sides and the included angle are known in a triangle. consider the non right triangle below in which we know \begin{align*}a, b\end{align*} and \begin{align*}C\end{align*}. We can draw an altitude from \begin{align*}B\end{align*} to create two smaller right triangles as shown where \begin{align*}x\end{align*} represents the length of the segment from \begin{align*}C\end{align*} to the foot of the altitude and \begin{align*}b-x\end{align*} represents the length of remainder of the side opposite angle \begin{align*}B\end{align*}.

Now we can use the Pythagorean Theorem to relate the lengths of the segments in each of the right triangles shown.

Triangle 1: \begin{align*}x^2+k^2=a^2\end{align*} or \begin{align*}k^2=a^2-x^2\end{align*}

Triangle 2: \begin{align*}(b-x)^2+k^2=c^2\end{align*} or \begin{align*}k^2=c^2-(b-x)^2\end{align*}

Since both equations are equal to \begin{align*}k^2\end{align*}, we can set them equal to each other and simplify:

\begin{align*}a^2-x^2 &=c^2-(b-x)^2 \\ a^2-x^2 &=c^2-(b^2-2bx+x^2) \\ a^2-x^2 &=c^2-b^2+2bx-x^2 \\ a^2 &=c^2-b^2+2bx \\ a^2+b^2-2bx &=c^2\end{align*}

Recall that we know the values of \begin{align*}a\end{align*} and \begin{align*}b\end{align*} and the measure of angle \begin{align*}C\end{align*}. We don’t know the measure of \begin{align*}x\end{align*}. We can use the cosine ratio as show below to find an expression for \begin{align*}x\end{align*} in terms of what we already know.

\begin{align*} \cos C=\frac{x}{a} \quad \text{so} \quad x=a \cos C\end{align*}

Finally, we can replace \begin{align*}x\end{align*} in the equation to get the Law of Cosines: \begin{align*}a^2+b^2-2ab \cos C=c^2\end{align*}

Keep in mind that \begin{align*}a\end{align*} and \begin{align*}b\end{align*} are the sides of angle \begin{align*}C\end{align*} in the formula.

#### Solve the following problems

Find \begin{align*}c\end{align*} when \begin{align*}m \angle C=80^\circ, a = 6\end{align*} and \begin{align*}b = 12\end{align*}.

Replacing the variables in the formula with the given information and solve for \begin{align*}c\end{align*}:

\begin{align*}c^2 &=6^2+12^2-2(6)(12) \cos 80^\circ \\ c^2 & \approx 154.995 \\ c & \approx 12.4\end{align*}

Find \begin{align*}a\end{align*}, when \begin{align*}m \angle A=43^\circ\end{align*}, \begin{align*}b=16\end{align*} and \begin{align*}c=22\end{align*}.

This time we are given the sides surrounding angle \begin{align*}A\end{align*} and the measure of angle \begin{align*}A\end{align*}. We can rewrite the formula as: \begin{align*}a^2=c^2+b^2-2cb \cos A\end{align*}. Just remember that the length by itself on one side should be the side opposite the angle in the cosine ratio. Now we can plug in our values and solve for \begin{align*}a\end{align*}.

\begin{align*}a^2 &=16^2+22^2-2(16)(22) \cos 43^\circ \\ a^2 & \approx 225.127 \\ a & \approx 15 \end{align*}

Rae is making a triangular flower garden. One side is bounded by her porch and a second side is bounded by her fence. She plans to put in a stone border on the third side. If the length of the porch is 10 ft and the length of the fence is 15 ft and they meet at a \begin{align*}100^\circ\end{align*} angle, how many feet of stone border does she need to create?

Let the two known side lengths be \begin{align*}a\end{align*} and \begin{align*}b\end{align*} and the angle between is \begin{align*}C\end{align*}. Now we can use the formula to find \begin{align*}c\end{align*}, the length of the third side.

\begin{align*}c^2 &=10^2+15^2-2(10)(15) \cos 100^\circ \\ c^2 & \approx 377.094 \\ c & \approx 19.4\end{align*}

So Rae will need to create a 19.4 ft stone border.

### Examples

#### Example 1

Earlier, you were asked what is the length of the third side.

We are trying to find \begin{align*}c\end{align*}. We are given \begin{align*}m \angle C=75^\circ, a = 8\end{align*} and \begin{align*}b = 5\end{align*}.

Replacing the variables in the formula with the given information and solve for \begin{align*}c\end{align*}:

\begin{align*}c^2 &=8^2+5^2-2(8)(5) \cos 75^\circ \\ c^2=64 + 25 - 80 \cos 75^\circ \\ c^2=89 - 80(0.26)\\ c^2 & \approx 68.2 \\ c & \approx 8.26\end{align*}

Therefore, the third side is approximately 8.26 inches long.

#### Example 2

Find \begin{align*}c\end{align*} when \begin{align*}m \angle C=75^\circ, a = 32\end{align*} and \begin{align*}b = 40\end{align*}.

\begin{align*}c^2 &=32^2+40^2-2(32)(40) \cos 75^\circ \\
c^2 & \approx 1961.42 \\
c & \approx 44.3\end{align*}

#### Example 3

Find \begin{align*}b\end{align*} when \begin{align*}m \angle B=120^\circ, a = 11\end{align*} and \begin{align*}c =17\end{align*}.

\begin{align*}b^2 &=11^2+17^2-2(11)(17) \cos 120^\circ \\
b^2 & \approx 597 \\
b & \approx 24.4\end{align*}

#### Example 4

Dan likes to swim laps across a small lake near his home. He swims from a pier on the north side to a pier on the south side multiple times for a workout. One day he decided to determine the length of his swim. He determines the distances from each of the piers to a point on land and the angles between the piers from that point to be \begin{align*}50^\circ\end{align*}. How many laps does Dan need to swim to cover 1000 meters?

\begin{align*}c^2 &=30^2+35^2-2(30)(35) \cos 50^\circ \\
c^2 & \approx 775.146 \\
c & \approx 27.84\end{align*}

Since each lap is 27.84 meters, Dan must swim \begin{align*}\frac{1000}{27.84} \approx 36\end{align*} laps.

### Review

Use the Law of Cosines to find the value of \begin{align*}x\end{align*}, to the nearest tenth, in problems 1 through 6.

For problems 7 through 10, find the unknown side of the triangle. Round your answers to the nearest tenth.

- Find \begin{align*}c\end{align*}, given \begin{align*}m \angle C=105^\circ\end{align*}, \begin{align*}a = 55\end{align*} and \begin{align*}b = 61\end{align*}.
- Find \begin{align*}b\end{align*}, given \begin{align*}m \angle B=26^\circ\end{align*}, \begin{align*}a = 33\end{align*} and \begin{align*}c = 24\end{align*}.
- Find \begin{align*}a\end{align*}, given \begin{align*}m \angle A=77^\circ\end{align*}, \begin{align*}b = 12\end{align*} and \begin{align*}c = 19\end{align*}.
- Find \begin{align*}b\end{align*}, given \begin{align*}m \angle B=95^\circ\end{align*}, \begin{align*}a = 28\end{align*} and \begin{align*}c = 13\end{align*}.
- Explain why when \begin{align*}m \angle C=90^\circ\end{align*}, the Law of Cosines becomes the Pythagorean Theorem.
- Luis is designing a triangular patio in his backyard. One side, 20 ft long, will be up against the side of his house. A second side is bordered by his wooden fence. If the fence and the house meet at a \begin{align*}120^\circ\end{align*} angle and the fence is 15 ft long, how long is the third side of the patio?

### Answers for Review Problems

To see the Review answers, open this PDF file and look for section 13.15.