Unit 5, lesson 70

The Law of Cosines and Triangle Area

How the law of cosines finds a side from two sides and the angle between them, or an angle from three sides, and how to get the area of a triangle from its sides and angles.

  • Theory part 139
  • Practice part 140
  • Solving Triangles

Two straight trails leave a junction 60∘60^\circ apart. You walk 55 kilometers along one, a friend walks 88 kilometers along the other, and you want to know how far apart you are now. The law of sines cannot start here, because no side is known together with the angle across from it. The law of cosines can, and the same few ideas give the area of the triangle you have marked out.

Key terms

Included angle

Definition The included angle of two sides of a triangle is the angle at the vertex where those two sides meet. In triangle ABCABC, with sides aa, bb and cc opposite the angles AA, BB and CC, the angle CC is included between sides aa and bb, the angle AA between bb and cc, and the angle BB between aa and cc.

In plain words Think of two sides as the arms of a hinge. The included angle tells you how far the hinge is open, and that decides how far apart the free ends are.

Example Join sides of lengths 55 and 88 at CC and open the hinge. With these two lengths fixed, the third side cc and the area depend only on CC. The table uses the law of cosines and the area formula from the sections below.

CCThird side ccArea
30∘30^\circ4.444.4410.0010.00
60∘60^\circ7.007.0017.3217.32
90∘90^\circ9.439.4320.0020.00
120∘120^\circ11.3611.3617.3217.32
150∘150^\circ12.5812.5810.0010.00

The third side keeps growing as the hinge opens, while the area is largest at 90∘90^\circ.

The law of cosines

Definition In any triangle ABCABC with sides aa, bb and cc opposite the angles AA, BB and CC,

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

and in the same way a2=b2+c2−2bccos⁡Aa^2 = b^2 + c^2 - 2bc \cos A and b2=a2+c2−2accos⁡Bb^2 = a^2 + c^2 - 2ac \cos B. Solved for the angle, it reads

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

To see why it holds, place CC at the origin, BB at (a,0)(a, 0) and AA at (bcos⁡C,bsin⁡C)(b \cos C, b \sin C). The distance formula and the identity cos⁡2C+sin⁡2C=1\cos^2 C + \sin^2 C = 1 give

c2=(bcos⁡C−a)2+(bsin⁡C)2=a2+b2−2abcos⁡C.\begin{aligned} c^2 &= (b \cos C - a)^2 + (b \sin C)^2 \\[0.4em] &= a^2 + b^2 - 2ab \cos C. \end{aligned}

In plain words It is the Pythagorean theorem with a correction term. When C=90∘C = 90^\circ the term 2abcos⁡C2ab \cos C is zero. When CC is obtuse, cos⁡C\cos C is negative and the opposite side comes out longer than in a right triangle, and when CC is acute it comes out shorter.

Example The trails from the start give a=5a = 5, b=8b = 8 and C=60∘C = 60^\circ, so

c2=25+64−2⋅5⋅8⋅12=49c^2 = 25 + 64 - 2 \cdot 5 \cdot 8 \cdot \tfrac{1}{2} = 49

and you are c=7c = 7 kilometers apart.

SAS and SSS

Definition In the SAS case you know two sides and their included angle, with the angle strictly between 0∘0^\circ and 180∘180^\circ. In the SSS case you know all three sides, and they satisfy the triangle inequality below. Each case determines exactly one triangle. For SAS, find the third side with the law of cosines. For SSS, find two of the angles from

cos⁡A=b2+c2−a22bc,cos⁡B=a2+c2−b22ac,\begin{gathered} \cos A = \frac{b^2 + c^2 - a^2}{2bc}, \\[0.8em] \cos B = \frac{a^2 + c^2 - b^2}{2ac}, \end{gathered}

and then C=180∘−A−BC = 180^\circ - A - B. Arccosine is one-to-one with outputs in [0∘,180∘][0^\circ, 180^\circ], so an angle found from its cosine is never ambiguous, unlike an angle found from its sine. If you prefer the law of sines for a later angle in SAS, use it only for the angle opposite the shorter given side, which is always acute.

In plain words Two sides with the angle between them, or all three sides, pin down one triangle with no second answer. Start with the law of cosines, and whenever you solve for an angle, take the arccosine.

