The Law of Cosines
Learn the law of cosines step by step with worked examples you can follow. Then practise with 37 instant-feedback questions. Free Geometry lesson from Mr Ahmed Hamouda.
Use the Law of Cosines to find a missing side from SAS, a missing angle from SSS, and to completely solve any right or nonright triangle.
Core Concepts
Why we need a second law
The Law of Sines needs a complete pair — an angle and the side directly across from it. If you are handed two sides and the angle squeezed between them (SAS), or all three sides and no angles at all (SSS), you never get such a pair, so the Law of Sines is useless. When the Law of Sines cannot be used to solve a triangle, the Law of Cosines may apply.
You can use the Law of Cosines to find the length of the third side of a triangle when the measures of two sides and the included angle are known, or to find the angle measures of a triangle if the lengths of all three sides are known.
b2 = a2 + c2 − 2ac·cos B
c2 = a2 + b2 − 2ab·cos C
The same law, rearranged to hunt for angles
Solve a2 = b2 + c2 − 2bc cos A for cos A and you get the angle form. This is the version you use for SSS.
Notice the numerator: the squared side that stands alone is the one being subtracted, and it is the side opposite the angle you want.
Which law do I reach for?
Method — SAS: find the missing side
c2 = a2 + b2 − 2ab cos C.c2 = (a2+b2) − (2ab) cos C.Method — SSS: find a missing angle
cos−1 and round.cos 90° = 0, the term −2ab cos C vanishes and c2 = a2 + b2.cos A < 0 ⇔ A is obtuse. So if a2 > b2 + c2, angle A is obtuse; if they are equal, A is right.sin−1 on a calculator only ever returns an acute value. If the angle you are chasing is actually obtuse, the calculator hands you its supplement. cos−1 has no such flaw — it returns values from 0° to 180° and gets obtuse angles right automatically. That is why the Law of Cosines is the safe tool for the largest angle.Key Figures
h2 = b2 − x2 and a2 = h2 + (c − x)2. Substituting and expanding: a2 = b2 − x2 + c2 − 2cx + x2 = b2 + c2 − 2cx. Since cos A = x/b, we get x = b cos A and therefore a2 = b2 + c2 − 2bc cos A. Drawn to scale: b = 170, c = 300, x = 80, h = 150, a ≈ 266.3.Move It Yourself
Worked Examples
We are given the measures of two sides and their included angle. Use the Law of Cosines to write an equation. The unknown side is opposite ∠C, so it plays the role of c.
2(0.9)(2.9) cos 44° is one product. Do not compute (9.22 − 5.22) first and then multiply by cos 44°. Multiplication comes before subtraction.Because we know the measures of two sides of the triangle (378 and 261.5) and the included angle (32°), use the Law of Cosines to find the remaining distance x.
Because 72 + 82 ≠ 112 (49 + 64 = 113, not 121), this is not a right triangle. All three sides are given (SSS), so decide which angle you want first, then use the Law of Cosines. Here a = 7, b = 11, c = 8.
Find FG. With a right angle available, the Pythagorean Theorem is fastest.
Find m∠F with the Law of Cosines. Side f = GH = 2 is opposite ∠F.
Try It Yourself
Problem 1 · SAS
Problem 2 · SSS, recognising a right angle
Problem 3 · SSS
Problem 4 · SAS to the nearest tenth
Problem 5 · Solve the whole triangle
Summary
| What you are given | What to do | Result |
|---|---|---|
| SAS — two sides and the included angle | a² = b² + c² − 2bc cos A, then positive square root | The third side |
| SSS — three sides | cos A = (b²+c²−a²)/(2bc), then cos−1 | Any angle you choose |
| SSS — solve the whole triangle | Law of Cosines for the largest angle first, then Law of Cosines or Law of Sines, then Angle-Sum | All three angles |
| ASA / AAS / SSA | Law of Sines — a complete angle–side pair already exists | Remaining parts |
| Right triangle | sin, cos, tan or Pythagorean Theorem (either law also works) | Remaining parts |
Result cos A = 0 | Recognise a² = b² + c² | A = 90°, right triangle |
Result cos A < 0 | Nothing special — cos−1 handles it | A is obtuse (90° < A < 180°) |
- Pairing the wrong angle with the lone side. The angle in the cosine is always opposite the side by itself.
- Subtracting before multiplying:
9.22 − 5.22 cos 44°means9.22 − (5.22 · cos 44°). - Forgetting that
−2ab cos Cadds when C is obtuse, because cos C is then negative. - Dropping the square root at the end of an SAS problem — you solved for
a², nota. - Using the Law of Sines to find a large angle after an SSS start;
sin−1only returns acute values. - Rounding intermediate values and then continuing to calculate.
- Reaching for the Law of Cosines when a complete angle–side pair already exists — the Law of Sines is far less work.
- Calculator in radian mode. Every angle here is in degrees.
Practice Quiz
15 questions · click an answer to check it instantly