#### CHECK OUT SHMOOP'S FREE STUDY TOOLS: Essay Lab | Math Shack | Videos

# Right Triangles and Trigonometry

# Law of Cosines

The Law of Sines can be very useful, but there are cases where it won't do. Don't get us wrong. It's taken us this far and we owe it some gratitude. But no man is an island and the Law of Sines can't do it all alone. Take this triangle, for example.

Any way we try, the Law of Sines just won't cut it. Luckily, we have another law that we can use. Since this second law cooperates well with the Law of Sines, we'll call it the **Law of Cosines**.

For any triangle, represented by the triangle above, the Law of Cosines says that the following are true:

*a*^{2} = *b*^{2} + *c*^{2} – 2*bc* cos *A**b*^{2} = *a*^{2} + *c*^{2} – 2*ac* cos *B**c*^{2} = *a*^{2} + *b*^{2} – 2*ab* cos *C*

These formulas will help us when the Law of Sines can't, but before we use them, we have to prove them.

We'll start off with a slightly altered Pythagorean theorem. Let *AD* = *x*, which means that *DB* = *c* – *x*. In this case, *a* and *b* are the hypotenuses.

(c – x)^{2} + h^{2} = a^{2} |
Apply Pythagorean theorem to ΔCDB |

c^{2} – 2cx + x^{2} + h^{2} = a^{2} |
Multiplying out (c – x)^{2} |

x^{2} + h^{2} = b^{2} |
Apply Pythagorean theorem to ΔADC |

c^{2} – 2cx + b^{2} = a^{2} |
Substitute in b^{2} for x^{2} + h^{2} |

cos A = ^{x}⁄_{b} |
Definition of cos A |

b cos A = x |
Rearrange (multiply both sides by b) |

c^{2} – 2bc cos A + b^{2} = a^{2} |
Substitute in b cos A for x |

a^{2} = b^{2} + c^{2} – 2bc cos A | Rearrange, thanks to the commutative property |

We're good to go. Bring it on, triangles.

### Sample Problem

Now we can solve this triangle. Let the only unknown side be *a*, ∠*A* = 84°, and *b* = 10 and *c* = 12. We'll start with our fresh new law.

*a*^{2} = *b*^{2} + *c*^{2} – 2*bc* cos *A*

Fill it up.

*a*^{2} = (10)^{2} + (12)^{2} – 2(10)(12) cos(84°)*a*^{2} = 100 + 144 – 240 cos(84°)*a*^{2} = 244 – 25.1*a*^{2} = 218.9*a* ≈ 14.8

Great. If we wanted to solve the entire triangle, we could find the remaining angles using either the Law of Sines or the Law of Cosines. Hooray for freedom.

Law of Sines is also useless if we have a triangle without any known angles.

### Sample Problem

With this triangle, the Law of Sines wouldn't amount to squat. Zip. Zero. Nada. Thank goodness we have the Law of Cosines to help us out.

*a*^{2} = *b*^{2} + *c*^{2} – 2*bc* cos *A*

Hold up. If we plug in all the sides now, moving the terms around will be more uncomfortable than an elephant in a broom closet. Isolating our variable will make things easier for us in the long run. When we do, we end up with this piece of work:

Now we can substitute our values without breaking a sweat.

All right. Time to pull out the abacus. On second thought, a calculator is probably a better idea.

*A* ≈ 87.2°

Nice job. Since we have an angle, we can choose whether to use the Law of Cosines or the Law of Sines to solve for the other two angles. The Law of Sines is probably easier, but that's not what this chapter's all about.

*b*^{2} = *a*^{2} + *c*^{2} – 2*ac* cos *B*

Much like the Power Rangers, it's morphin' time!

Now we can plug in our side lengths.

*B* ≈ 55.4°

Wonderfully done. For the last angle, we have not one, not two, but *three* different options.

- We could use the Law of Cosines.
- We could use the Law of Sines.
- We could use the fact that all angles in a triangle add up to 180°.

We've done them all, and they'll all give us the same answer. Just to practice, we'll give the Law of Cosines one more go.

*c*^{2} = *a*^{2} + *b*^{2} – 2*ab* cos *C*

We're still looking for an angle. Let's act like it.

Replace the letters with numbers. This is math, after all.

*C* ≈ 37.4°

The Law of Cosines, while very useful, is also very jumbled. All the letters and numbers and exponents and pluses and minuses… it's easy to get confused. The Law of Sines on the other hand, is quite simple. That's why with the Law of Cosines, it's best to cosign with some other formulas so that things don't get too muddled. Cosine…cosign…get it?