Skip to content
Study Hall
Lesson 2 of 3Trigonometry of Acute Triangles
Unit 7 · Lesson 2 of 3

The Cosine Law

When you know two sides and the angle between them, or all three sides, the sine law has no complete pair to start from. The cosine law, , fills the gap. It is the Pythagorean theorem with a correction term, and the correction is 0 when the angle is .

5 min read9 practice questionsInteractiveAsk AI about this →

Key things to remember

  1. 1Cosine law: (and similarly , ).
  2. 2For an angle: , where is the side opposite .
  3. 3Use it for SAS (find the third side) and SSS (find an angle): the cases with no complete opposite pair.
  4. 4It is developed from an altitude using the Pythagorean theorem and ; when , and it becomes .
  5. 5If the longest side squared is less than the sum of the squares of the other two, the triangle is acute.

A community garden has two straight fences that meet at a corner: one is 12 m long, the other 15 m, and the angle between them is . You want to close off the triangle with a third fence running straight from the end of one fence to the end of the other. How long must it be? Try the sine law: you know one angle (), but the side opposite it is exactly what you are looking for, and the sides you know (12 m and 15 m) sit across from angles you don't know. There is no complete opposite pair, so the sine law is stuck. You need a formula that links two sides, the angle between them, and the side across from that angle. That formula is the cosine law.

The cosine law, written to find side a, which is opposite angle A. Angle A is the angle between sides b and c.

Where the cosine law comes from

Once again, make right triangles with an altitude. In acute triangle , drop the altitude from to point on side . Let be the length . Because the whole side is , the other piece is . Now use the two right triangles. In the left one, , the Pythagorean theorem gives , and the cosine ratio gives , so . In the right one, , the Pythagorean theorem gives .

Developing the cosine lawLink to the Pythagorean theoremABCDbahxc − xLeft: b² = x² + h², and x = b cos ARight: a² = (c − x)² + h² = c² − 2cx + x² + h²Swap x² + h² for b², and x for b cos A:a² = b² + c² − 2bc cos A55°Acbbaa∠A = 90°: cos A = 0, so a² = b² + c²∠A = 55°: cos A ≈ 0.57, so 2bc cos Ais taken away and side a is shorterSame b and c; only the angle between them changes.
Fig 1Left: the altitude h splits side AB into x and c − x, and the two right triangles lead to a² = b² + c² − 2bc cos A. Right: two triangles with the same sides b and c; at 90° the cosine law is the Pythagorean theorem, and at 55° side a is shorter.

Look at what happened. Expanding gave . The pair was replaced by from the left triangle, and was replaced by . Both right triangles were needed, and both tools from right-triangle trigonometry appeared: the Pythagorean theorem and the cosine ratio. That is where the law gets its name. You don't need to reproduce this argument, but it shows exactly why the formula has the shape it does.

Finding an angle from three sides

To find an angle, rearrange the law so the cosine is alone: start from , add to both sides and subtract to get , then divide by . The side in the subtracted spot, , is the side opposite the angle you want. Then use . Unlike the inverse sine, gives the correct angle in any triangle, because no two different angles between and share a cosine. A good habit: find the largest angle first (it is opposite the longest side). If it comes out under , the triangle is acute.

Loading interactive…
Choose Solve, then Acute, and pick SAS or SSS: type in the measures and watch the triangle drawn to scale and solved step by step, starting with the cosine law.
Order of operations
In , the product is worked out first, then subtracted. Do not compute and then multiply by . On a calculator, type the whole right side in one line, or find on its own first.
VideoRearranging the cosine law to find an angle when all three sides are known.Watch on YouTube

Worked examples

Reveal one step at a time and try to beat it to the next line.

Example 1
Two fences of 12 m and 15 m meet at an angle of . How long is the straight fence that joins their far ends, to one decimal place?
Example 2
A triangle has sides 6 cm, 7 cm and 8 cm. Find all three angles to the nearest degree.
Example 3
In , cm, cm and . Find side to one decimal place, then and to the nearest degree.
Example 4
Sides and meet at . Use the cosine law to find side when and when , to one decimal place.

Where marks get lost

  • Subtracting before multiplying: computing instead of . For the garden this gives and a fence of about 1.8 m instead of 15.7 m.
  • Using an angle that is not between the two known sides. In , the angle must be the one formed by sides and , which is the one opposite .
  • Forgetting the square root at the end: means , not 245.9.
  • Putting the wrong side in the subtracted spot when finding an angle. In , the subtracted side is the one opposite the angle you want.
  • Rounding each angle and then using rounded values in the angle sum. Rounded angles can add to or ; keep the unrounded values until the end.

Flashcards 7

Cosine law (finding a side)
Cosine law (finding an angle)
When to use the cosine law
Cosine law when the angle is 90°
+ 3 more

Practice

1
In , m, m, and . Find side , to one decimal place.
m
2
A triangle has sides 9 cm, 11 cm and 13 cm. Find its largest angle, to the nearest degree.
°
3
In , , and . What is the exact value of ? (Give a decimal or a fraction.)
4
Which equation correctly finds side in ?
5
For the garden (, , ), someone writes and gets m. What went wrong?
6
What is the value of ? (This is why the cosine law turns into the Pythagorean theorem for a right angle.)
7
Which set of side lengths makes an acute triangle?
8
Put the steps in order to find angle C of a triangle when all three sides are known.
  1. 1Substitute the side lengths and simplify the top and the bottom.
  2. 2Use the inverse cosine to get angle C.
  3. 3Divide to get the value of cos C.
  4. 4Identify side c, the side opposite angle C, and write cos C = (a² + b² − c²) / (2ab) with c in the subtracted spot.
9
Match what you know about a triangle with the tool you use first.
Two sides and the angle between them
All three sides
Two angles and the side between them
A right angle and both legs

Spot a mistake on this page? Let us know