Law of Sines and Law of Cosines: Which One to Use and When

A surveyor knows two sides of a plot and the angle between them, and needs the third side. A pilot knows two angles of a triangle formed with two radio beacons, and one distance. Neither triangle has a right angle, so SOH CAH TOA is no help. These are the jobs of the law of sines and the law of cosines, the two rules that solve any triangle once you know three of its parts (as long as one of them is a side).
The hard part is rarely the formula. It is choosing which law to use, and noticing the one situation where a calculator quietly gives a wrong angle. This guide starts with a decision table, works one example for each case, and then takes a single triangle through all the outcomes of the ambiguous case by changing only one side. If sine and cosine still feel like buttons rather than ideas, the trigonometry guide rebuilds them first.
Notation throughout: angles A, B, C sit opposite sides a, b, c.
Which law to use: start from what you are given
Every solvable triangle problem gives you three parts. Name the pattern, and the law follows:
Given data, law, first unknown to find
| You are given | Pattern | Law to use | Find first |
|---|---|---|---|
| Two angles and a side not between them | AAS | Law of sines | Third angle (180° minus the other two), then the sides |
| Two angles and the side between them | ASA | Law of sines | Third angle, then the sides |
| Two sides and an angle not between them | SSA | Law of sines, with care | The angle opposite the second known side; check for 0, 1 or 2 triangles |
| Two sides and the angle between them | SAS | Law of cosines | The third side |
| All three sides | SSS | Law of cosines | The largest angle (opposite the longest side) |
| Three angles | AAA | Neither | No unique answer: similar triangles of any size fit |
This split follows the OpenStax precalculus text: the law of sines covers ASA, AAS and SSA, and the law of cosines is the tool for the two cases the law of sines cannot handle, SAS and SSS (OpenStax, law of sines; OpenStax, law of cosines).
The reason is easy to see from the formulas. The law of sines compares each side with its opposite angle:
To use it, you need at least one complete pair: a side together with the angle across from it. SAS and SSS never give you a complete pair, so you need a different rule to get started.
The law of cosines: Pythagoras plus a correction
The law of cosines, in its three forms, is
Look at the last one with . Then , the final term vanishes, and you are left with . The law of cosines is the Pythagorean theorem with a correction term for angles that are not right. OpenStax calls the identity it starts from "the Generalized Pythagorean Theorem". The idea is old: Propositions 12 and 13 in Book II of Euclid's Elements prove it for obtuse and acute triangles in purely geometric language, long before cosines existed (Euclid II.12, Clark University edition).
The correction has a clear meaning. When C is acute, is positive, so c comes out shorter than the Pythagorean value. When C is obtuse, is negative, and the minus sign turns the correction into an addition, so c comes out longer. Open the angle and the far side stretches; close it and the side shrinks.
Worked SAS example
Two sides are and , with the angle between them . Find the rest.
Third side. Plug into the form that has the known angle:
so . For comparison, a right angle at A would have given ; the 40° angle cuts that by almost half.
Remaining angles. Now there is a complete pair (a with A), so the law of sines works. Solve for the angle opposite the shorter of the other two sides, which is b:
Then .
Notice that C is obtuse. If you had used the law of sines on C instead, the calculator's arcsine would have returned 86.55°, the acute angle with the same sine, and every later number would have been wrong. Solving for the smaller angle first avoids this: in any triangle, the angle opposite a shorter side is smaller, and at most one angle can be 90° or more, so the angle opposite the shorter side is always acute.
The same data also gives the area directly, using one-half of two sides times the sine of their included angle (the area formula from the OpenStax section on the law of sines): .
SSS: find the largest angle first
Given all three sides, rearrange the law of cosines to isolate the cosine:
Take the triangle with sides 5, 7 and 9. The longest side is 9, so start with the angle opposite it:
The negative cosine tells you at once that C is obtuse. Now the law of sines is safe for the others, because the remaining two angles must be acute:
and . A check with the law of cosines for B gives the same 50.70°.
Do it in the other order and the trap appears. Find A first and then use the law of sines for C: you get , and the arcsine says 84.26°. The true angle is its supplement, 95.74°. Course notes from the University of Houston put the rule plainly: if you have a choice, "it is usually best to find the largest angle first" (UH Math 1330, section 7.3).
The law of sines: AAS and ASA
When you know two angles, the third is free: they add to 180°. After that, the law of sines is a straight proportion.
Say , and . Then , and the common ratio is
Multiply it by each sine: and .
There is nothing ambiguous here, because every angle was found by subtraction, not by an arcsine. ASA works the same way: subtract to get the third angle, then you have a side with its opposite angle and the proportion does the rest.
The ambiguous case (SSA): one triangle, three outcomes
SSA is where students lose marks. OpenStax describes it as the case where SSA data "may result in one or two solutions, or even no solution". The cleanest way to see why is to hold everything fixed except one side.
Fix the angle and the side . Picture side b lying along the ground from vertex C to vertex A, with the 30° angle at A. Side a hangs from C and swings like a gate until it lands on the line leaving A. Whether it lands, and where, depends only on its length.
The key length is the height from C down to that line:
Now change only a. Each row below was computed from and checked to 12 significant digits:
SSA outcomes for A = 30°, b = 10
| Side a | Compared with h = 5 and b = 10 | Triangles | Angle B | Angle C | Side c | |
|---|---|---|---|---|---|---|
| 4 | shorter than h | 1.25 | 0 | none | none | none |
| 5 | equal to h | 1 | 1 | 90° | 60° | 8.66 |
| 8 | between h and b | 0.625 | 2 | 38.68° or 141.32° | 111.32° or 8.68° | 14.91 or 2.42 |
| 12 | at least b | 0.4167 | 1 | 24.62° | 125.38° | 19.57 |
Read it row by row:
- a = 4. The gate is shorter than the height, so it never reaches the ground. The algebra says the same thing: , and no angle has a sine above 1. No triangle.
- a = 5. The gate just touches the ground, straight down. One triangle, with a right angle at B.
- a = 8. The gate is longer than the height but shorter than b, so it touches the ground at two points, one on each side of the foot of the height. Both are real triangles. The arcsine gives 38.68°; the other answer is its supplement, , and since it leaves room for a third angle. You get a wide triangle with c = 14.91 and a thin one with c = 2.42.
- a = 12. The gate is longer than b, so its second landing point would fall behind A, outside the triangle. The supplement 155.38° plus 30° already passes 180°, so it is rejected. One triangle.
These conditions match the four pictures in the OpenStax section: a shorter than the height gives no triangle, a equal to the height gives a right triangle, a between the height and b gives two, and a at least as long as b gives one (for an acute angle A).
The routine to keep: after any SSA arcsine, write down the supplement too and test whether it fits with the given angle. If it does, there are two answers, and the problem usually wants both. If A itself is obtuse, the picture is simpler: a must be longer than b, or there is no triangle at all.
Common mistakes
Using the law of sines on SAS or SSS. Without a complete side and opposite angle pair, the proportion has two unknowns. Start with the law of cosines.
Forgetting the second SSA triangle. The calculator only returns the acute arcsine. Always test its supplement.
Finding an obtuse angle with arcsine. In SAS and SSS, find the largest angle with the law of cosines, or find the smaller angles first with the law of sines.
Calculator in radian mode. in radians is about , not . If a side comes out longer than the sum of the other two, check the mode.
Rounding early. Keep full precision for the side you found before using it in the next step; the answers above were carried at full precision and rounded only at the end.
Practice problems
Try each one before reading the answer.
- SAS. , , . Find a.
- SSS. A triangle has sides 4, 6 and 8. Find its largest angle.
- SSA. , , . How many triangles fit, and what are the possible values of c?
Answers.
- , so .
- The largest angle is opposite 8: , so .
- The height is , and 9 sits between 7.71 and 12, so two triangles. gives or , then or , and or .
Math Zen's trigonometry practice includes the law of sines and cosines next to trig ratios, identities and inverse functions, with fresh numbers on every attempt, so the choice between the two laws becomes automatic. The same cosine reappears in the dot product, which the vectors guide explains as a natural next step.
Frequently asked questions
When do you use the law of sines vs the law of cosines?
Use the law of sines for AAS, ASA and SSA. Use the law of cosines for SAS and SSS, where no side comes with its opposite angle.
Is the law of cosines the same as the Pythagorean theorem?
It is the general version. Set the angle to 90° and the term drops out, leaving .
What is the ambiguous case of the law of sines?
SSA data can describe zero, one or two triangles. Compare side a with the height and with side b to tell which.
Why should I find the largest angle first?
An angle and its supplement have the same sine, so an arcsine cannot tell 84° from 96°. The largest angle is the only one that can be obtuse; find it with the law of cosines and the rest are safe.
Common Questions
- When do you use the law of sines vs the law of cosines?
- Look at what the triangle gives you. Two angles and a side (AAS or ASA), or two sides and an angle that is not between them (SSA): use the law of sines. Two sides and the angle between them (SAS), or all three sides (SSS): use the law of cosines, because the law of sines needs a known side and its opposite angle as a pair, and those two cases do not provide one.
- Is the law of cosines the same as the Pythagorean theorem?
- It is the general version. The law of cosines says c² = a² + b² - 2ab cos C. When C is 90 degrees, cos C is 0, the last term disappears, and what is left is a² + b² = c². Euclid already proved geometric versions of the law for obtuse and acute triangles in Book II of the Elements.
- What is the ambiguous case of the law of sines?
- It is the SSA case: two sides and an angle that is not between them. Those three facts can fit no triangle, exactly one, or two different triangles. Compare the side opposite the known angle with the height h = b sin A: shorter than h gives none, equal to h gives one right triangle, between h and b gives two, and at least b gives one.
- Why should I find the largest angle first?
- Because the sine of an angle and the sine of its supplement are equal, so an arcsine can return 84 degrees when the true angle is 96. Only the largest angle of a triangle can be obtuse. Find it with the law of cosines, where a negative cosine shows the obtuse angle directly, and the remaining angles are guaranteed acute, so the law of sines gives them safely.


