Guides / Trigonometry
Law of sines and law of cosines: which one to use, and the ambiguous case
Short answer
Label the triangle so side a is opposite angle A, and so on. Given two angles and a side, use the law of sines, a/sin A = b/sin B = c/sin C. Given two sides and the angle between them, or all three sides, use the law of cosines, c2 = a2 + b2 − 2ab cos C. Given two sides and an angle not between them, use the law of sines and check whether a second triangle also fits. Keep the calculator in degree mode.
Why it works
Each formula needs a matched pair: the law of sines needs one side together with the angle across from it, and the law of cosines needs either an angle with both sides that touch it or all three sides. Look at what you're given, and only one of them can start.
The law of cosines is the Pythagorean theorem with a correction term. When C = 90°, cos C = 0 and it becomes c2 = a2 + b2. For an obtuse angle, cos C is negative, so the correction is added and c comes out longer than Pythagoras would give. That's the right direction: opening the angle pushes the far ends apart.
The law of sines has one trap built in. sin 50° and sin 130° are equal (in general sin θ = sin(180° − θ)), so knowing sin B doesn't tell you whether B is acute or obtuse, and the calculator's inverse sine only ever gives the acute one. Cosine doesn't have this problem: it's positive for acute angles and negative for obtuse ones. The exact values come from the simplified radicals you'd expect: sin 30° = 1/2, sin 45° = √2/2, cos 120° = −1/2.
Example 1: two angles and a side (law of sines)
In triangle ABC, A = 30°, B = 45°, and a = 8. Find b.
- asin A = bsin Ba and A are a matched pair, and the side we want is across from the other known angle.
- b = 8 sin 45°sin 30°Multiply both sides by sin B.
- b = 8 · √2/21/2Exact values.
- b = 8√2 ≈ 11.31Dividing by 1/2 doubles: 2 · 8 · √2/2 = 8√2. Sanity check: B is bigger than A, so b should be bigger than a.
Example 2: two sides and the angle between them (law of cosines)
In triangle ABC, a = 3, b = 5, and C = 120°. Find c.
- c2 = 32 + 52 − 2 · 3 · 5 · cos 120°C is the angle between a and b, so the law of cosines applies directly. The law of sines can't start: we don't know any side together with its opposite angle.
- c2 = 9 + 25 − 30 · (−12)cos 120° = −1/2. Only the 2ab term gets multiplied by cos C.
- c2 = 34 + 15 = 49Minus a negative is plus.
- c = 7More than √34 ≈ 5.83, the Pythagoras value, as it should be for an obtuse angle.
Example 3: three sides (law of cosines for an angle)
A triangle has sides a = 5, b = 8, c = 7. Find angle C.
- cos C = a2 + b2 − c22abThe law of cosines solved for cos C.
- cos C = 25 + 64 − 4980 = 4080 = 12c is the side across from C, so c² is the one subtracted.
- C = 60°The only angle between 0° and 180° with cosine 1/2. Inverse cosine never misses an obtuse angle, so this is safe.
Example 4: two sides and an angle not between them (the ambiguous case)
In triangle ABC, A = 40°, a = 7, and b = 10. Find B.
- sin B = 10 sin 40°7 ≈ 0.9183Law of sines, using the matched pair a and A.
- B ≈ 66.67° or B ≈ 180° − 66.67° = 113.33°The calculator gives 66.67°. Its supplement has the same sine.
- 40° + 113.33° = 153.33° < 180°The obtuse choice still leaves room for C, so it is a real triangle too.
- Two triangles: B ≈ 66.67° or B ≈ 113.33°With C ≈ 73.33°, c ≈ 10.43 in the first, and C ≈ 26.67°, c ≈ 4.89 in the second.
If sin B comes out bigger than 1, there's no triangle at all: side a is too short to reach. If the obtuse choice plus A is 180° or more, there's exactly one.
Common mistakes, and the exact line they happen on
1. A calculator in radian mode
Find b when A = 30°, B = 45°, a = 8 (Example 1).
- b = 8 sin 45°sin 30°Right so far.
- b ≈ −6.89This is the mistake. The calculator was in radian mode, so it computed the sines of 45 and 30 radians. A negative length is the giveaway. In degree mode, b ≈ 11.31.
2. Multiplying the whole sum by cos C
Find c when a = 3, b = 5, C = 120° (Example 2).
- c2 = (9 + 25 − 30) · cos 120° = 4 · (−12) = −2This is the mistake. The work went left to right, and cos C got applied to everything before it. A squared length can't be negative. cos C multiplies only 2ab: c² = 34 − 30 · (−1/2) = 49.
3. Using inverse sine for an angle that might be obtuse
In the triangle with sides 3, 5, 7, angle A (across from 3) has sin A = 3√3/14. Find the angle C across from 7.
- sin C = 7 sin A3 = √32Right so far: the law of sines is true here.
- C = 60°This is the mistake. sin 120° is also √3/2, and inverse sine only gives the acute angle. This is Example 2's triangle, where C = 120°. The largest angle is across from the longest side, so find it with the law of cosines, which can't miss an obtuse angle.
4. Missing the second triangle
Find B when A = 40°, a = 7, b = 10 (Example 4).
- sin B ≈ 0.9183Right so far.
- B ≈ 66.67°This is the mistake. It's one answer, not the answer. 113.33° has the same sine and still fits with A = 40°, so there are two triangles.
Whenever you're given two sides and an angle that isn't between them, test the supplement 180° − B every time. It takes one addition.
Practice
In triangle ABC, A = 60°, B = 45°, and b = 6. Find a.
Show answer
Law of sines: a = 6 sin 60° / sin 45° = 6(√3/2)/(√2/2) = 6√3/√2 = 3√6 ≈ 7.35.
In triangle ABC, a = 4, b = 6, and C = 60°. Find c.
Show answer
Law of cosines: c2 = 16 + 36 − 2 · 4 · 6 · (1/2) = 52 − 24 = 28, so c = 2√7 ≈ 5.29.
A triangle has sides 7, 8, and 13. Find its largest angle.
Show answer
The largest angle is across from 13. cos C = (49 + 64 − 169)/(2 · 7 · 8) = −56/112 = −1/2, so C = 120°.
In triangle ABC, A = 30°, a = 5, and b = 8. Find every possible B.
Show answer
sin B = 8 · (1/2) / 5 = 0.8, so B ≈ 53.13° or B ≈ 126.87°. Since 30° + 126.87° < 180°, both work: two triangles.
In triangle ABC, A = 30°, a = 3, and b = 8. Find B.
Show answer
sin B = 8 · (1/2) / 3 = 4/3, which is bigger than 1. No angle has that sine, so no triangle exists.