Geometry and trigonometry

Use the law of cosines for any triangle

The law of cosines extends the Pythagorean theorem by adding an angle-dependent correction, allowing side calculations in nonright triangles.

Author
VibeMath Editorial TeamOriginal AI-assisted lesson content edited for clarity, accessibility, and product-truth accuracy.
Math reviewer
VibeMath Math ReviewIndependent equation, example, substitution, units, scope, and accessibility checks; not a claim of individual human credentials.
Last reviewed

What you will learn

  • Match the side being solved with its opposite angle in the law of cosines.
  • Apply the formula to side-angle-side data without mixing labels.
  • Check a computed side against triangle bounds and the right-angle special case.

Build the idea

In a right triangle, the squared opposite side equals the sum of the other squared sides. For a general included angle, the term negative two a b cosine C adjusts that sum.

The side c must sit opposite angle C, while a and b form the angle. Drawing and labeling this relationship before substitution prevents the most common mismatch.

An acute included angle has positive cosine and reduces c squared below a squared plus b squared; an obtuse angle has negative cosine and increases it.

A Pythagorean sum adjusted by angle

Hold two side lengths fixed like hinged arms. Closing the included angle shortens the opposite side, opening past ninety degrees lengthens it, and the cosine term measures that adjustment.

Visual description: Two fixed sides form a hinge whose included angle changes, causing the opposite side to shorten for acute angles and lengthen for obtuse angles.
Read as: c squared equals a squared plus b squared minus two a b cosine C.
Read as: When C is ninety degrees, c squared equals a squared plus b squared.

Worked example

Problem

Two sides of a triangle have lengths seven and ten, and their included angle is sixty degrees. Find the opposite side.

Strategy

Label the unknown side opposite the given angle, substitute the two adjacent side lengths, use cosine sixty, and take the positive square root.

  1. Step 1

    Set a equal seven, b equal ten, and C equal sixty degrees. The unknown opposite side is c.

    Read as: c squared equals seven squared plus ten squared minus two times seven times ten times cosine sixty degrees.
  2. Step 2

    Cosine sixty degrees is one half, so the correction term is seventy. The remaining squared length is seventy-nine.

    Read as: c squared equals forty-nine plus one hundred minus seventy, which is seventy-nine.
  3. Step 3

    A geometric length is positive, so take the positive square root. The exact length is square root seventy-nine.

    Read as: c equals the square root of seventy-nine, approximately eight point eight nine.

Answer and verification

The opposite side is square root seventy-nine, approximately eight point eighty-nine units.

The side lies between the positive difference three and sum seventeen required by the triangle inequality, and an included sixty-degree angle reasonably produces an intermediate length.

Common mistakes

  • Pairing angle C with a side that is adjacent rather than opposite.

    Mark the angle first, then label the side directly across from it with the matching lowercase letter.

  • Dropping the negative sign before the cosine correction.

    Keep the full formula intact; the cosine value itself handles acute versus obtuse behavior through its sign.

Try it yourself

Find the side opposite a one-hundred-twenty-degree angle between sides five and eight.

Show hint

Cosine one hundred twenty degrees is negative one half, so the correction increases the squared side length.

Show answer

The opposite side is square root one hundred twenty-nine, approximately eleven point thirty-six units.

Accessible lesson transcript

This reviewed reading order covers the lesson explanation, equations, example, and checks without claiming that a video exists.

  1. Part 1

    Lesson overview

    The law of cosines extends the Pythagorean theorem by adding an angle-dependent correction, allowing side calculations in nonright triangles. In a right triangle, the squared opposite side equals the sum of the other squared sides. For a general included angle, the term negative two a b cosine C adjusts that sum. Match the side being solved with its opposite angle in the law of cosines.

  2. Part 2

    Visual model and equations

    The side c must sit opposite angle C, while a and b form the angle. Drawing and labeling this relationship before substitution prevents the most common mismatch. Hold two side lengths fixed like hinged arms. Closing the included angle shortens the opposite side, opening past ninety degrees lengthens it, and the cosine term measures that adjustment. c squared equals a squared plus b squared minus two a b cosine C. When C is ninety degrees, c squared equals a squared plus b squared.

  3. Part 3

    Worked example

    Two sides of a triangle have lengths seven and ten, and their included angle is sixty degrees. Find the opposite side. Label the unknown side opposite the given angle, substitute the two adjacent side lengths, use cosine sixty, and take the positive square root. Set a equal seven, b equal ten, and C equal sixty degrees. The unknown opposite side is c. Cosine sixty degrees is one half, so the correction term is seventy. The remaining squared length is seventy-nine. A geometric length is positive, so take the positive square root. The exact length is square root seventy-nine. The opposite side is square root seventy-nine, approximately eight point eighty-nine units. The side lies between the positive difference three and sum seventeen required by the triangle inequality, and an included sixty-degree angle reasonably produces an intermediate length.

  4. Part 4

    Checks, practice, and scope

    An acute included angle has positive cosine and reduces c squared below a squared plus b squared; an obtuse angle has negative cosine and increases it. Pairing angle C with a side that is adjacent rather than opposite. Mark the angle first, then label the side directly across from it with the matching lowercase letter. Dropping the negative sign before the cosine correction. Keep the full formula intact; the cosine value itself handles acute versus obtuse behavior through its sign. Find the side opposite a one-hundred-twenty-degree angle between sides five and eight. Cosine one hundred twenty degrees is negative one half, so the correction increases the squared side length. The opposite side is square root one hundred twenty-nine, approximately eleven point thirty-six units. The unknown side and its opposite angle share the same letter. Cosine adjusts the Pythagorean sum for the included angle. Triangle inequality and angle type provide fast reasonableness checks. Ambiguous side-side-angle cases are not resolved by this direct side-angle-side setup and may require the law of sines. Rounded calculator values can shift the final side, so retain the squared exact expression until the last step.

Scope and limitations

  • Ambiguous side-side-angle cases are not resolved by this direct side-angle-side setup and may require the law of sines.
  • Rounded calculator values can shift the final side, so retain the squared exact expression until the last step.