Mathwords logoMathwords

law of cosines proof — Definition, Formula & Examples

The law of cosines proof shows why c2=a2+b22abcosCc^2 = a^2 + b^2 - 2ab\cos C is true for any triangle, not just right triangles. The most common approach places one vertex at the origin and uses the distance formula to derive the result.

Given triangle ABCABC with sides aa, bb, cc opposite their respective vertices, the law of cosines c2=a2+b22abcosCc^2 = a^2 + b^2 - 2ab\cos C is proven by embedding the triangle in a coordinate system with CC at the origin, expressing vertices AA and BB in Cartesian coordinates, and applying the Euclidean distance formula to side cc.

Key Formula

c2=a2+b22abcosCc^2 = a^2 + b^2 - 2ab\cos C
Where:
  • aa = Length of the side opposite vertex A (the side from B to C)
  • bb = Length of the side opposite vertex B (the side from A to C)
  • cc = Length of the side opposite vertex C (the side from A to B)
  • CC = The angle at vertex C, between sides a and b

How It Works

Place vertex CC at the origin with side aa along the positive xx-axis. Then B=(a,0)B = (a, 0) and A=(bcosC,bsinC)A = (b\cos C,\, b\sin C). Side cc is the distance from AA to BB. Squaring that distance and expanding gives you the law of cosines directly. The key algebraic step is recognizing that cos2C+sin2C=1\cos^2 C + \sin^2 C = 1, which collapses the expression into the final formula.

Example

Problem: Prove the law of cosines using coordinate geometry.
Set up coordinates: Place C at the origin and side a along the x-axis. This gives B = (a, 0) and A = (b cos C, b sin C).
B=(a,0),A=(bcosC,bsinC)B = (a,\, 0), \quad A = (b\cos C,\, b\sin C)
Apply the distance formula: Side c is the distance from A to B. Square both sides of the distance formula.
c2=(bcosCa)2+(bsinC0)2c^2 = (b\cos C - a)^2 + (b\sin C - 0)^2
Expand the squares: Distribute each squared binomial.
c2=b2cos2C2abcosC+a2+b2sin2Cc^2 = b^2\cos^2 C - 2ab\cos C + a^2 + b^2\sin^2 C
Use the Pythagorean identity: Combine the b² terms using cos²C + sin²C = 1.
c2=a2+b2(cos2C+sin2C)2abcosC=a2+b22abcosCc^2 = a^2 + b^2(\cos^2 C + \sin^2 C) - 2ab\cos C = a^2 + b^2 - 2ab\cos C
Answer: This completes the proof: c2=a2+b22abcosCc^2 = a^2 + b^2 - 2ab\cos C for any triangle.

Why It Matters

Understanding this proof reveals that the law of cosines is a direct generalization of the Pythagorean theorem — when C=90°C = 90°, the 2abcosC-2ab\cos C term vanishes. Proof-based questions appear frequently in precalculus and trigonometry exams, and the coordinate-geometry technique used here transfers to many other derivations.

Common Mistakes

Mistake: Forgetting to apply the Pythagorean identity cos²C + sin²C = 1 during the expansion.
Correction: After expanding the squared terms, look for b²cos²C + b²sin²C and factor out b². The identity simplifies this to b², which is essential to reaching the final formula.

Related Terms