Practice / Trigonometry

Law of sines and law of cosines

Ten triangles solved with the law of sines and the law of cosines: AAS, SAS and SSS, an obtuse angle found exactly, the ambiguous SSA case with two, one and no triangles, the area formula, a distance across a lake, and the angle between two vectors from their lengths, with worked solutions and the mistakes that lose the obtuse angle or the second triangle.

Before you start

Two formulas solve every triangle that is not right-angled, and the law of cosines is the same identity as ∥u−v∥2=∥u∥2+∥v∥2−2 u⋅v\|u - v\|^2 = \|u\|^2 + \|v\|^2 - 2\,u\cdot v, the one behind cosine similarity. The work goes wrong in a few places: an arcsine that returns the acute angle when the triangle has an obtuse one, a second triangle missed when two sides and a non-included angle are given, a calculator in radian mode, and cos⁡C\cos C applied to the wrong part of the formula. These ten problems cover each kind of given data, the ambiguous case in all three outcomes, area, and the vector form.

  • Triangle ABCABC has angles AA, BB, CC and sides aa, bb, cc, with each side opposite the angle of the same letter. The angles sum to 180∘180^\circ. Angles on this page are in degrees, so a calculator must be in degree mode.
  • Law of sines: asin⁡A=bsin⁡B=csin⁡C\dfrac{a}{\sin A} = \dfrac{b}{\sin B} = \dfrac{c}{\sin C}.
  • Law of cosines: c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C, and the same with the letters rotated. Solved for the angle: cos⁡C=a2+b2−c22ab\cos C = \dfrac{a^2 + b^2 - c^2}{2ab}. When C=90∘C = 90^\circ it is Pythagoras.
  • Which to use. Two angles and a side (AAS, ASA): law of sines. Two sides and the angle between them (SAS), or three sides (SSS): law of cosines. Two sides and an angle not between them (SSA): law of sines, and check for a second triangle.
  • sin⁡θ=sin⁡(180∘−θ)\sin\theta = \sin(180^\circ - \theta), so an equation sin⁡B=s\sin B = s with 0<s<10 < s < 1 has two solutions between 0∘0^\circ and 180∘180^\circ, one acute and one obtuse. arcsin⁡\arcsin returns only the acute one. cos⁡θ\cos\theta is different: it is positive for acute angles and negative for obtuse ones, so arccos⁡\arccos always returns the right angle of a triangle.
  • Area =12absin⁡C= \tfrac12 ab\sin C: two sides and the angle between them.
  • Exact values used: sin⁡30∘=12\sin 30^\circ = \tfrac12, sin⁡45∘=22\sin 45^\circ = \tfrac{\sqrt2}2, sin⁡60∘=32\sin 60^\circ = \tfrac{\sqrt3}2, cos⁡60∘=12\cos 60^\circ = \tfrac12, cos⁡120∘=−12\cos 120^\circ = -\tfrac12. Other values are rounded to two decimal places.

Builds on: Trig identities

Problems

  1. ·

    In triangle ABCABC, A=45∘A = 45^\circ, B=60∘B = 60^\circ and a=10a = 10. Find CC, bb and cc exactly.

  2. ·

    In triangle ABCABC, a=5a = 5, b=8b = 8 and C=60∘C = 60^\circ. Find cc.

  3. ··

    A triangle has sides 77, 88 and 1313. Find its largest angle exactly.

  4. ··

    Solve the triangle with sides a=5a = 5, b=6b = 6, c=7c = 7: find all three angles.

  5. ··

    In triangle ABCABC, A=30∘A = 30^\circ, a=6a = 6 and b=10b = 10. Find every possible BB, CC and cc.

  6. ··

    In triangle ABCABC, A=30∘A = 30^\circ, a=12a = 12 and b=10b = 10. Find every possible BB, CC and cc.

  7. ·

    In triangle ABCABC, A=30∘A = 30^\circ, a=4a = 4 and b=10b = 10. Find BB.

  8. ··

    Find the area of the triangle with sides 55, 66 and 77 exactly.

  9. ···

    From a point PP on the shore, one end of a lake is 300300 m away and the other end is 500500 m away, and the angle at PP between the two lines of sight is 120∘120^\circ. How long is the lake?

  10. ···

    Vectors uu and vv have ∥u∥=3\|u\| = 3, ∥v∥=5\|v\| = 5 and ∥u−v∥=7\|u - v\| = 7. Find u⋅vu\cdot v and the angle between uu and vv.

Worked solutions

Problem 1

