Math Solver Free

Trigonometry

Law of Sines and Cosines: Formulas, Decision Guide and Examples

Math Solver Free Team

A general triangle labelled with sides a, b, c and opposite angles A, B, C for the law of sines and cosines

For triangles without a right angle, two laws replace SOHCAHTOA. The law of sines says a ÷ sin A = b ÷ sin B = c ÷ sin C: each side is proportional to the sine of its opposite angle. The law of cosines says a² = b² + c² − 2bc cos A: a squared side equals the other two squared, minus twice their product times the cosine of the included angle. The decision rule is just as short: ASA, AAS or SSA → law of sines; SAS or SSS → law of cosines. Both laws, both worked examples and the ambiguous case are below — verify every step in our trigonometry calculator.

The two laws, stated precisely

Use the standard labelling throughout: side a is opposite angle A, side b opposite angle B, side c opposite angle C.

  • Law of sines: a / sin A = b / sin B = c / sin C. In words, in any triangle the sides stand in the same ratio as the sines of the angles facing them.
  • Law of cosines: a² = b² + c² − 2bc cos A; b² = a² + c² − 2ac cos B; c² = a² + b² − 2ab cos C. In words, it is Pythagoras with a correction term: when A = 90°, cos A = 0 and the formula collapses to a² = b² + c² exactly.

That is the honest way to remember the law of cosines: Pythagoras generalised to triangles that lean. An acute included angle makes cos positive, so the correction subtracts and the opposite side comes out shorter than Pythagoras would suggest; an obtuse angle makes cos negative, the correction adds, and the side comes out longer. Derivations of both laws appear in OpenStax Algebra and Trigonometry 2e.

Which law when: the decision guide

Every general-triangle problem announces its type by what it gives you. Match the givens to the law:

  • ASA or AAS (two angles and any side): the third angle comes from the 180° sum, then the law of sines finds each remaining side in one proportion each.
  • SSA (two sides and a non-included angle): the law of sines — but beware the ambiguous case below; there may be two triangles, one, or none.
  • SAS (two sides and the included angle): the law of cosines finds the third side; then switch to the law of sines (or cosines again) for the remaining angles.
  • SSS (all three sides): the law of cosines, rearranged as cos A = (b² + c² − a²) ÷ (2bc), finds any angle. Find the largest angle first — it is the only one that could be obtuse, and cosine, unlike sine, tells acute from obtuse unambiguously.

A useful instinct: the law of sines needs a complete side–angle pair to anchor its proportion. If no such pair exists in the givens, sines cannot even start, and cosines is the way in; if a pair exists, sines is usually the shorter path.

Worked example 1 (ASA): law of sines

Problem: In triangle ABC, A = 40°, B = 75° and a = 6. Find C, b and c.

  1. Third angle: C = 180° − 40° − 75° = 65°.
  2. Anchor the ratio with the known pair a and A: 6 ÷ sin 40° ≈ 6 ÷ 0.6428 ≈ 9.334.
  3. Side b: b = 6 × sin 75° ÷ sin 40° = 6 × 0.9659 ÷ 0.6428 ≈ 9.02.
  4. Side c: c = 6 × sin 65° ÷ sin 40° = 6 × 0.9063 ÷ 0.6428 ≈ 8.46.
  5. Sanity check: the largest angle (B = 75°) faces the largest side (b ≈ 9.02), the smallest angle (A = 40°) faces the smallest side (a = 6), and c falls between — the ordering matches, so the proportions were set up correctly.

Each unknown side took exactly one proportion — the rhythm of ASA/AAS problems: angle sum first, then one law-of-sines line per side. Build and check triangles like this in the triangle calculator.

Worked example 2 (SAS): law of cosines, an exact answer

Problem: In triangle ABC, b = 8, c = 5 and the included angle A = 60°. Find a.

  1. Write the law of cosines for the side opposite A: a² = b² + c² − 2bc cos A.
  2. Substitute: a² = 8² + 5² − 2 × 8 × 5 × cos 60° = 64 + 25 − 80 × 0.5.
  3. Compute: a² = 89 − 40 = 49, so a = √49 = 7 exactly.

The clean answer is no accident: cos 60° = 1/2 (from the unit circle table) made the correction term exactly 40. With a known, the remaining angles follow from the law of sines — sin B = 8 × sin 60° ÷ 7 ≈ 0.9897, giving B ≈ 81.79° and C ≈ 38.21°. When an SAS or SSS problem is built from unit-circle angles, expect near-exact arithmetic and treat a messy decimal as a warning sign.