Example Solve the triangle with a=7a = 7, b=5b = 5 and c=3c = 3. Start with the largest angle, which is opposite the longest side.

cos⁡A=52+32−722⋅5⋅3=−1530=−12,A=120∘.\begin{aligned} \cos A &= \frac{5^2 + 3^2 - 7^2}{2 \cdot 5 \cdot 3} \\[0.8em] &= \frac{-15}{30} = -\frac{1}{2}, \\[0.8em] A &= 120^\circ. \end{aligned}

Next,

cos⁡B=72+32−522⋅7⋅3=3342=1114,B≈38.21∘,\begin{aligned} \cos B &= \frac{7^2 + 3^2 - 5^2}{2 \cdot 7 \cdot 3} \\[0.8em] &= \frac{33}{42} = \frac{11}{14}, \\[0.8em] B &\approx 38.21^\circ, \end{aligned}

and the last angle is C≈21.79∘C \approx 21.79^\circ, since the three angles add to 180∘180^\circ.

Triangle inequality

Definition Three positive numbers aa, bb and cc are the side lengths of a triangle exactly when each one is less than the sum of the other two,

a<b+c,b<a+c,c<a+b.\begin{gathered} a < b + c, \\[0.4em] b < a + c, \\[0.4em] c < a + b. \end{gathered}

It is enough to check that the largest number is less than the sum of the other two. If the largest equals that sum, the three corners lie on one line, a flat case that is not a triangle. For a genuine triangle the law of cosines always gives a cosine strictly between −1-1 and 11.

In plain words Going straight from one corner to another is shorter than any detour through the third corner. Three sticks only close up into a triangle when the longest is shorter than the other two put together.

Example Sticks of lengths 44, 66 and 1111 cannot form a triangle, since 11>4+611 > 4 + 6. The law of cosines notices too. Solving for the angle opposite 1111 gives

cos⁡C=42+62−1122⋅4⋅6=−6948≈−1.44,\begin{aligned} \cos C &= \frac{4^2 + 6^2 - 11^2}{2 \cdot 4 \cdot 6} \\[0.8em] &= -\frac{69}{48} \approx -1.44, \end{aligned}

and no angle has a cosine below −1-1. With 44, 66 and 1010 the same computation gives exactly −1-1, an angle of 180∘180^\circ, so those three sticks lie flat along one line.

Area from two sides and the included angle

Definition The area KK of a triangle with sides aa and bb and included angle CC is

K=12absin⁡C.K = \frac{1}{2} ab \sin C.

The other pairs of sides give the same area in the same way,

K=12bcsin⁡A=12acsin⁡B.K = \frac{1}{2} bc \sin A = \frac{1}{2} ac \sin B.

The reason is that the height from AA to the line through BB and CC equals bsin⁡Cb \sin C, also when CC is obtuse because sin⁡(180∘−C)=sin⁡C\sin(180^\circ - C) = \sin C, so the formula is one half of the base aa times the height.

In plain words It is one half of base times height, where the sine of the angle between the two known sides supplies the height. An angle and its supplement have the same sine, so they give the same area.

Example For the trail triangle, a=5a = 5, b=8b = 8 and C=60∘C = 60^\circ, so

K=12⋅5⋅8⋅sin⁡60∘=20⋅32=103≈17.32 square kilometers.\begin{aligned} K &= \frac{1}{2} \cdot 5 \cdot 8 \cdot \sin 60^\circ \\[0.8em] &= 20 \cdot \frac{\sqrt{3}}{2} = 10\sqrt{3} \\[0.8em] &\approx 17.32 \text{ square kilometers.} \end{aligned}

Heron’s formula

Definition Let a triangle have sides aa, bb and cc and semiperimeter

s=a+b+c2.s = \frac{a + b + c}{2}.

Then its area is

K=s(s−a)(s−b)(s−c).K = \sqrt{s(s - a)(s - b)(s - c)}.

When aa, bb and cc satisfy the triangle inequality, each of the factors s−as - a, s−bs - b and s−cs - c is positive, so the number under the root is positive.

In plain words Three sides fix the triangle, so they also fix its area. Heron’s formula gets the area straight from the sides, with no angle and no height needed.

