What is the law of cosines, and how do I use it?
Open a pair of scissors wider: the blades stay the same length, but the distance between their tips grows.
Match the angle and side
The law of cosines says c² = a² + b² − 2ab cos(C). Here a and b are the lengths of the sides that meet at angle C, and c is the length of the side across from C. The term cos(C) means the cosine of that angle; it tells you how the opening between the sides affects their tip-to-tip distance.
See the cosine correction
Drop a perpendicular from the top corner to the base to make two right triangles. The short base segment, x, is the part of side b that points along the base: x = b cos(C). Both right triangles have the same height, so Pythagoras gives b² − x² = c² − (a − x)². Expanding the square cancels the x² terms and leaves the correction −2ax, or −2ab cos(C).
Find a missing side
Suppose two sides are 5 cm and 8 cm, and the angle between them is 60°. Substitute to get c² = 5² + 8² − 2(5)(8) cos(60°). Since cos(60°) = 0.5, this gives c² = 25 + 64 − 40 = 49. Take the square root: the missing side is 7 cm.
Work backward for an angle
If you know all three sides, choose the angle you want and call the side across from it c. Rearrange to get cos(C) = (a² + b² − c²)/(2ab). Use inverse cosine, the cos⁻¹ key, to turn that number back into an angle; use degree mode for an answer in degrees.
Two side lengths tell you how long the arms of a triangle are; the angle between them determines how far apart their tips are. The law of cosines connects all three lengths to that angle.
Questions students ask
Can I plug in any angle I’m given?
A common slip is using an angle that isn’t between a and b. Check that the side you call c is directly opposite the angle you call C.
What happens if the angle is 90°?
Since cos(90°) = 0, the correction disappears. You get the Pythagorean theorem: c² = a² + b².
Does the correction always make c² smaller?
No. For an angle greater than 90°, the cosine is negative, so subtracting the correction makes c² greater than a² + b².
Check yourself
Sides of 4 cm and 9 cm meet at corner P. Which angle goes into the formula to find the third side?
Use angle P because it lies between the two known sides.
You calculate c² = 36 for lengths measured in meters. What is c?
The side is 6 meters because a length is the positive square root of its square.
Two sides stay fixed while the angle between them opens from 60° to 90°. What happens to the opposite side?
It gets longer because the cosine drops from 0.5 to 0, so less is subtracted.

Snap your own page
Stuck on a page of your own? Take a photo and Slime makes it easy, without giving away the answer.
Snap your own pageMore topics
This topic in other languages: 한국어日本語
Written by Slime, an AI. It can be wrong: check with your textbook or teacher.