Canadian flagMath101 · Independent Ontario learning libraryCreated and edited by Kamran
TrigonometryGrades 9–123 min read

Law of Cosines

The law of cosines generalizes the Pythagorean theorem to any triangle and solves SAS or SSS information.

Cheat sheet
The side isolated on the left must be opposite the angle used in the cosine term.

The law

For sides $a,b,c$ opposite angles $A,B,C$,

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

Equivalent forms isolate $a^2$ with angle $A$ or $b^2$ with angle $B$. Relabel rather than forcing every question into one memorized letter arrangement.

When to use it

Use cosine law for:

  • SAS: two sides and their included angle, to find the opposite side;
  • SSS: three sides, to find an angle.

After obtaining an opposite pair, sine law may finish the remaining values.

Worked example: SAS

The result lies between the difference $3$ and sum $17$ of the other sides, satisfying the triangle inequality.

Finding an angle from SSS

Rearrange:

$$ \cos C=\frac{a^2+b^2-c^2}{2ab}, $$

then

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

Use the side opposite the desired angle as $c$. The largest angle should lie opposite the largest side.

Connection to Pythagorean theorem

If $C=90^\circ$, then $\cos90^\circ=0$, and cosine law becomes

$$ c^2=a^2+b^2. $$

Thus the Pythagorean theorem is the right-angle special case.

Acute and obtuse triangles

For the largest side $c$:

  • if $c^2<a^2+b^2$, angle $C$ is acute;
  • if $c^2=a^2+b^2$, it is right;
  • if $c^2>a^2+b^2$, it is obtuse.

This follows from the sign of $\cos C$.

Choosing the correct included angle

In SAS data, the known angle must lie between the two known sides in the product $2ab\cos C$. If the angle is not included, the information is SSA and sine law/ambiguity reasoning may apply.

Draw the triangle and label opposite pairs before substituting.

Solving a full triangle

After cosine law gives one side or angle, use angle sum, another cosine-law equation, or sine law. If using sine law to find an angle, consider whether ambiguity applies; knowing the largest angle from SSS can simplify this.

Keep unrounded values until the final reporting step.

Applications

Cosine law models navigation paths, structural triangles, forces, survey distances, and any triangle not necessarily right-angled. Bearings may require converting direction descriptions into the included interior angle.

Check units and draw a labelled diagram.

Common mistakes

Using an angle not opposite the isolated side. Match the pair.

Using a non-included angle with two known sides as SAS. Identify the information type.

Forgetting the square root when finding a side. The formula gives $c^2$.

Entering $-2ab\cos C$ with missing parentheses. Preserve operation order.

Accepting a side that violates triangle inequality. Use geometry to check.

Quick self-check

  • Is the information SAS or SSS?
  • Which side lies opposite the chosen angle?
  • Does the formula match those labels?
  • Is calculator mode in degrees or radians as required?
  • Does the result respect largest side/angle and triangle inequality?
  • Were exact values and precision preserved until the end?
Check your understanding

Try it yourself

Hints are part of learning. Open one whenever it makes the next step feel possible.

1 practice question
Question 1Solve an SAS triangle · Gentle

Two sides are 7 cm and 10 cm with included angle 60°. What is the opposite side?

End of lesson

Nice work making it this far.

Understanding grows through return visits. Save this lesson, try the practice, or continue when you are ready.

Lesson complete

That one is yours now.

Law of Cosines is saved to My Learning. Take the win—you earned it.

1Your Math101 collectionlesson completed
Search 464 published lessons, 123 answer guides, courses, and learning tools.
Your experience

Settings

Ontario math tutoringWork with KamranBook ↗