The ambiguous case (SSA), explained honestly

SSA is the one configuration that can fail to pin down a single triangle. You are given a side, its opposite angle, and another side — say A = 30°, a = 6, b = 10. The law of sines gives sin B = b × sin A ÷ a = 10 × 0.5 ÷ 6 ≈ 0.8333, and here is the catch: sine cannot distinguish an angle from its supplement, because sin B = sin(180° − B). So B ≈ 56.44° and B ≈ 180° − 56.44° = 123.56° both satisfy the equation — and both fit with A = 30° (30 + 123.56 = 153.56 < 180), so two different triangles genuinely exist. Geometrically, side a is long enough to reach the base line in two positions, like a door swinging to two resting places.

The full SSA picture, for acute A and sides a and b: if a < b sin A, the side is too short to reach and no triangle exists (the law of sines reports sin B > 1 — your signal); if a = b sin A, exactly one right triangle exists; if b sin A < a < b, two triangles exist; if a ≥ b, only the acute solution survives, so one triangle. The honest habit: in every SSA problem, compute the supplement candidate and test whether A plus it stays under 180° — never silently discard it. (For obtuse A it simplifies: a must exceed b, and then exactly one triangle exists.)

Common mistakes

  • Using the law of sines for SAS. With two sides and the included angle there is no complete side–angle pair, so the sine proportion has no anchor. SAS always starts with the law of cosines.
  • Forgetting the ambiguous second solution. In SSA, sin⁻¹ returns only the acute candidate. The supplement 180° − B is a second possible angle until the angle-sum test kills it.
  • Calculator in radian mode. sin 40 (radians) ≈ 0.7451, not sin 40° ≈ 0.6428 — every proportion downstream is then wrong while looking plausible. Check DEG before starting.
  • Mismatching sides and angles in the law of cosines. The angle in −2bc cos A must be the angle between sides b and c, and the squared side on the left is the one opposite it. A quick label check against the diagram prevents the swap.
  • Losing the sign of cos for obtuse angles. cos 120° = −1/2, so −2bc cos A becomes a plus. Dropping that sign shrinks a side that should grow.
  • Rounding mid-proportion. Carry at least four decimals through the shared ratio a ÷ sin A; rounding it early corrupts every side computed from it.

Putting the laws to work

The workflow for any general triangle: name the configuration (ASA, AAS, SSA, SAS, SSS), pick the law from the decision guide, solve, then run the two cheap checks — angles sum to 180°, and larger angles face larger sides. Verify your arithmetic with the trigonometry calculator and the triangle calculator. The neighbouring guides complete the toolkit: SOHCAHTOA covers the right-triangle case these laws generalise, and the unit circle supplies the exact sine and cosine values that make so many of these problems come out clean.

Frequently asked questions

When do I use the law of sines vs the law of cosines?

Use the law of sines when you have a complete side–angle pair: ASA, AAS and SSA problems. Use the law of cosines when you do not: SAS (to find the third side) and SSS (to find angles). Many solutions use cosines first, then sines for the remaining angles.

What is the ambiguous case?

In SSA, the given data can describe two different triangles, because sin B = sin(180° − B): both B and its supplement can satisfy the law of sines. Test the supplement against the 180° angle sum — if it fits, both triangles are real answers.

Is the law of cosines just Pythagoras?

It is Pythagoras generalised. a² = b² + c² − 2bc cos A reduces to a² = b² + c² when A = 90°, because cos 90° = 0. For acute A the correction subtracts; for obtuse A, cos is negative and the correction adds.

Can the law of sines give an impossible answer?

Yes, and it is useful information: if the proportion forces sin B > 1, no such triangle exists — in SSA the given side is too short to reach. Treat sin > 1 as the geometry saying no, not as a calculator error.

Why find the largest angle first in SSS?

Because only the largest angle can be obtuse, and the law of cosines identifies obtuse angles correctly (cos negative) while sin⁻¹ cannot tell an angle from its supplement. Once the largest angle is fixed, the rest are safely acute and the law of sines finishes the job.

About the Math Solver Team

The Math Solver Team builds and maintains the calculators and step-by-step solvers on this site. Every tool is checked against worked textbook examples before it is published, and the method behind each solver is written out in full — in the worked examples on the page and in our guides — so you can see exactly how an answer is reached, not just the answer itself.

How we build and test our tools·More about the team