Chalk−1

Math · Precalculus · Concept

The law of sines and the law of cosines

The law of sines and the law of cosines solve triangles that have no right angle. The law of cosines handles two sides with the angle between them, or all three sides. The law of sines handles any triangle in which you know a side, the angle opposite it and one more part. Two sides and an angle that is not between them can fit two triangles, one or none, so that case needs a test.

A concrete case

Two trees and a 120⁢° angle

You stand in a field. One tree is 30 m away, another is 50 m away, and the angle between your two lines of sight is 120⁢°. How far apart are the trees?

If the angle were 90⁢°, the Pythagorean theorem would answer it, 302+502 =3400 ≈58.3 m. A wider angle opens the triangle and pushes the trees farther apart, and a narrower one pulls them closer. At 60⁢° the gap is only about 43.6 m.

The Pythagorean theorem needs one correction term, and that term uses the cosine of the angle. The cosine of 120⁢° is −1⁢/2, and the distance comes out at exactly 70 m.

c2=302+502−2⋅30⋅50cos120∘=4900
c2=302+502−2⋅30⋅50cos120∘=4900
Distance between the trees for three angles
Angle at youIts cosineDistance squaredDistance
60⁢°1⁢/23400−1500 =1900about 43.6 m
90⁢°03400about 58.3 m
120⁢°−1⁢/23400+1500 =490070 m

The rule

Label the triangle, then the law of cosines

Name the angles A, B and C, and give each side the lowercase letter of the angle opposite it, so side a faces angle A. The three angles add to 180⁢°. Solving a triangle means finding all three sides and all three angles from the parts you are given.

The law of cosines says the square of one side equals the sum of the squares of the other two, minus twice their product times the cosine of the angle between them. When C=90⁢°, cosC=0 and the law is the Pythagorean theorem. For the trees, c2=3400−3000cos120⁢° =3400+1500 =4900, and c=70 m.

Solved for the cosine, the same law gives an angle from three sides.

c2=a2+b2−2⁢a⁢bcosC,cosC=a2+b2−c22⁢a⁢b
c2=a2+b2−2⁢a⁢bcosCcosC=a2+b2−c22⁢a⁢b

The law of sines

In any triangle, each side divided by the sine of the angle opposite it gives the same number. To use it you need one complete pair, a side with its opposite angle, and one more part.

In a triangle with A=30⁢°, a=5 and B≈53.13⁢°, the law gives b=5sin53.13⁢°⁢/sin30⁢° ≈5⁢(0.8)⁢/0.5 =8.

asinA=bsinB=csinC

Why it works

Why both laws hold

Put angle C at the origin with side b along the positive x-axis, so the corner A sits at (b,0). The corner B is a distance a from the origin at angle C, so it sits at (acosC,asinC), on a circle of radius a.

Side c is the distance from A to B. The distance formula gives c2=(acosC−b)2 +(asinC)2. Expanding gives a2cos2C−2⁢a⁢bcosC+b2 +a2sin2C, and cos2C+sin2C=1 turns that into a2+b2−2⁢a⁢bcosC. The algebra is the same whether C is acute, right or obtuse.

The law of sines comes from a height, and a height comes from a right triangle. In a right triangle with hypotenuse r, put the corner at angle A at the origin. The far end of the hypotenuse is the point at angle A on a circle of radius r, (rcosA,rsinA), so the side opposite A is rsinA. That is, sinA is opposite/hypotenuse.

Drop a perpendicular from C to the line through side c and call its length h. Seen from corner A, h=bsinA, and seen from corner B, h=asinB. Then bsinA=asinB, which rearranges to a⁢/sinA=b⁢/sinB. A height from another corner brings in c and sinC.

c2=(acosC−b)2+(asinC)2=a2+b2−2⁢a⁢bcosC
c2=(acosC−b)2+(asinC)2=a2+b2−2⁢a⁢bcosC

The method

Which law fits the data

Sort the problem by what is given. S stands for a side and A for an angle, and the order says where they sit. SAS is two sides and the angle between them.

Choosing a law
GivenStart withThen
SAS, two sides and the angle between themLaw of cosines for the third sideLaw of sines for the angle opposite the shorter known side, then the angle sum
SSS, three sidesLaw of cosines for the angle opposite the longest sideLaw of sines for a second angle, then the angle sum
ASA or AAS, two angles and a sideAngle sum for the third angleLaw of sines for each missing side
SSA, two sides and an angle opposite one of themLaw of sines for the other opposite angleTest for two triangles, one or none

Take the angles in a safe order

A calculator’s inverse sine returns only angles from −90⁢° to 90⁢°, so it never reports an obtuse angle. The inverse cosine returns angles from 0⁢° to 180⁢°, and a negative cosine means an obtuse angle. That is why SAS and SSS problems start with the law of cosines.

When two angles are still unknown and you reach for the law of sines, find the one opposite the shorter side first. It is the smaller of the two, so it must be acute, and the inverse sine reports it correctly. The angle sum then gives the last angle, obtuse or not.

Test an SSA problem for two triangles, one or none

The law of sines gives sinB, and two angles between 0⁢° and 180⁢° share that sine, an acute B and its supplement 180⁢°−B. If sinB comes out above 1, no triangle exists. Otherwise test each candidate. It makes a triangle only if A+B is less than 180⁢°, leaving room for a third angle.

The table holds A=30⁢° and b=8 fixed and changes the side a opposite the known angle. Two shortcuts follow. When A is acute and a is at least as long as b, there is exactly one triangle. If A is right or obtuse, there is one triangle when a is longer than b and none otherwise.

How many triangles when A=30⁢° and b=8
Side asinB =8sin30⁢°÷aTriangles
31.33None, as no angle has a sine above 1
41One, with B=90⁢°
50.8Two, B ≈53.1⁢° or B ≈126.9⁢°
100.4One, B ≈23.6⁢° (156.4⁢° is too large)

