Advanced level

The laws of sines and cosines

The law of sines and the law of cosines carry trigonometry into any triangle — including one with no right angle. See which to pick for the data you are given, why the law of cosines generalises Pythagoras, and when there are two solutions.

Before you start

This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:

Where this is used

Real situations where you count exactly the way this lesson teaches:

  • Fencing a plot
    Two sides of a plot run 12 m and 9 m and meet at 115°. The law of cosines closes the corner: √(12² + 9² − 2 · 12 · 9 · cos 115°) = √(225 + 91.3) = 17.8 m. The cosine of an obtuse angle is negative, so the subtraction turns into an addition — 2.8 m more fencing than the 15 m a square corner would have needed.
  • Field surveying
    You do not measure a river with a tape. A surveyor lays out a 50 m baseline along the bank and, from its two ends, reads the angles to a tree on the far side: 78° and 65°. The third angle is 180° − 78° − 65° = 37°, and the law of sines gives the distance from the 78° end to the tree: 50 · sin 65° / sin 37° = 75.3 m. That is not yet the width — the width is the tree’s distance from the baseline, 75.3 · sin 78° = 73.6 m. One baseline and two angles also settle the height of a chimney or a ship’s distance off the quay.
  • Valuing a plot
    A triangular plot has two sides of 42 m and 35 m meeting at 68°. Its area is ½ · 42 · 35 · sin 68° = 735 · 0.927 = 681 m² — without walking the ground and without measuring a height that could not be staked out through undergrowth anyway. At 180 zł a square metre that values the plot at 122,600 zł, and the difference between 68° and a carelessly read 65° is already 27 m², close to 5,000 zł.
  • Hiking
    You follow a path for 3 km, turn through 120° and walk 2 km more. The start lies √(3² + 2² − 2 · 3 · 2 · cos 60°) = √7 ≈ 2.6 km away in a straight line, though your legs covered 5 km. Mind the angle: the sum takes 60°, because a turn is measured off your heading while the law of cosines wants the angle between the legs — 120° would say 4.4 km and argue for a different way home.

All formulas

  • The law of sines

    asinα=bsinβ=csinγ\frac{a}{\sin \alpha} = \frac{b}{\sin \beta} = \frac{c}{\sin \gamma}

    a side and the angle opposite it — always as a pair

  • A side from the law of sines

    b=asinβsinαb = \frac{a \cdot \sin \beta}{\sin \alpha}

    the proportion solved for the unknown side

  • The law of cosines

    a2=b2+c22bccosαa^2 = b^2 + c^2 - 2bc \cos \alpha

    α is the angle between the sides b and c

  • An angle from three sides

    cosα=b2+c2a22bc\cos \alpha = \frac{b^2 + c^2 - a^2}{2bc}

    the law of cosines solved for the angle

  • The angle sum

    α+β+γ=180\alpha + \beta + \gamma = 180^\circ

    the third angle always follows from the other two

  • Area of a triangle

    P=12absinγP = \frac{1}{2} ab \sin \gamma

    two sides and the angle BETWEEN them — no height needed

Sine, cosine and tangent were defined in a right triangle. Most triangles, in exercises and in the field, have no right angle — and yet a missing side and a missing angle can still be computed. Two theorems do the job.

Labelling

abcαβγ
Side a lies opposite angle α, side b opposite β, side c opposite γ. That 'side and the angle opposite it' pairing is the key to both laws.

The convention is simple: a lowercase letter is the side opposite the angle carrying the matching Greek letter. On top of that, the angle sum is always available:

α+β+γ=180\alpha + \beta + \gamma = 180^\circ

so two known angles hand you the third for free.

The law of sines

asinα=bsinβ=csinγ\frac{a}{\sin \alpha} = \frac{b}{\sin \beta} = \frac{c}{\sin \gamma}

A side and the sine of the angle opposite it are proportional: a longer side lies opposite a larger angle. The common ratio even has a geometric meaning — it equals 2R2R, where RR is the radius of the circle through the three vertices.

Use the law when the data contains a complete pair: a side together with the angle opposite it.

b=asinβsinαb = \frac{a \cdot \sin \beta}{\sin \alpha}
In a triangle a = 10 cm, α = 40° and β = 65°. Find side b (to 0.1 cm).

The law of cosines

a2=b2+c22bccosαa^2 = b^2 + c^2 - 2bc \cos \alpha

Here α\alpha is the angle enclosed between the sides bb and cc. Use the law when there is no complete side–angle pair: two sides and the angle between them, or all three sides.

Look at how the formula is built: the first two terms are the Pythagorean theorem, and the third is a correction. For α=90\alpha = 90^\circ we have cos90=0\cos 90^\circ = 0, so the correction disappears:

a2=b2+c2a^2 = b^2 + c^2

The Pythagorean theorem is therefore a special case of the law of cosines. For an acute angle the cosine is positive and the correction shrinks a2a^2; for an obtuse angle the cosine is negative, minus times minus makes plus, and the opposite side grows longer — exactly what the picture suggests.

In a triangle b = 3 cm, c = 8 cm and the angle between them is α = 60°. Find side a.
A triangle has sides 5 cm, 7 cm and 8 cm. Is it acute?

The area from two sides and the angle

The very data the law of cosines needs — two sides and the angle between them — is also enough to find the area, and without working out the third side first.

The starting point is the school formula P=12ahP = \frac{1}{2} a h, where hh is the altitude onto side aa. The trouble is that in a general triangle nobody hands you an altitude. But it can be computed.

h = b · sin γabABγC
The altitude dropped from vertex A onto side a is a leg of a right triangle with hypotenuse b and angle γ.

The altitude, the side bb and part of side aa form a right triangle. In it bb is the hypotenuse and hh the leg opposite the angle γ\gamma, so straight from the definition of the sine:

