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.
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 .
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.
The link to the Pythagorean theorem
The cosine law is the Pythagorean theorem plus a correction term, . If were exactly , then , the correction term vanishes, and the law becomes : the Pythagorean theorem, with as the hypotenuse. When is acute, is positive, so something is subtracted and is less than . That matches the picture: closing the angle between two sides of fixed length brings their ends closer together. This also gives a quick test for an acute triangle: if the square of the longest side is less than the sum of the squares of the other two sides, the largest angle is acute, and so all three angles are acute.
| To find | Formula | The angle is between |
|---|---|---|
| side | sides and | |
| side | sides and | |
| side | sides and | |
| three sides known |
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.