Where it breaks

Where it breaks

The Pythagorean theorem is the law of cosines only at 90⁢°. Used on the trees at 120⁢°, it gives 58.3 m instead of 70 m.

The law of sines cannot start an SAS or SSS problem, because no side is paired with its opposite angle yet. Start those with the law of cosines.

Not every three lengths make a triangle. Sides 2, 3 and 6 give cosC =(4+9−36)⁢/12 =−23⁢/12, and no angle has a cosine below −1. The longest side must be shorter than the other two together, and 6 is more than 2+3.

An SSA problem can have two triangles, one or none, because the law of sines gives only the sine of the new angle.

A calculator in radian mode reads sin60 as the sine of 60 radians, about −0.305. Every angle in these problems is in degrees.

Check your answer

Check your answer

A solved triangle has six parts, and they have to agree with one another.

Add the angles. They must total 180⁢°, up to rounding.

Compare the order. The longest side faces the largest angle and the shortest side the smallest. In the triangle with sides 3, 7 and 8, the side 8 faces 98.2⁢° and the side 3 faces 21.8⁢°.

Find one angle a second way. In that triangle the law of cosines gives cosA =(82+72−32)⁢/⁢(2⋅8⋅7) =104⁢/112 ≈0.9286, and A≈21.8⁢° again.

To have Chalk check the arithmetic, write the law with the numbers in on the first row of a Math box and each simplification below it. Each true row reads ✓, and a slip reads ✗. Under c2=52+82 −2⋅5⋅8cos60⁢°, the row c2=25+64−80 reads ✗ with “That equality is false: 49 is not 9.” Write the degree sign on every angle. Without it Chalk reads sin60 in radians, marks the row ✗ and says so.

Chalk checks each row down to the value of the sine or cosine. A wrong value of a sine on its own row, such as sinB=0.8 where 0.4 is right, reads ✗. The step from that value to the angle reads ? or is left to you. Take the sine or cosine of your angle with a calculator and compare.

Area, the circle through the corners, and Heron

The height from the proof also gives the area. A triangle with sides a and b and the angle C between them has area 12a⁢bsinC. The triangle with sides 3 and 8 around a 60⁢° angle has area 12⋅3⋅8⋅sin60⁢° =63 ≈10.39.

Heron’s formula gets the same area from the three sides alone. For sides 3, 7 and 8, the half-perimeter is s=9, and the area is s⁢(s−a)⁢(s−b)⁢(s−c) =9⋅6⋅2⋅1 =108 =63.

The common ratio in the law of sines has a meaning of its own. a⁢/sinA is the diameter of the circle through all three corners, here 7⁢/sin60⁢°=14⁢/3≈8.08.

The law of cosines returns with vectors as the dot product, which reads the angle between two arrows from their lengths and components.

Common mistakes

  • Starting SAS or SSS data with the law of sines. No side is paired with its opposite angle yet, so every ratio has two unknowns. Use the law of cosines first.
  • Pairing a side with an angle that is not opposite it. In the triangle with A=45⁢°, B=60⁢° and a=6, b=6sin45⁢°⁢/sin60⁢° gives 4.90, shorter than a although it faces the larger angle. The right pairing gives 36≈7.35.
  • Dropping the sign of the cosine. With C=120⁢°, cosC=−1⁢/2, so −2⁢a⁢bcosC adds 1500 for the trees and c=70 m, not 1900≈43.6 m.
  • Stopping at one answer in an SSA problem. With A=30⁢°, a=5 and b=8, both B≈53.13⁢° and its supplement 126.87⁢° make triangles, so test the supplement every time.
  • Trusting the inverse sine for an obtuse angle. sin−1(0.9898) is about 81.8⁢°, but the angle in the triangle may be 98.2⁢°, which has the same sine. Find the smaller angle first, or use the law of cosines.
  • Working in radians by accident. sin60 in radian mode is about −0.305, not 3/2≈0.866. Set degree mode, and write the degree sign in a Math box.

Key terms

Law of sines
In any triangle, each side divided by the sine of the angle opposite it gives the same value: a⁢/sinA =b⁢/sinB =c⁢/sinC. It solves a triangle once a side and its opposite angle are known. With two sides and an angle opposite one of them it can give two triangles, one or none.
Law of cosines
In any triangle, c2=a2+b2−2⁢a⁢bcosC, where C is the angle between sides a and b. It gives the third side from two sides and the angle between them, or an angle from three sides. When C=90⁢° it is the Pythagorean theorem.
Inverse sine
arcsinx, or sin−1x: the angle between −π⁢/2 and π⁢/2 (−90⁢° to 90⁢°) whose sine is x, for −1≤x≤1. The equation sinθ=x has other solutions too, and arcsin gives just this one.
Inverse cosine
arccosx, or cos−1x: the angle between 0 and π (0⁢° to 180⁢°) whose cosine is x, for −1≤x≤1. The equation cosθ=x has other solutions too, and arccos gives just this one.
Degree angle measure
Angle units dividing a full turn into 360 equal parts. To convert to radians, multiply degrees by π⁢/180. A polynomial’s degree is a different concept.

Work through an example

A triangle has sides a=3 and b=8, and the angle between them is C=60⁢°. Find side c and angles A and B.

Solve an SAS triangle with the law of cosines →

Solve an AAS triangle with the law of sines →

Find both triangles in the ambiguous case →

Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Study it, then try it

Practice the key terms as flashcards, then open the example in its tool, change a value and keep a useful result on your board.

Study the 5 key terms Check side c in Math Check sin A in Math Open worked example on a board Law of cosines in Math Reference

Your existing work stays on this device. Examples open as editable copies.