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:

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

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?

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)

The rule in one sentence: a complete side–opposite-angle pair → sines; no such pair → cosines.

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.

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.
  • 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

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.

Frequently asked questions

Related articles