In triangle ABCABC, A=45∘A = 45^\circ, B=60∘B = 60^\circ and a=10a = 10. Find CC, bb and cc exactly.

  1. C=180∘−45∘−60∘=75∘C = 180^\circ - 45^\circ - 60^\circ = 75^\circ.Angle sum. Two angles and a side: law of sines.
  2. b=asin⁡Bsin⁡A=10⋅3222=1032=56b = \dfrac{a\sin B}{\sin A} = \dfrac{10\cdot\tfrac{\sqrt3}2}{\tfrac{\sqrt2}2} = \dfrac{10\sqrt3}{\sqrt2} = 5\sqrt6From asin⁡A=bsin⁡B\tfrac{a}{\sin A} = \tfrac{b}{\sin B}; then rationalize, 1032=1062\tfrac{10\sqrt3}{\sqrt2} = \tfrac{10\sqrt6}{2}.
  3. sin⁡75∘=sin⁡(45∘+30∘)=22⋅32+22⋅12=6+24\sin 75^\circ = \sin(45^\circ + 30^\circ) = \tfrac{\sqrt2}2\cdot\tfrac{\sqrt3}2 + \tfrac{\sqrt2}2\cdot\tfrac12 = \tfrac{\sqrt6 + \sqrt2}{4}The sum formula sin⁡(x+y)=sin⁡xcos⁡y+cos⁡xsin⁡y\sin(x + y) = \sin x\cos y + \cos x\sin y, with cos⁡45∘=22\cos 45^\circ = \tfrac{\sqrt2}2 and cos⁡30∘=32\cos 30^\circ = \tfrac{\sqrt3}2.
  4. c=asin⁡Csin⁡A=10⋅6+2422=5(6+2)2=5(3+1)c = \dfrac{a\sin C}{\sin A} = \dfrac{10\cdot\tfrac{\sqrt6 + \sqrt2}{4}}{\tfrac{\sqrt2}{2}} = \dfrac{5(\sqrt6 + \sqrt2)}{\sqrt2} = 5(\sqrt3 + 1)Law of sines again; 62=3\tfrac{\sqrt6}{\sqrt2} = \sqrt3.
  5. C=75∘C = 75^\circ, b=56≈12.25b = 5\sqrt6 \approx 12.25, c=5(3+1)≈13.66c = 5(\sqrt3 + 1) \approx 13.66Sanity check: the largest angle, CC, is opposite the largest side, cc.

Problem 2

In triangle ABCABC, a=5a = 5, b=8b = 8 and C=60∘C = 60^\circ. Find cc.

  1. c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos CTwo sides and the angle between them: law of cosines.
  2. c2=25+64−2⋅5⋅8⋅12c^2 = 25 + 64 - 2\cdot5\cdot8\cdot\tfrac12cos⁡60∘=12\cos 60^\circ = \tfrac12. The cos⁡C\cos C multiplies only the 2ab2ab term.
  3. c2=89−40=49c^2 = 89 - 40 = 49Multiply before subtracting.
  4. c=7c = 7A side length is positive, so take the positive root.

Problem 3

A triangle has sides 77, 88 and 1313. Find its largest angle exactly.

  1. The largest angle is opposite the largest side, c=13c = 13.In any triangle, larger sides face larger angles.
  2. cos⁡C=a2+b2−c22ab=49+64−1692⋅7⋅8=−56112\cos C = \dfrac{a^2 + b^2 - c^2}{2ab} = \dfrac{49 + 64 - 169}{2\cdot7\cdot8} = \dfrac{-56}{112}Law of cosines solved for the angle.
  3. cos⁡C=−12\cos C = -\tfrac12A negative cosine means CC is obtuse: a2+b2<c2a^2 + b^2 < c^2.
  4. C=120∘C = 120^\circThe angle between 0∘0^\circ and 180∘180^\circ whose cosine is −12-\tfrac12. There is only one, which is why the law of cosines is safe here.

Problem 4

Solve the triangle with sides a=5a = 5, b=6b = 6, c=7c = 7: find all three angles.

  1. cos⁡A=b2+c2−a22bc=36+49−2584=6084=57\cos A = \dfrac{b^2 + c^2 - a^2}{2bc} = \dfrac{36 + 49 - 25}{84} = \dfrac{60}{84} = \dfrac57, so A≈44.42∘A \approx 44.42^\circ.Law of cosines for the angle opposite aa.
  2. cos⁡B=a2+c2−b22ac=25+49−3670=3870\cos B = \dfrac{a^2 + c^2 - b^2}{2ac} = \dfrac{25 + 49 - 36}{70} = \dfrac{38}{70}, so B≈57.12∘B \approx 57.12^\circ.The same formula with the letters rotated.
  3. C=180∘−A−B≈78.46∘C = 180^\circ - A - B \approx 78.46^\circ.Angle sum. Check with the law of cosines: cos⁡C=25+36−4960=0.2\cos C = \tfrac{25 + 36 - 49}{60} = 0.2, and arccos⁡0.2≈78.46∘\arccos 0.2 \approx 78.46^\circ.
  4. A≈44.42∘A \approx 44.42^\circ, B≈57.12∘B \approx 57.12^\circ, C≈78.46∘C \approx 78.46^\circAll acute, since every cosine is positive; the largest is opposite the side 7.