sinγ=hbh=bsinγ\sin \gamma = \frac{h}{b} \quad \Longrightarrow \quad h = b \sin \gamma

Substituting into the area formula:

P=12ah=12absinγP = \frac{1}{2} a h = \frac{1}{2} ab \sin \gamma

The letters can be permuted — all that matters is that the angle sits between the two sides being multiplied:

P=12absinγ=12bcsinα=12acsinβP = \frac{1}{2} ab \sin \gamma = \frac{1}{2} bc \sin \alpha = \frac{1}{2} ac \sin \beta

Two checks. For γ=90\gamma = 90^\circ we get sin90=1\sin 90^\circ = 1 and what remains is P=12abP = \frac{1}{2} ab, half the product of the legs ✓. And since sinγ=sin(180γ)\sin \gamma = \sin(180^\circ - \gamma), a triangle with 150150^\circ between the same two sides has the same area as one with 3030^\circ — the formula needs no separate obtuse case, unlike the law of cosines.

In a triangle a = 8 cm, b = 6 cm and the angle between them is γ = 30°. Find the area.
Does a triangle with sides 10 cm and 7 cm and a 140° angle between them have a larger area than the same triangle with 40°?

Choosing the law

givenlaw
two angles and a sidesines (third angle from the 180180^\circ sum)
two sides and an angle opposite one of themsines (careful: two solutions are possible)
two sides and the angle between themcosines
three sidescosines (solved for the angle)
two sides and the angle between them, but the area is wantedthe formula P=12absinγP = \frac{1}{2} ab \sin \gamma

The rule in one sentence: a complete side–opposite-angle pair → sines; no such pair → cosines. And when the question is about area rather than a side, the sine formula settles it outright.

The ambiguous case

Data of the form "two sides and the angle opposite the shorter one" can be ambiguous. The reason is in the function itself: sinα=sin(180α)\sin \alpha = \sin(180^\circ - \alpha), so one value of the sine belongs to two angles — one acute, one obtuse.

Take a=6a = 6, b=8b = 8 and α=40\alpha = 40^\circ. The law of sines gives

sinβ=bsinαa=80.642860.857\sin \beta = \frac{b \sin \alpha}{a} = \frac{8 \cdot 0.6428}{6} \approx 0.857

and that sine belongs to both β59\beta \approx 59^\circ and β121\beta \approx 121^\circ. Both are admissible, because in both cases the angle sum stays below 180180^\circ — so two different triangles fit the data. You only discard the one where α+β\alpha + \beta would exceed 180180^\circ.

A calculator will not point this out: the inverse function returns the acute angle only. The second solution has to be added by hand.

The calculator: DEG mode

Both laws are computed with angles in degrees, so the calculator has to sit in DEG mode. The quick test: sin30\sin 30 must give 0.50.5. If it gives 0.988-0.988, the calculator is working in radians and every result will be wrong even though the algebra is right.

Exercises

Law-of-cosines questions have a whole-number answer — type it together with its unit, e.g. 7 cm. In law-of-sines questions the unit is given in brackets, so type the bare number rounded to 0.1. Area questions follow the same rule: when no unit appears in the prompt, write it into the answer (e.g. 12 cm²); when it is given in brackets, type the bare number rounded to 0.1.

Practice

Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.

Exercise 1 of 8Score: 0
Side a by the law of cosines: b = 8 cm, c = 5 cm, α = 60°

Common mistakes

  • Pairing a side with the wrong angle — in the law of sines a side always goes with the angle opposite it.
  • Using the law of cosines with an angle that is not between the given sides — in the formula α\alpha is the angle enclosed by bb and cc.
  • Computing 2bccosα2bc \cos \alpha as (2bccosα)2(2bc \cos \alpha)^2 — only the sides bb and cc are squared.
  • Forgetting the square roota2=49a^2 = 49 is not the answer yet; the answer is a=7a = 7.
  • Missing the second solution in the SSA case — the sine cannot tell an acute angle from an obtuse one.
  • Computing the area from an angle that is not between the given sides — in P=12absinγP = \frac{1}{2} ab \sin \gamma the angle γ\gamma has to be enclosed by aa and bb; any other angle gives a meaningless result.
  • Losing the half in the area formulaabsinγab \sin \gamma is the area of the parallelogram on those sides, and a triangle is half of it.
  • A calculator left in RAD mode — right formulas, wrong numbers.

Formula card

Topic: The laws of sines and cosines

  • The law of sines

    asinα=bsinβ=csinγ\frac{a}{\sin \alpha} = \frac{b}{\sin \beta} = \frac{c}{\sin \gamma}

    a side and the angle opposite it — always as a pair

  • A side from the law of sines

    b=asinβsinαb = \frac{a \cdot \sin \beta}{\sin \alpha}

    the proportion solved for the unknown side

  • The law of cosines

    a2=b2+c22bccosαa^2 = b^2 + c^2 - 2bc \cos \alpha

    α is the angle between the sides b and c

  • An angle from three sides

    cosα=b2+c2a22bc\cos \alpha = \frac{b^2 + c^2 - a^2}{2bc}

    the law of cosines solved for the angle

  • The angle sum

    α+β+γ=180\alpha + \beta + \gamma = 180^\circ

    the third angle always follows from the other two

  • Area of a triangle

    P=12absinγP = \frac{1}{2} ab \sin \gamma

    two sides and the angle BETWEEN them — no height needed

abcαβγ
Labelling in any triangle: side a lies opposite angle α, side b opposite β, side c opposite γ. Both laws rest on that "side opposite angle" pairing.
h = b · sin γabABγC
The area from two sides and the angle between them: the altitude from A onto side a is b · sin γ long, so P = ½ · a · b · sin γ.

Frequently asked questions

Related articles