Mathematics

The Law of Cosines

The Law of Cosines is a generalization of the Pythagorean theorem: c² = a² + b² - 2ab·cos(C). It works for every triangle — right or oblique — and is the right choice when you have SAS (two sides and the included angle) or SSS.

How to Approach The Law of Cosines

1

Identify which side or angle is unknown

If you know two sides and the included angle, use the formula directly to find the third side. If you know all three sides, solve for an angle by rearranging.

2

Plug in carefully

c² = a² + b² - 2ab·cos(C). The angle C is opposite side c — make sure the labeling is consistent before substituting.

3

Solve and verify

For a side: take the square root. For an angle: use inverse cosine. Then check the triangle inequality: the sum of any two sides must exceed the third.

Frequently Asked Questions

When do I use Law of Cosines vs Law of Sines?+

Law of Cosines when you have SAS or SSS (two sides + included angle, or all three sides). Law of Sines when you have AAS, ASA, or SSA.

Why is it a generalization of Pythagorean?+

When C = 90°, cos(C) = 0, so the formula reduces to c² = a² + b². The Law of Cosines is the Pythagorean theorem with a correction term for non-right angles.

Is the angle always the one between the two given sides?+

Yes — the angle C in the formula must be opposite side c, and the two known sides (a and b) are adjacent to C. Set up the labeling carefully.

Related Topics

More step-by-step guides in Mathematics and adjacent subjects.

Stuck on a The Law of Cosines problem?

Snap a photo or type the question. ScanSolve walks you through every step — same as the worked examples above. 5 free solves per day, no card required.