The Law of Cosines
Simple Explanation
A generalization of the Pythagorean theorem to ANY triangle: c² = a² + b² − 2ab·cosC, where C is the angle between sides a and b, and c is the side opposite C.
Why Do We Need It?
This lets you find a missing side when you know two sides and the included angle (SAS), or find a missing angle when you know all three sides (SSS) — situations the Law of Sines alone can't handle.
See It
A scalene triangle with vertices A, B, C, sides a, b, c, and the angle at C marked between sides a and b
Formula
The Law of Cosines
c² = a² + b² − 2ab·cos C
A generalization of the Pythagorean theorem to any triangle — gives the length of a side from the other two sides and the angle between them, or an angle from all three sides.
- a, b, c
- — the side lengths of the triangle
- C
- — the angle opposite side c, included between sides a and b
When to use it: Whenever you know two sides and the included angle (SAS), or all three sides (SSS), of any triangle.
Worked Example
Find a side using the Law of Cosines
In triangle ABC, a = 7, b = 9, and angle C = 60°. Find side c.
Why Does This Work?
Dropping a perpendicular from one vertex splits the triangle into two right triangles; applying the Pythagorean theorem to each and using the definitions of sine and cosine for the split angle eventually combines into c²=a²+b²−2ab·cosC — and when C=90°, cosC=0 and this reduces to exactly the ordinary Pythagorean theorem, confirming it as the correct generalization.
Real-Life Example
Computing a mechanical linkage's reach
An engineer knows the lengths of two robotic arm segments and the angle between them, and needs the straight-line distance from the base to the gripper.
The Law of Cosines computes that distance directly from the two known arm lengths and the angle between them.
Practice
In triangle PQR, p = 8, q = 6, and angle R = 90°. Find side r.
HardCommon mistake
Forgetting the −2ab·cosC term entirely and just computing √(a²+b²) — that plain Pythagorean form only works when the included angle is exactly 90°; any other angle needs the full Law of Cosines.
Quick Review
- c² = a² + b² − 2ab·cosC, where C is the angle between sides a and b.
- Use for SAS (two sides + included angle) or SSS (all three sides known).
- Reduces to the ordinary Pythagorean theorem exactly when C=90° (since cos90°=0).