Geometry · Grades 10, 11

The Law of Cosines

Quick answer

When two sides and the angle between them are known, or all three sides, the Law of Sines cannot start, because no side comes with its opposite angle. The Law of Cosines handles both: c² = a² + b² − 2ab cos C. It is the Pythagorean theorem plus a correction that vanishes at a right angle, shrinks the third side for an acute angle and stretches it for an obtuse one.

What you'll learn

  • Prove the Law of Cosines using coordinates
  • Find the third side from two sides and the included angle
  • Find an angle from three sides, and choose between the two laws

When the Law of Sines cannot start

The Law of Sines needs a side together with the angle across from it. Two common situations never supply that pair:

  • SAS — two sides and the angle between them
  • SSS — all three sides

For both, there is a second law:

c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C

Here CC is the angle between sides aa and bb, and cc is the side across from it. The same pattern holds for any angle: a2=b2+c2−2bccos⁡Aa^2 = b^2 + c^2 - 2bc\cos A, and so on.

The Pythagorean theorem, corrected

Look at the formula next to c2=a2+b2c^2 = a^2 + b^2. It is the Pythagorean theorem with one extra term, −2abcos⁡C-2ab\cos C, and that term depends only on the angle.

Angle CCcos⁡C\cos CEffect on cc
90°90°00no correction: c2=a2+b2c^2 = a^2 + b^2
acutepositivesubtracts, so cc is shorter
obtusenegativeadds, so cc is longer

That matches what a hinge does. Close the angle between two fixed sides and the far ends move together. Open it and they spread apart.

Why the correction is 2ab cos C

Put the triangle on coordinates. Place CC at the origin and BB on the positive xx-axis, so B=(a,0)B = (a, 0). Point AA is bb units from the origin at angle CC, so by the unit circle definition it sits at

A=(bcos⁡C,  bsin⁡C)A = (b\cos C,\; b\sin C)
The Law of Cosines on coordinates A triangle with C at the origin, B at (10, 0) and A at about (4.50, 5.36). A dashed vertical segment drops from A to the x-axis, showing A's first coordinate, b cos C, and its height, b sin C. 24681012-2246810xy C B A
The Law of Cosines on coordinates

Now cc is the distance from AA to BB. By the distance formula:

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

Group the two terms containing b2b^2:

c2=a2+b2(cos⁡2C+sin⁡2C)−2abcos⁡Cc^2 = a^2 + b^2\left(\cos^2 C + \sin^2 C\right) - 2ab\cos C

The Pythagorean identity says the bracket is exactly 11:

c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C

Nothing in the argument needed CC to be acute. For an obtuse angle, AA lands to the left of the yy-axis, cos⁡C\cos C is negative, and every step goes through the same.

SAS: finding the third side

Two sides a=7a = 7 and b=10b = 10 meet at C=50°C = 50°. Find cc.

c2=72+102−2(7)(10)cos⁡50°=149−140cos⁡50°c^2 = 7^2 + 10^2 - 2(7)(10)\cos 50° = 149 - 140\cos 50° c2≈149−89.99=59.01c≈7.68c^2 \approx 149 - 89.99 = 59.01 \qquad c \approx 7.68

Multiply 140cos⁡50°140\cos 50° before subtracting. That product is one term.

SSS: finding an angle

Rearrange the law to isolate the cosine:

cos⁡C=a2+b2−c22ab\cos C = \frac{a^2 + b^2 - c^2}{2ab}

A triangle has sides 55, 88 and 77. Find the angle opposite the side of length 77.

cos⁡C=25+64−492(5)(8)=4080=12C=60°\cos C = \frac{25 + 64 - 49}{2(5)(8)} = \frac{40}{80} = \frac{1}{2} \qquad C = 60°

Unlike sine, cosine never leaves two choices. It is positive for acute angles and negative for obtuse ones, so each value belongs to exactly one angle between 0°0° and 180°180°.

Which law to use

KnownStart with
two angles and a side (AAS, ASA)Law of Sines
two sides and a non-included angle (SSA)Law of Sines, checking for two triangles
two sides and the included angle (SAS)Law of Cosines
three sides (SSS)Law of Cosines

After the Law of Cosines supplies one missing piece, either law can finish the triangle.

Worked examples

Common mistakes