Problem 5

In triangle ABCABC, A=30∘A = 30^\circ, a=6a = 6 and b=10b = 10. Find every possible BB, CC and cc.

  1. sin⁡B=bsin⁡Aa=10⋅126=56\sin B = \dfrac{b\sin A}{a} = \dfrac{10\cdot\tfrac12}{6} = \dfrac56Two sides and a non-included angle (SSA): law of sines.
  2. B≈56.44∘B \approx 56.44^\circ or B≈180∘−56.44∘=123.56∘B \approx 180^\circ - 56.44^\circ = 123.56^\circ.56<1\tfrac56 < 1, so there are two angles with this sine, arcsin⁡56\arcsin\tfrac56 and its supplement.
  3. Both are possible: 30∘+123.56∘=153.56∘<180∘30^\circ + 123.56^\circ = 153.56^\circ < 180^\circ.The obtuse BB leaves room for a positive CC, so it gives a real triangle too.
  4. C≈93.56∘C \approx 93.56^\circ, c=asin⁡Csin⁡A=12sin⁡93.56∘≈11.98c = \dfrac{a\sin C}{\sin A} = 12\sin 93.56^\circ \approx 11.98; or C≈26.44∘C \approx 26.44^\circ, c=12sin⁡26.44∘≈5.34c = 12\sin 26.44^\circ \approx 5.34.Angle sum for each, then the law of sines with asin⁡A=61/2=12\tfrac{a}{\sin A} = \tfrac{6}{1/2} = 12.
  5. Two triangles: B≈56.44∘B \approx 56.44^\circ, C≈93.56∘C \approx 93.56^\circ, c≈11.98c \approx 11.98; or B≈123.56∘B \approx 123.56^\circ, C≈26.44∘C \approx 26.44^\circ, c≈5.34c \approx 5.34Geometrically: side a=6a = 6 swings from CC and meets the line of side cc at two points, because 6 is between the height bsin⁡A=5b\sin A = 5 and b=10b = 10.

Problem 6

In triangle ABCABC, A=30∘A = 30^\circ, a=12a = 12 and b=10b = 10. Find every possible BB, CC and cc.

  1. sin⁡B=10⋅1212=512\sin B = \dfrac{10\cdot\tfrac12}{12} = \dfrac{5}{12}SSA again: law of sines.
  2. B≈24.62∘B \approx 24.62^\circ or B≈155.38∘B \approx 155.38^\circ.The two angles with sine 512\tfrac{5}{12}.
  3. 30∘+155.38∘>180∘30^\circ + 155.38^\circ > 180^\circ, so only B≈24.62∘B \approx 24.62^\circ is possible.The obtuse candidate leaves no room for CC. This always happens when a≥ba \ge b: the angle opposite the shorter side bb must be smaller than AA.
  4. C≈125.38∘C \approx 125.38^\circ and c=12sin⁡125.38∘1/2≈19.57c = \dfrac{12\sin 125.38^\circ}{1/2} \approx 19.57.Angle sum, then the law of sines with asin⁡A=24\tfrac{a}{\sin A} = 24.
  5. One triangle: B≈24.62∘B \approx 24.62^\circ, C≈125.38∘C \approx 125.38^\circ, c≈19.57c \approx 19.57Steps 3 and 4.

Problem 7

In triangle ABCABC, A=30∘A = 30^\circ, a=4a = 4 and b=10b = 10. Find BB.

  1. sin⁡B=10⋅124=54\sin B = \dfrac{10\cdot\tfrac12}{4} = \dfrac54Law of sines.
  2. sin⁡B≤1\sin B \le 1 for every angle, and 54>1\tfrac54 > 1.No angle has this sine.
  3. No such triangleGeometrically: the height from CC to the line of side cc is bsin⁡A=5b\sin A = 5, and a side of length 4 cannot reach that line.

Problem 8