Example The trail triangle has sides 55, 88 and 77, so s=10s = 10 and

K=10⋅5⋅2⋅3=300=103.\begin{aligned} K &= \sqrt{10 \cdot 5 \cdot 2 \cdot 3} \\[0.4em] &= \sqrt{300} = 10\sqrt{3}. \end{aligned}

This matches the area found from one half of absin⁡Cab \sin C.

Bearings

Definition A bearing gives a direction in the plane as an angle measured from north or south. A three-figure bearing is measured clockwise from north, from 000∘000^\circ up to but not including 360∘360^\circ, so east is 090∘090^\circ, south is 180∘180^\circ and west is 270∘270^\circ. A quadrant bearing such as N 40∘40^\circ E starts from north or south and turns the stated acute angle toward east or west. So N 40∘40^\circ E is the three-figure bearing 040∘040^\circ, and S 30∘30^\circ W is 210∘210^\circ.

In plain words A bearing is a compass heading written as an angle. To use bearings in a triangle, sketch a north arrow at each corner and work out the angles inside the triangle from the headings.

Example A boat leaves port, sails 1212 kilometers on bearing 050∘050^\circ, then turns onto bearing 110∘110^\circ and sails 88 kilometers. The turn is 60∘60^\circ to the right, so the angle inside the triangle at the turning point is 180∘−60∘=120∘180^\circ - 60^\circ = 120^\circ. The distance dd back to port satisfies

d2=122+82−2⋅12⋅8cos⁡120∘=144+64+96=304,\begin{aligned} d^2 &= 12^2 + 8^2 - 2 \cdot 12 \cdot 8 \cos 120^\circ \\[0.4em] &= 144 + 64 + 96 = 304, \end{aligned}

so d=304≈17.44d = \sqrt{304} \approx 17.44 kilometers. The angle PP at port must be acute, since the triangle already has a 120∘120^\circ angle, so the law of sines finds it safely,

sin⁡P=8sin⁡120∘304≈0.397,P≈23.41∘.\begin{gathered} \sin P = \frac{8 \sin 120^\circ}{\sqrt{304}} \approx 0.397, \\[0.8em] P \approx 23.41^\circ. \end{gathered}

The boat turned clockwise, so seen from port it now lies on bearing 050∘+23.41∘050^\circ + 23.41^\circ, or about 073∘073^\circ.

Check yourself

  1. Two sides of a triangle are 1010 and 1414, and the angle between them is 35∘35^\circ. Find the third side and the area.
Show the answer

By the law of cosines

c2=102+142−2⋅10⋅14cos⁡35∘≈66.64,\begin{aligned} c^2 &= 10^2 + 14^2 - 2 \cdot 10 \cdot 14 \cos 35^\circ \\[0.4em] &\approx 66.64, \end{aligned}

so c≈8.16c \approx 8.16. The area is

K=12⋅10⋅14⋅sin⁡35∘≈40.15.K = \frac{1}{2} \cdot 10 \cdot 14 \cdot \sin 35^\circ \approx 40.15.
  1. Can 33, 44 and 88 be the sides of a triangle? Find the area of the triangle with sides 1313, 1414 and 1515.
Show the answer

No, because 8>3+48 > 3 + 4. For the sides 1313, 1414 and 1515 the semiperimeter is s=21s = 21, and Heron’s formula gives

K=21⋅8⋅7⋅6=7056=84.K = \sqrt{21 \cdot 8 \cdot 7 \cdot 6} = \sqrt{7056} = 84.
  1. Two boats leave the same dock. One travels 1010 kilometers on bearing 030∘030^\circ and the other 66 kilometers on bearing 100∘100^\circ. How far apart are they?
Show the answer

The angle between their paths at the dock is 100∘−30∘=70∘100^\circ - 30^\circ = 70^\circ, so

d2=102+62−2⋅10⋅6cos⁡70∘≈94.96\begin{aligned} d^2 &= 10^2 + 6^2 - 2 \cdot 10 \cdot 6 \cos 70^\circ \\[0.4em] &\approx 94.96 \end{aligned}

and d≈9.74d \approx 9.74 kilometers.

How this lesson connects

Where this leads in Calculus