Practice problems

  1. Find cc when a=5a = 5, b=8b = 8 and C=60°C = 60°.

    Answer

    77

    Full solution

    c2=25+64−80cos⁡60°=89−40=49c^2 = 25 + 64 - 80\cos 60° = 89 - 40 = 49, so c=7c = 7.

  2. A triangle has sides 33, 55 and 77. Find the angle opposite the side of length 55.

    Answer

    About 38.21°38.21°

    Full solution

    cos⁡B=9+49−252(3)(7)=3342≈0.7857\cos B = \tfrac{9 + 49 - 25}{2(3)(7)} = \tfrac{33}{42} \approx 0.7857, so B≈38.21°B \approx 38.21°.

  3. Find cc when a=12a = 12, b=15b = 15 and C=110°C = 110°.

    Answer

    About 22.1822.18

    Full solution

    c2=144+225−360cos⁡110°≈369+123.13=492.13c^2 = 144 + 225 - 360\cos 110° \approx 369 + 123.13 = 492.13, so c≈22.18c \approx 22.18.

  4. A triangle has sides 77, 88 and 99. Find its largest angle.

    Answer

    About 73.40°73.40°

    Full solution

    The largest angle is across from 99: cos⁡C=49+64−812(7)(8)=32112≈0.2857\cos C = \tfrac{49 + 64 - 81}{2(7)(8)} = \tfrac{32}{112} \approx 0.2857, so C≈73.40°C \approx 73.40°.

  5. Two hikers leave a trailhead on paths 40°40° apart. One walks 33 miles and the other 55 miles. How far apart are they?

    Answer

    About 3.323.32 miles

    Full solution

    d2=9+25−30cos⁡40°≈34−22.98=11.02d^2 = 9 + 25 - 30\cos 40° \approx 34 - 22.98 = 11.02, so d≈3.32d \approx 3.32 miles.

  6. For each set of given parts, name the law to start with: (a) AA, BB, cc; (b) aa, bb, CC; (c) aa, bb, cc; (d) aa, bb, AA.

    Answer

    (a) Sines. (b) Cosines. (c) Cosines. (d) Sines, checking for two triangles.

    Full solution

    (a) Two angles give the third, and then every side has its opposite angle.

    (b) Two sides and the included angle: SAS.

    (c) Three sides: SSS.

    (d) Side aa comes with its opposite angle AA, but this is SSA, which can give two triangles.

  7. Explain why an obtuse angle CC makes c2c^2 larger than a2+b2a^2 + b^2.

    Answer

    For an obtuse angle cos⁡C<0\cos C < 0, so −2abcos⁡C-2ab\cos C is positive and adds to a2+b2a^2 + b^2.

    Full solution

    aa and bb are positive lengths, so the sign of −2abcos⁡C-2ab\cos C is the opposite of the sign of cos⁡C\cos C.

    An obtuse angle has a negative cosine, which makes the correction positive. The side across from an obtuse angle is longer than the hypotenuse of a right triangle with the same two legs.

  8. Can a triangle have sides 44, 55 and 1010? Use the Law of Cosines to decide.

    Answer

    No.

    Full solution

    The angle across from 1010 would need cos⁡C=16+25−10040=−1.475\cos C = \tfrac{16 + 25 - 100}{40} = -1.475.

    No angle has a cosine below −1-1, so no such triangle exists. This is the triangle inequality in another form: 4+54 + 5 is less than 1010.

  9. Use the coordinate proof to explain where the term b2b^2 in a2+b2a^2 + b^2 comes from.

    Answer

    From b2cos⁡2C+b2sin⁡2Cb^2\cos^2 C + b^2\sin^2 C, which the Pythagorean identity collapses to b2b^2.

    Full solution

    Expanding the distance from A(bcos⁡C,bsin⁡C)A(b\cos C, b\sin C) to B(a,0)B(a, 0) produces b2cos⁡2Cb^2\cos^2 C from the horizontal part and b2sin⁡2Cb^2\sin^2 C from the vertical part.

    Together they are b2(cos⁡2C+sin⁡2C)=b2b^2(\cos^2 C + \sin^2 C) = b^2.

  10. With a=7a = 7, b=10b = 10 and C=50°C = 50°, Theo computes c2=(49+100−140)cos⁡50°c^2 = (49 + 100 - 140)\cos 50° and gets c≈2.41c \approx 2.41. Find his error.

    Hint

    Which operation comes first in 149−140cos⁡50°149 - 140\cos 50°?

    Answer

    He subtracted before multiplying. The correct value is c≈7.68c \approx 7.68.

    Full solution

    In a2+b2−2abcos⁡Ca^2 + b^2 - 2ab\cos C, the cosine multiplies only 2ab2ab. So 140cos⁡50°≈89.99140\cos 50° \approx 89.99 is computed first, then subtracted from 149149.

    c2≈149−89.99=59.01c^2 \approx 149 - 89.99 = 59.01, so c≈7.68c \approx 7.68.

    A sanity check catches Theo’s answer. With a 50°50° angle between sides of 77 and 1010, the third side cannot be as short as 2.412.41 — the ends of the two sides are much farther apart than that.

Frequently asked questions

What is the Law of Cosines?

c² = a² + b² − 2ab cos C, where C is the angle between sides a and b and c is the side opposite it.

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

When you know two sides and the angle between them (SAS), or all three sides (SSS). In both cases no side is paired with its opposite angle.

How is it related to the Pythagorean theorem?

When C is 90°, cos C = 0 and the correction term disappears, leaving c² = a² + b².

How do I find an angle from three sides?

Rearrange to cos C = (a² + b² − c²)/(2ab), then take the inverse cosine. The answer is unambiguous, because cosine separates acute from obtuse angles.

Why is there no ambiguous case with cosine?

Cosine is positive for acute angles and negative for obtuse ones, so each value between −1 and 1 belongs to exactly one angle between 0° and 180°.

What to learn next

Standards alignment

This lesson covers the following Common Core State Standards for Mathematics.

  • CCSS.MATH.CONTENT.HSG.SRT.D.10Similarity, Right Triangles, and Trigonometry(+) Prove the Laws of Sines and Cosines and use them to solve problems.
  • CCSS.MATH.CONTENT.HSG.SRT.D.11Similarity, Right Triangles, and Trigonometry(+) Understand and apply the Law of Sines and the Law of Cosines to find unknown measurements in right and non-right triangles (e.g., surveying problems, resultant forces).