Triangle identities · proof ·what it is and when to use it
Proof: a² = b² + c² − 2bc·cos A
Law of cosines — proved by place the vertices on coordinates and measure. Every line below says which rule it uses, so nothing has to be taken on faith.
The proof
This proof uses nothing but the distance formula and the definition of sine and cosine on a placed triangle — which is exactly how the site's own sampler builds its test triangles.
- A = (0, 0), B = (c, 0), C = (b·cos A, b·sin A)Place side AB on the x-axis; C is at distance b making angle A with it.
- a² = (b·cos A − c)² + (b·sin A)²Squared distance from B to C, which is side a.
- a² = b²cos²A − 2bc·cos A + c² + b²sin²AExpand the square.
- a² = b² + c² − 2bc·cos Ab²cos²A + b²sin²A = b² by the Pythagorean identity. · Pythagorean identity
Set A = 90° and the middle term disappears: this is Pythagoras with the correction term for a non-right angle.
Where the proof stops applying
The variables are one triangle's angles and sides, so they obey A + B + C = 180° and the sine rule. Drop that constraint and the equation is simply not true — which is why the sampler here generates triangles rather than random numbers.
The same claim, checked numerically
A proof is not the same thing as a check, and this page shows both: the reasoning above, and the first few triangles fed to the same engine behind the verifier. If they ever disagreed, the data would be broken — the build would fail before publishing (accuracy policy).
| Triangle (A) | Left side | Right side | Agree |
|---|---|---|---|
| 7.5° | 2.62788 | 2.62788 | yes |
| 15° | 0.605613 | 0.605613 | yes |
| 18° | 1.32987 | 1.32987 | yes |
| 22.5° | 3.99025 | 3.99025 | yes |
| 30° | 10.266201 | 10.266201 | yes |
| 37° | 6.274259 | 6.274259 | yes |
Related
- How would I find a² = b² + c² − 2bc·cos A myself? — the derivation, which is a different question from the proof.
- Law of cosines: when to use it — the practical side.
- All triangle identities · proof index