MathPath
Grades 1–13 Math Hub
Grades 10–11 · Trigonometry & Precalculus · Formula Deep Dive

Law of Cosines: Proof, SAS/SSS & Examples

The Law of Cosines generalizes the Pythagorean Theorem to ANY triangle—acute, right, or obtuse—letting you solve triangles when you know two sides and the included angle (SAS) or all three sides (SSS).

$$c^2 = a^2 + b^2 - 2ab\cos C$$

Variables: $C$ is the included angle between sides $a$ and $b$.

When to use: Solving non-right triangles when given SAS or SSS.

Oblique Triangle Labeling ($a, b, c$ Opposite $A, B, C$)

A (50°)B (70°)C (60°)

Side $c$ is always opposite angle $C$ (the included angle between sides $a$ and $b$). Notice when $C = 90^\circ$, $\cos 90^\circ = 0$ and the formula reduces to $c^2 = a^2 + b^2$.

Derivation Using the Pythagorean Theorem

Drop a perpendicular altitude $h$ from vertex $B$ to side $b$, splitting the triangle into two right triangles.

  1. In the right triangle containing angle $C$ and hypotenuse $a$: $h = a\sin C$ and the base segment next to $C$ is $a\cos C$.
  2. The remaining base segment next to vertex $A$ has length $b - a\cos C$.
  3. Apply the Pythagorean Theorem to the second right triangle (legs $h$ and $b - a\cos C$, hypotenuse $c$): $c^2 = (a\sin C)^2 + (b - a\cos C)^2$.
  4. Expand: $c^2 = a^2\sin^2 C + b^2 - 2ab\cos C + a^2\cos^2 C = a^2(\sin^2 C + \cos^2 C) + b^2 - 2ab\cos C$.
  5. Since $\sin^2 C + \cos^2 C = 1$, we get $c^2 = a^2 + b^2 - 2ab\cos C$.

Solving SAS vs. SSS Triangles

SAS (Find Opposite Side $c$)

$c = \sqrt{a^2 + b^2 - 2ab\cos C}$.

SSS (Find Angle $C$)

$\cos C = \frac{a^2 + b^2 - c^2}{2ab}$, then $C = \cos^{-1}(\dots)$.

Obtuse Angle ($C > 90^\circ$)

$\cos C$ is negative, so $-2ab\cos C$ becomes POSITIVE—making $c^2 > a^2 + b^2$.

Right Angle ($C = 90^\circ$)

$\cos 90^\circ = 0$, recovering the Pythagorean Theorem $c^2 = a^2 + b^2$.

Step-by-Step Worked Examples

Example 1: SAS: Finding a Missing Side

Problem: In $\triangle ABC$, $a = 5$, $b = 7$, and included angle $C = 60^\circ$. Find side $c$.
  1. Plug into $c^2 = a^2 + b^2 - 2ab\cos C$: $c^2 = 5^2 + 7^2 - 2(5)(7)\cos 60^\circ$.
  2. Since $\cos 60^\circ = 0.5$: $c^2 = 25 + 49 - 70(0.5) = 74 - 35 = 39$.
  3. Take the square root: $c = \sqrt{39} \approx 6.24$.

Example 2: SSS: Finding the Largest Angle

Problem: A triangle has sides $a = 6$, $b = 8$, and $c = 12$. Find angle $C$.
  1. Use $\cos C = \frac{a^2 + b^2 - c^2}{2ab} = \frac{36 + 64 - 144}{2(6)(8)} = \frac{-44}{96} = -\frac{11}{24}$.
  2. Take inverse cosine: $C = \cos^{-1}\!\left(-\frac{11}{24}\right) \approx 117.3^\circ$ (obtuse).

Common Mistakes to Avoid

Mistake 1: Breaking Order of Operations Before Multiplying by $\cos C$

✗ Wrong: Computing $(25 + 49 - 70) \times \cos 60^\circ = 4 \times 0.5 = 2$.
✓ Correct: Multiply $2ab \cdot \cos C$ FIRST, then subtract from $a^2 + b^2$: $74 - (70 \times 0.5) = 39$.

Why: Multiplication always comes before subtraction in PEMDAS.

Mistake 2: Forgetting the Square Root at the End

✗ Wrong: Reporting $c = 39$ instead of $\sqrt{39}$.
✓ Correct: Remember the left side is $c^2$, so take $\sqrt{39} \approx 6.24$.

Why: A side of length $39$ cannot even form a triangle with sides $5$ and $7$ ($5 + 7 < 39$!).

Frequently Asked Questions

When should I use the Law of Cosines instead of the Law of Sines?

Use Law of Cosines for SAS (two sides and the angle between them) or SSS (all three sides). Use Law of Sines for AAS, ASA, or SSA when you have a known angle-side opposite pair.

Why is it smart to find the largest angle first in an SSS problem?

Because $\cos^{-1}$ cleanly distinguishes acute ($<90^\circ$) from obtuse ($>90^\circ$) angles, eliminating the ambiguous case if you switch to Law of Sines afterward.

What if $\cos C$ comes out negative?

That is completely valid—it simply means angle $C$ is obtuse (between $90^\circ$ and $180^\circ$).

Practice & Related Resources

Apply Law of Cosines on interactive problems, printable PDF worksheets, and calculators.

SOH-CAH-TOA (Right Triangles) →Pythagorean Theorem →Grade 10 Trigonometry Quiz →All Trigonometry Formulas → ← Back to Trigonometry Formulas Cheat Sheet