trigidentity.com

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.

a² = b² + c² − 2bc·cos A

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.

  1. 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.
  2. a² = (b·cos A − c)² + (b·sin A)²
    Squared distance from B to C, which is side a.
  3. a² = b²cos²A − 2bc·cos A + c² + b²sin²A
    Expand the square.
  4. a² = b² + c² − 2bc·cos A
    b²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).

Both sides evaluated at the same triangles — left side a^2, right side b^2 + c^2 - 2bc·cos(A).
Triangle (A)Left sideRight sideAgree
7.5°2.627882.62788yes
15°0.6056130.605613yes
18°1.329871.32987yes
22.5°3.990253.99025yes
30°10.26620110.266201yes
37°6.2742596.274259yes

Related

sampled at 800 real trianglestriangles only: A + B + C = 180°Source: OpenStax Precalculus, Ch. 7.4 (Law of Sines / Law of Cosines) · Paul's Online Math Notes — trig cheat sheet · revised 2026-09-28 ·how we check ·accuracy policy ·report an error