Resources For Teachers For Tutors For Students & Parents Pricing
Pre-Calculus Triangle trigonometry

Law of Cosines

20 practice questions 0 video lessons Theory + worked examples

Law of Cosines

California Pre-Calculus • Standard G-SRT.10 • Triangle Trigonometry

Law of Cosines is a topic in Triangle Trigonometry in the California Common Core State Standards. It is aligned to Standard G-SRT.10, which requires students to prove the Law of Cosines and use it to solve problems.

The Law of Cosines \(c^2=a^2+b^2-2ab\cos C\) solves a triangle given two sides and the included angle (SAS) or all three sides (SSS).

California Pre-Calculus › Triangle Trigonometry › Law of Cosines  —  Standard G-SRT.10

Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

The Law of Cosines handles the triangle cases the Law of Sines cannot start:

\[c^2=a^2+b^2-2ab\cos C,\]

where \(C\) is the angle included between sides \(a\) and \(b\), opposite side \(c\). Use it for:

  • SAS — two sides and the included angle \(\Rightarrow\) find the third side.
  • SSS — all three sides \(\Rightarrow\) find any angle.
It generalizes the Pythagorean theorem. When \(C=90^\circ\), \(\cos C=0\) and the formula collapses to \(c^2=a^2+b^2\).
Law of Cosines triangle A triangle with the included angle C between sides a and b, opposite side c. a b c C
The included angle \(C\) sits between \(a\) and \(b\), opposite \(c\).
Law of Cosines generalizes the Pythagorean theorem When the included angle is 90 degrees, the cosine term vanishes and the Law of Cosines becomes the Pythagorean theorem. c² = a² + b² − 2ab·cos Cif C = 90°, cos C = 0c² = a² + b²
At \(C=90^\circ\) the cosine term vanishes — the Pythagorean theorem.

The three symmetric forms, and the angle version:

\[c^2=a^2+b^2-2ab\cos C,\qquad \cos C=\dfrac{a^2+b^2-c^2}{2ab}\]
c squared equals a squared plus b squared minus 2 a b cosine C; solve for cosine C to get an angle
A negative \(\cos C\) means an obtuse angle — the formula handles it automatically.

How to use the Law of Cosines

  1. SAS: put the known angle as \(C\), the two sides as \(a,b\), and solve for \(c\).
  2. SSS: use the rearranged form to find \(\cos C\), then \(\cos^{-1}\).
  3. Finish the triangle, if needed, with the Law of Sines.
  4. Tip: find the largest angle (opposite the longest side) first to avoid ambiguity.
Example 1 — SAS: find the third side
Sides \(a=7\) and \(b=10\) meet at \(C=60^\circ\). Find side \(c\).
Solution

Apply the Law of Cosines with the included angle \(C\).

\(c^2\)\(=\)\(a^2+b^2-2ab\cos C\)
\(=\)\(49+100-2(7)(10)\cos 60^\circ\)
\(=\)\(149-140\cdot\dfrac12=79\)
\(c\)\(=\)\(\sqrt{79}\approx 8.9\)
side c is about 8.9
Example 2 — SSS: find an angle
A triangle has sides \(a=5\), \(b=6\), \(c=7\). Find angle \(C\).
Solution

Rearrange the Law of Cosines to solve for \(\cos C\).

\(\cos C\)\(=\)\(\dfrac{a^2+b^2-c^2}{2ab}=\dfrac{25+36-49}{60}\)
\(=\)\(\dfrac{12}{60}=0.2\)
\(C\)\(=\)\(\cos^{-1}(0.2)\approx 78.5^\circ\)
angle C is about 78.5 degrees
Example 3 — When to use it
Two roads leave a town at a \(70^\circ\) angle. A car drives 12 mi on one and 9 mi on the other. How far apart are they?
Solution

SAS with the \(70^\circ\) angle between the two distances.

\(d^2\)\(=\)\(12^2+9^2-2(12)(9)\cos 70^\circ\)
\(=\)\(225-216\cos 70^\circ\approx 151.1\)
\(d\)\(\approx\)\(12.3\ \text{mi}\)
the cars are about 12.3 miles apart
Example 4 — Largest angle
For sides \(4,5,8\), which angle is largest, and find it.
Solution

The largest angle is opposite the longest side \(8\); call it \(C\).

\(\cos C\)\(=\)\(\dfrac{4^2+5^2-8^2}{2(4)(5)}=\dfrac{-23}{40}\)
\(C\)\(=\)\(\cos^{-1}(-0.575)\approx 125.1^\circ\)

A negative cosine correctly signals an obtuse angle.

largest angle is about 125.1 degrees, obtuse

Common pitfalls

The included angle must match. \(\cos C\) pairs with the side \(c\) opposite it.
Order of operations. Compute \(2ab\cos C\) as a single term before subtracting.
Don't reach for the Law of Sines first in SAS/SSS. It needs an angle-opposite-side pair you don't yet have.

Frequently asked questions

What is the Law of Cosines?

\(c^2=a^2+b^2-2ab\cos C\), relating all three sides of a triangle to one angle. It works in any triangle.

When do you use the Law of Cosines instead of the Law of Sines?

For SAS (two sides and the included angle) or SSS (all three sides), where the Law of Sines has no angle-opposite-side pair to start from.

How is it related to the Pythagorean theorem?

It is the general version. When the included angle is \(90^\circ\), \(\cos 90^\circ=0\) and it becomes \(c^2=a^2+b^2\).

How do you find an angle with the Law of Cosines?

Rearrange to \(\cos C=\dfrac{a^2+b^2-c^2}{2ab}\), then take the inverse cosine.