trigidentity.com

Triangle identities · trigonometric identity

a² = b² + c² − 2bc·cos A — Law of cosines

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

When to use it

Two sides and the angle between them are known and the third side is wanted, or all three sides are known and an angle is wanted. It also classifies the triangle: the sign of cos A tells you whether A is acute, right or obtuse.

Why it is true

Put A at the origin and B at (c, 0); then C sits at (b·cos A, b·sin A). The distance formula on B and C gives b²cos²A − 2bc·cos A + c² + b²sin²A, and cos² + sin² = 1 folds the first and last terms into b².

The full line-by-line version is on the proof page for law of cosines; the “how would I find this myself” version is in the derivation.

Where it comes from

solve the same equation for the angle instead of the side. The useful rearrangement is the one that answers 'what is this angle?' when all three sides are known — start from the proved form and isolate cos A.

  1. a² = b² + c² − 2bc·cos A
    The proved form. · Law of cosines
  2. 2bc·cos A = b² + c² − a²
    Move the cosine term to the left, a² to the right.
  3. cos A = (b² + c² − a²)/(2bc)
    Divide by 2bc — now the angle is the subject.

Worked examples

No worked example is written for this identity yet —the examples index lists what is covered, and the pattern below shows the identity working at real angles.

Checked on these triangles

Two sides of the identity evaluated with the same engine that runs the verifier. A single line disagreeing would break the build.

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
45°5.186715.18671yes
53°9.2831269.283126yes
60°15.73187515.731875yes
67.5°13.10618613.106186yes
75°13.12140313.121403yes
90°23.19812523.198125yes
120°30.66437530.664375yes
135°30.2182930.21829yes
150°36.13004936.130049yes

The letters are not free

a, b, c and A, B, C here are one triangle's sides and angles: A + B + C = 180° and the sides follow the sine rule. Feed the same six letters with random values and the equation fails — that is a property of the formula, not a bug in the tool.

The mistake students make

Writing +2bc·cos A, or using the formula with an angle that is not between the two known sides. The angle must sit between the sides being multiplied, and the lone side on the left must be the one opposite it.

Try it

Category hub: Triangle identities · all identities: /identities

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