Applying the law of cosines comes down to four moves: match the angle to its opposite side, pick the right form of the equation, substitute carefully (watching units and calculator mode), and check that the answer is reasonable. The law works on triangles that are not right when you know either two sides with the included angle or all three sides. For sides , , opposite angles , , ,
where side is opposite angle , and is the angle between sides and . The same pattern rotates:
If then and the formula collapses to , so the law of cosines generalizes the Pythagorean theorem.
When to use the law of cosines
The most common setup is SAS: two sides and the included angle (the angle formed by the two known sides). It also handles SSS: all three sides known, solving for an angle — there you rearrange before using inverse cosine. If instead you know a side and its opposite angle, the law of sines is usually the better first tool. The law of cosines is the standard choice in geometry, trigonometry, surveying, navigation, and any non-right-triangle distance problem.
What the formula is doing
With two sides fixed, the third depends on the angle between them. A larger included angle makes the opposite side longer; a smaller one makes it shorter. The term corrects the bare sum for that angle — and that correction is the part worth remembering. Drop it and you are treating every triangle as a right triangle.
The procedure, step by step
- Match angle and opposite side. Pick the angle you know or want, then label the side across from it.
- Choose the right form. Use when is opposite , or the matching version for or .
- Substitute with units and angle mode. Insert the known values and set the calculator to degrees or radians to match the problem.
- Solve and check reasonableness. The unknown side must fit the triangle, and a right-angle case should reduce to Pythagoras.
A full run-through: find a side
A triangle has , , and included angle . Find .
Step 1: is opposite . Step 2: use . Step 3, substitute:
Since ,
so . Step 4: that fits — the third side is longer than but shorter than , consistent with a moderate angle.
Finding an angle from three sides
With all three sides known, isolate the cosine first:
This makes sense only when , , form a valid triangle. If the value inside leaves , there is an earlier algebra or data error.
Why the formula holds
A clean proof uses coordinates. Place one vertex at , another at , and the third at , since that point is distance from the origin at angle . The distance formula gives
which expands to
Apply and the last two terms combine into , leaving
Where each step trips people up
- At "match angle and opposite side," pairing the wrong ones. If you use angle , the left side must be .
- At "choose the right form," dropping the correction. When the angle is not , you cannot discard .
- At "substitute," wrong calculator mode. Degrees in the problem means degree mode; radians means radian mode.
- At the SSS route, sloppy algebra. Isolate cosine cleanly before inverse cosine; a small slip there throws the angle off badly. Self-check: in school math the two main jobs are a missing side from SAS and a missing angle from SSS. A right triangle is usually simpler with Pythagoras; a side-pair with a known angle may suit the law of sines.
FAQ
Run the steps on , , to find , then change to and compare. Watching the opposite side grow with the angle is one of the fastest ways to make the formula intuitive. For step-by-step feedback on your own numbers, explore a similar triangle in GPAI Solver.
Frequently Asked Questions
- What is the law of cosines in simple terms?
- The law of cosines relates the three sides of any triangle to one of its angles. It is especially useful when the triangle is not a right triangle.
- When should you use the law of cosines?
- Use it when you know two sides and the included angle, or when you know all three sides and want to find an angle.
Need help with a problem?
Upload your question and get a verified, step-by-step solution in seconds.
Open GPAI Solver →