Find the area of the triangle with sides 55, 66 and 77 exactly.

  1. cos⁡C=0.2=15\cos C = 0.2 = \tfrac15, from Problem 4.The area formula needs an angle between two known sides; CC is between a=5a = 5 and b=6b = 6.
  2. sin⁡C=1−125=2425=265\sin C = \sqrt{1 - \tfrac{1}{25}} = \sqrt{\tfrac{24}{25}} = \dfrac{2\sqrt6}{5}sin⁡2C+cos⁡2C=1\sin^2C + \cos^2C = 1, and sin⁡C>0\sin C > 0 for any angle of a triangle, so take the positive root.
  3. Area =12⋅5⋅6⋅265=66= \tfrac12\cdot5\cdot6\cdot\dfrac{2\sqrt6}{5} = 6\sqrt612absin⁡C\tfrac12 ab\sin C.
  4. 66≈14.706\sqrt6 \approx 14.70Check with Heron's formula: s=9s = 9, 9⋅4⋅3⋅2=216=66\sqrt{9\cdot4\cdot3\cdot2} = \sqrt{216} = 6\sqrt6.

Problem 9

From a point PP on the shore, one end of a lake is 300300 m away and the other end is 500500 m away, and the angle at PP between the two lines of sight is 120∘120^\circ. How long is the lake?

  1. d2=3002+5002−2⋅300⋅500cos⁡120∘d^2 = 300^2 + 500^2 - 2\cdot300\cdot500\cos120^\circThe two sight lines and the lake form a triangle with two sides and the angle between them: law of cosines.
  2. cos⁡120∘=−12\cos 120^\circ = -\tfrac12, so −2⋅300⋅500⋅(−12)=+150 000-2\cdot300\cdot500\cdot\big(-\tfrac12\big) = +150\,000.The angle is obtuse, so the cosine is negative and the last term is added.
  3. d2=90 000+250 000+150 000=490 000d^2 = 90\,000 + 250\,000 + 150\,000 = 490\,000The squares and the step 2 term.
  4. 700700 m490 000=700\sqrt{490\,000} = 700. Sanity check: an angle over 90∘90^\circ makes the far side longer than Pythagoras would, 340 000≈583\sqrt{340\,000} \approx 583.

Problem 10

Vectors uu and vv have ∥u∥=3\|u\| = 3, ∥v∥=5\|v\| = 5 and ∥u−v∥=7\|u - v\| = 7. Find u⋅vu\cdot v and the angle between uu and vv.

  1. ∥u−v∥2=(u−v)⋅(u−v)=∥u∥2+∥v∥2−2 u⋅v\|u - v\|^2 = (u - v)\cdot(u - v) = \|u\|^2 + \|v\|^2 - 2\,u\cdot vExpand the dot product: u⋅u−2 u⋅v+v⋅vu\cdot u - 2\,u\cdot v + v\cdot v, using u⋅v=v⋅uu\cdot v = v\cdot u.
  2. 49=9+25−2 u⋅v49 = 9 + 25 - 2\,u\cdot v, so u⋅v=−152u\cdot v = -\tfrac{15}{2}.Substitute and solve.
  3. cos⁡θ=u⋅v∥u∥ ∥v∥=−15/215=−12\cos\theta = \dfrac{u\cdot v}{\|u\|\,\|v\|} = \dfrac{-15/2}{15} = -\tfrac12The definition of the angle between two vectors. This ratio is the cosine similarity of uu and vv.
  4. u⋅v=−152u\cdot v = -\tfrac{15}{2}, θ=120∘\theta = 120^\circSteps 1 and 3 together are the law of cosines in the triangle with sides ∥u∥=3\|u\| = 3, ∥v∥=5\|v\| = 5 and ∥u−v∥=7\|u - v\| = 7: its angle opposite the side 7 is 120∘120^\circ.

Where this goes wrong

1. Taking arcsin for an angle that may be obtuse

Once one angle is known, the law of sines looks like the quickest route to the next.

  1. Sides 77, 88, 1313: cos⁡A=64+169−492⋅8⋅13=2326\cos A = \tfrac{64 + 169 - 49}{2\cdot8\cdot13} = \tfrac{23}{26}, so sin⁡A=7326\sin A = \tfrac{7\sqrt3}{26}Right so far: the angle opposite the side 7, from the law of cosines, A≈27.80∘A \approx 27.80^\circ.
  2. sin⁡C=13sin⁡A7=32\sin C = \dfrac{13\sin A}{7} = \dfrac{\sqrt3}{2}Right so far: the law of sines.
  3. C=arcsin⁡32=60∘C = \arcsin\tfrac{\sqrt3}2 = 60^\circarcsin⁡\arcsin returns only the acute angle, and sin⁡120∘\sin 120^\circ is also 32\tfrac{\sqrt3}2. Here C=120∘C = 120^\circ (Problem 3). With C=60∘C = 60^\circ, BB would be 180∘−27.80∘−60∘=92.20∘180^\circ - 27.80^\circ - 60^\circ = 92.20^\circ, the largest angle, opposite b=8b = 8, which is not the longest side. Use the law of cosines for the largest angle, or for any angle that might be obtuse.

