Skip to content

Mathematics · Ch 3 — Trigonometry

Law of Cosines

3.7.2

Law of Cosines

When to use the Law of Cosines. The sine rule cannot solve a triangle from two sides and the included angle (SAS), or from all three sides (SSS) — those data sets need the Law of Cosines. It is also the tool used to derive the area formula (§3.7.4) whenever two sides and the included angle are given.

Theorem 3.3 (Law of Cosines). In △ABC\triangle ABC,

cos⁡A=b2+c2−a22bc,cos⁡B=c2+a2−b22ca,cos⁡C=a2+b2−c22ab.\cos A=\frac{b^2+c^2-a^2}{2bc},\qquad \cos B=\frac{c^2+a^2-b^2}{2ca},\qquad \cos C=\frac{a^2+b^2-c^2}{2ab}.

Proof. Drop the altitude from AA onto line BCBC, meeting it at DD, so AD⊥BCAD\perp BC. In right triangle ABDABD: AB2=AD2+BD2AB^2=AD^2+BD^2, i.e. c2=AD2+BD2c^2=AD^2+BD^2. Express ADAD and BDBD using the elements of the triangle: in right triangle ADCADC, ADAC=sin⁡C⇒AD=bsin⁡C\dfrac{AD}{AC}=\sin C\Rightarrow AD=b\sin C, and BD=BC−DC=a−bcos⁡CBD=BC-DC=a-b\cos C (since DC=ACcos⁡C=bcos⁡CDC=AC\cos C=b\cos C). Substituting,

c2=(bsin⁡C)2+(a−bcos⁡C)2=b2sin⁡2C+a2+b2cos⁡2C−2abcos⁡C=a2+b2−2abcos⁡C,c^2=(b\sin C)^2+(a-b\cos C)^2=b^2\sin^2C+a^2+b^2\cos^2C-2ab\cos C=a^2+b^2-2ab\cos C,

using sin⁡2C+cos⁡2C=1\sin^2C+\cos^2C=1. Hence c2=a2+b2−2abcos⁡Cc^2=a^2+b^2-2ab\cos C, i.e. cos⁡C=a2+b2−c22ab\cos C=\dfrac{a^2+b^2-c^2}{2ab}. Dropping the altitude from BB or from CC instead gives the other two formulas by exactly the same argument. ■\blacksquare

Remarks.

  1. a2=b2+c2−2bccos⁡Aa^2=b^2+c^2-2bc\cos A reads: the square of a side equals the sum of the squares of the other two, diminished by twice their product times the cosine of the included angle. Any one of the three formulas gives the other two just by cycling the letters a→b→c→aa\to b\to c\to a.
  2. When A=90∘A=90^\circ, cos⁡A=0\cos A=0 and the formula collapses to a2=b2+c2a^2=b^2+c^2 — so the Law of Cosines is a genuine generalisation of the Pythagorean theorem (and, conversely, Pythagoras' theorem is exactly its right-angled special case).
  3. Unlike the sine function, cosine distinguishes acute from obtuse angles: a positive cosine means the angle is acute, a negative cosine means it is obtuse. This makes the Law of Cosines the safer tool whenever an obtuse angle might be present in the triangle. …