Cosine Rule

Advanced

Learn one universal formula that works for any triangle, not just right-angled. I'll teach you step by step.

For:Secondary 3 Mathematics · Unit:Trigonometry · Lesson 23 of 37 in the learning path

After this lesson, you can:
  • Works for any triangle, no need right angle
  • c² = a² + b² − 2ab cos C
  • SAS find side, SSS find angle
數學Mathematics
Before this lesson you should know: Sine Rule

1Summary 重點摘要

Learn one universal formula that works for any triangle, not just right-angled. I'll teach you step by step.

2Vocabulary cards Vocabulary

C
Cosine rule餘弦定理

Formula that works for any triangle, used to find sides or angles.

S
Side aa 邊

Side opposite angle A, always the side opposite angle A.

S
Side bb 邊

Side opposite angle B.

S
Side cc 邊

Side opposite angle C.

I
Included angle夾角

Angle between two sides, i.e. the angle the two sides sandwich.

S
SAS

Side-Angle-Side, i.e. know two sides and included angle.

S
SSS

Side-Side-Side, i.e. know all three side lengths.

P
Pythagoras畢氏定理

a²+b²=c², only works for right triangles.

3Step by step Steps

  1. Why the cosine rule is neededThe ratios sin, cos and tan work only inside right-angled triangles, where a 90° angle exists. Yet most real triangles are not right-angled — a triangular field may have no right angle at all, and the same holds for triangles met at sea or in land surveying. The cosine rule applies to any triangle, with no right angle required, filling exactly this gap. It is Pythagoras' theorem upgraded for general use: with it, every triangle's angles and sides become computable.
  2. The formula and how to remember itThe cosine rule states c² = a² + b² − 2ab cos C, where c is the wanted side, a and b the other two, and C the angle between a and b. To remember: the square of the wanted side equals the sum of the squares of the other two sides, minus twice their product times the cosine of the included angle. The minus sign in the middle and the 2ab factor are the usual traps; write the formula out three times from memory, and note that 'included angle' means the angle between the two known sides — using the opposite angle instead invalidates the formula entirely.
  3. Case one: two sides and the included angle (SAS)Given two sides and the angle between them (SAS), the rule yields the third side directly. With a = 3, b = 4 and included angle C = 60°, substitute to get c² = 3² + 4² − 2 × 3 × 4 × cos 60°, leaving a single unknown c to compute. If the given angle is not the included one, the formula does not apply directly and senior methods such as the sine rule are needed; at junior level, questions normally supply the included angle, so substitution goes straight through.
  4. Case two: three sides, find an angle (SSS)When all three sides are known (SSS) and an angle is wanted, rearrange the formula to cos C = (a² + b² − c²) ÷ (2ab). With sides 3, 4, 5 and the largest angle C facing the side of length 5: cos C = (9 + 16 − 25) ÷ 24 = 0, so C = 90° — confirming that 3-4-5 is a right-angled triangle. In the numerator, the square of the side facing the wanted angle is subtracted from the sum of the other two squares; for a different angle, swap the sides accordingly.
  5. A full worked calculationExample: a = 3, b = 4, included angle C = 60°, find c. First write the formula c² = a² + b² − 2ab cos C; second, substitute the values, c² = 9 + 16 − 2 × 3 × 4 × cos 60°; third, with cos 60° = 0.5, c² = 25 − 24 × 0.5 = 25 − 12 = 13; fourth, take the root, c = √13 ≈ 3.6. Note the order — square before you take the root — and keep extra digits through the working, rounding to two decimal places only at the end, to limit accumulated error.
  6. The link with PythagorasPythagoras' theorem is a special case of the cosine rule: when C = 90°, cos 90° = 0 and the formula collapses to c² = a² + b² − 0 = a² + b², exactly Pythagoras. The rule is thus more general: in an obtuse triangle cos C is negative, making c² larger than a² + b², which matches the fact that the longest side faces the largest angle. A useful check: your computed longest side must face the largest angle; any mismatch signals a slip in the working and calls for a re-check.

4Diagrams Diagrams

餘弦定理:兩邊夾角或三邊 The cosine ruleCabcc² = a² + b² − 2ab cos C畢氏定理加料版:夾角 90° 時 cos 90°=0,就變返畢氏定理幾時用:① 兩邊+夾角(SAS)求第三邊 ② 知三邊求角(反轉用)記法:c² 開頭——求邊 c 就用對面角 C;三角形任何一角都套得
Fig. 1: The cosine rule

5Worked example Example

Example: a triangle has sides 5 and 6 with included angle 60°; find the third side.

  1. Identify the case: two sides with the included angle is SAS, so use the cosine rule.
  2. Write the formula: c² = a² + b² − 2ab cos C.
  3. Substitute: c² = 5² + 6² − 2 × 5 × 6 × cos 60°.
  4. Compute: cos 60° = 0.5, so c² = 25 + 36 − 60 × 0.5 = 61 − 30 = 31.
  5. Take the root: c = √31 ≈ 5.57.
  6. Check: 5.57 sits naturally against the two given sides and faces the 60° angle — reasonable.
  7. Answer: The third side is about 5.57 — substitute both sides and the included angle into c² = a² + b² − 2ab cos C, square-root at the end, and sanity-check that the longest side faces the largest angle.

6Common mistakes Mistakes

✗ Only works for right triangles
✓ Wrong! Cosine rule works for any triangle! No need right angle!
✗ Forgetting −2ab cos C
✓ Formula is c² = a² + b² − 2ab cos C! Don't forget the −2ab cos C part!
✗ Using wrong angle
✓ Angle C must be opposite side c! Don't pick random angle!
✗ Forgetting to square root
✓ Formula gives c², remember to square root to get c! Don't give c² as answer!

7Quick check Quick check

Q1Cosine rule formula?

Q2Know two sides and included angle find third side, use?

Q3cos90° = ?

Q4Pythagoras is cosine rule's?

Q5Know all three sides find angle, use?

8Recap Recap

  • Works for any triangle, no need right angle
  • c² = a² + b² − 2ab cos C
  • SAS find side, SSS find angle
  • Pythagoras is its special case
  • Remember to square root after calculating

Other subjects in this grade

Same subject, other grades