2. Missing the second triangle in the SSA case

The law of sines gives one value of sin⁡B\sin B, and the calculator gives one angle for it.

  1. A=30∘A = 30^\circ, a=6a = 6, b=10b = 10: sin⁡B=56\sin B = \tfrac56Right so far: Problem 5, step 1.
  2. “arcsin⁡56≈56.44∘\arcsin\tfrac56 \approx 56.44^\circ, so B≈56.44∘B \approx 56.44^\circ.”The habit that causes the mistake: stopping at the calculator's answer.
  3. The triangle has B≈56.44∘B \approx 56.44^\circ, C≈93.56∘C \approx 93.56^\circ, c≈11.98c \approx 11.98, and no other solution180∘−56.44∘=123.56∘180^\circ - 56.44^\circ = 123.56^\circ has the same sine and still leaves 26.44∘26.44^\circ for CC, so a second triangle with c≈5.34c \approx 5.34 also fits the data. Whenever SSA gives sin⁡B<1\sin B < 1, test the supplement: it is a second triangle exactly when A+(180∘−B)<180∘A + (180^\circ - B) < 180^\circ.

3. A calculator in radian mode

Nothing on the screen says which mode the calculator is in.

  1. A=45∘A = 45^\circ, B=60∘B = 60^\circ, a=10a = 10: b=10sin⁡60∘sin⁡45∘b = \dfrac{10\sin 60^\circ}{\sin 45^\circ}Right so far: Problem 1, step 2.
  2. “Type 10sin⁡(60)/sin⁡(45)10\sin(60)/\sin(45).”The habit that causes the mistake: entering degrees into a calculator set to radians.
  3. b=10sin⁡60sin⁡45≈−3.58b = \dfrac{10\sin 60}{\sin 45} \approx -3.58In radians, sin⁡60≈−0.305\sin 60 \approx -0.305 and sin⁡45≈0.851\sin 45 \approx 0.851: these are the sines of 60 and 45 radians. A negative side length is the giveaway. In degree mode, b≈12.25b \approx 12.25.

4. Multiplying the whole sum by cos C

The formula c2=a2+b2−2abcos⁡Cc^2 = a^2 + b^2 - 2ab\cos C has cos⁡C\cos C at the end, and it gets applied to everything before it.

  1. a=5a = 5, b=8b = 8, C=60∘C = 60^\circ: c2=25+64−2⋅5⋅8cos⁡60∘c^2 = 25 + 64 - 2\cdot5\cdot8\cos60^\circRight so far: Problem 2, step 2.
  2. “25+64−80=925 + 64 - 80 = 9, then multiply by cos⁡60∘\cos 60^\circ.”The habit that causes the mistake: working left to right instead of multiplying first.
  3. c2=(25+64−80)⋅12=4.5c^2 = (25 + 64 - 80)\cdot\tfrac12 = 4.5, so c≈2.12c \approx 2.12cos⁡C\cos C multiplies only 2ab2ab: c2=89−80⋅12=49c^2 = 89 - 80\cdot\tfrac12 = 49, so c=7c = 7. A side of 2.122.12 cannot be right: by the triangle inequality, c>b−a=3c > b - a = 3.

5. Dropping the sign of cos 120°

The law of cosines is remembered as "Pythagoras minus something".

  1. d2=3002+5002−2⋅300⋅500cos⁡120∘d^2 = 300^2 + 500^2 - 2\cdot300\cdot500\cos 120^\circRight so far: Problem 9, step 1.
  2. “cos⁡120∘\cos 120^\circ has reference angle 60∘60^\circ, so it is 12\tfrac12.”The habit that causes the mistake: the reference angle gives the size of the cosine, not its sign.
  3. d2=340 000−150 000=190 000d^2 = 340\,000 - 150\,000 = 190\,000, so d≈436d \approx 436 mcos⁡120∘=−12\cos 120^\circ = -\tfrac12, since cosine is negative in quadrant II, so the term is added: d2=490 000d^2 = 490\,000, d=700d = 700 m. A wide angle at PP should give a long lake, longer than the Pythagoras value of about 583 m, not shorter.

Print this set: law-of-sines-and-law-of-cosines.pdf (problems, answers, and worked solutions on separate pages).

Read the guide: Law of sines and law of cosines: which one to use, and the ambiguous case