How to Find the Third Side From Two Sides and the Angle Between Them
The short answer
Square the two known sides, add them, then subtract twice their product times the cosine of the angle between them, and square root the result. Sides of 8 and 5 around a 60° angle give c² = 64 + 25 − 80 × 0.5 = 49, so c = 7 exactly. The angle must be the included one, between the two known sides, or the formula does not apply.
Two survey legs run from the same station, 8 units and 5 units long, with 60° turned between them. How far apart are their far ends? That is the SAS problem, and it appears everywhere distances are built from a common point: total station work, navigation legs, force resultants, linkage geometry. Pythagoras cannot answer it, because Pythagoras is welded to 90°. The law of cosines is Pythagoras with the weld ground off.
Pythagoras with a correction term
Write the law of cosines next to Pythagoras and the family resemblance is exact: c² = a² + b² − 2ab cos C versus c² = a² + b². The whole difference is the correction term, and its behavior is worth knowing cold. At C = 90°, cos C = 0 and the term vanishes, collapsing back to Pythagoras. For acute angles the cosine is positive, so the term subtracts: the sides lean toward each other and the closing side shortens. For obtuse angles the cosine goes negative, the subtraction becomes an addition, and the closing side stretches past the Pythagoras value.
So the formula is not a new fact to memorize beside Pythagoras. It is the general fact, with Pythagoras as the one angle where the correction happens to be zero.
Square and add
8² + 5² = 64 + 25 = 89.
Correct
Subtract 2 × 8 × 5 × cos 60° = 80 × 0.5 = 40, leaving 49.
Root
c = √49 = 7. Exactly seven, no rounding, a rare clean SAS case.
Why Pythagoras alone overshoots
The diagram sets up the 8 and 5 sides around their 60° angle and compares the two answers. Pythagoras reports 9.43 as if the angle were square. The cosine correction removes the double counting and lands on 7. The gap between the two answers is entirely the work of the angle.

Included means included
The angle in the formula sits between the two known sides. Feeding in an angle at one of the far corners, however precisely measured, computes a different triangle.
An angle not between a and b does not govern how they spread apart.
Only the angle at the shared vertex controls the closing distance.
A worked check you can repeat on paper
Run the headline case once more with everything visible. c² = 8² + 5² − 2(8)(5)cos 60° = 64 + 25 − 80(0.5) = 89 − 40 = 49, so c = 7.
Independent check by coordinates, no trigonometry tables involved. Put the vertex at the origin with the 8 side along the x axis, ending at (8, 0). The 5 side leaves at 60°, ending at (5 cos 60°, 5 sin 60°) = (2.5, 4.330). The distance between the far ends is √((8 − 2.5)² + 4.330²) = √(30.25 + 18.75) = √49 = 7. Two entirely different routes, one answer.
One more with an obtuse angle to see the sign flip. Sides 8 and 5 around 120°: c² = 89 − 80(−0.5) = 89 + 40 = 129, c = 11.36. The correction term added length, exactly as the geometry says it should when the sides splay apart.
Reading the answer for errors
The result carries built in bounds that cost nothing to check. The third side must be shorter than the sum of the other two and longer than their difference: between 3 and 13 for sides of 8 and 5. It must also land on the correct side of the Pythagoras value, below 9.43 for an acute included angle, above it for obtuse. An answer of 7 passes both gates; an answer of 11.36 for 60° would fail the second one instantly.
These bounds catch the two commonest failures, a degree and radian mix up and a sign slip on the cosine, before the number goes anywhere it can do damage.
Mistakes that catch people out
- Using a non included angle. The formula demands the angle between the two known sides. With a far angle instead, the tool for the job is the law of sines, not cosines.
- Radians in a degree calculation. cos 60 in radian mode is −0.952, not 0.5, and the answer comes out absurd. The triangle inequality bounds catch it if you look.
- Dropping the sign for obtuse angles. Past 90° the cosine is negative and the correction term adds. Forcing a subtraction shortens a side that should have stretched.
- Rooting too early. Everything on the right side must be assembled before the square root. Rooting the 89 and then adjusting cannot be repaired afterward.
- Treating 2ab as 2a times 2b. The factor of two applies once to the whole product. Doubling both sides quietly quadruples the correction.
Try these
- Sides 8 and 5, included angle 90°. Find c and name the shortcut.
- Sides 8 and 5, included angle 120°. Find c.
- Sides 6 and 6, included angle 60°. Find c.
- Sides 10 and 7, included angle 60°. Find c.
- Sides 8 and 5, included angle 0°. What does the formula give, and what does it mean?
Show the answers
- √89 = 9.434, plain Pythagoras
- √129 = 11.358
- √36 = 6, the triangle is equilateral
- √(149 − 70) = 8.888
- √9 = 3, the sides overlap and the gap is their difference
Common questions
What is the law of cosines?
For a triangle with sides a and b around an included angle C, the third side satisfies c squared equals a squared plus b squared minus two a b cosine C. It generalizes Pythagoras to every angle.
When do I use it instead of Pythagoras?
Whenever the angle between the two known sides is anything other than 90 degrees. At exactly 90 the cosine term vanishes and the two formulas agree.
What does the included angle mean?
The angle at the vertex where the two known sides meet. An angle measured at either far corner belongs to a law of sines problem instead.
Why does the answer get bigger for obtuse angles?
The cosine of an obtuse angle is negative, so the correction term switches from subtracting to adding. Sides that splay wider apart leave a longer gap to close.
How can I check the result without redoing the same arithmetic?
Place the triangle on coordinates, one side along an axis, and compute the distance between the two far endpoints directly. It must match, and it uses none of the same steps.
Can the law of cosines find an angle instead of a side?
Yes. Solved for the cosine, it reads all three angles out of the three sides, which is the standard route when no angle is known at all.
Related lessons and calculators
- How to find all three angles from three sides, the same law solved the other way around.
- How to find the missing side of a right triangle, the 90 degree case where the correction term disappears.
- How to find the area from two sides and the included angle, the same SAS data fed into the area formula instead.
- Triangle solver, to enter the SAS case and read the full solved triangle.
- NCTM, the National Council of Teachers of Mathematics, for law of cosines derivations.
- Area formulas for every common shape, a calculator covering fifteen shapes and an index of every geometry lesson here.
