Sum and difference identities · trigonometric identity
cos(A − B) = cos A cos B + sin A sin B — Cosine of a difference
When to use it
The minus-inside case for cosine — and the origin of the law of cosines when you expand c² = |A − B|² with this formula.
Why it is true
Replace B by −B in the cosine sum formula: cosine is even, sine is odd, so the minus in the middle becomes a plus.
The full line-by-line version is on the proof page for cosine of a difference; the “how would I find this myself” version is in the derivation.
Where it comes from
Distance between two points on the circle. Put two unit-circle points at angles A and B and compute the squared distance between them twice — once with the distance formula, once with the angle difference.
- P = (cos A, sin A), Q = (cos B, sin B)Two points on the unit circle.
- PQ² = (cos A − cos B)² + (sin A − sin B)² = 2 − 2(cos A cos B + sin A sin B)Expand; sin² + cos² = 1 twice. · Pythagorean identity
- PQ² = 2 − 2 cos(A − B)Central angle A − B, chord length.
- cos(A − B) = cos A cos B + sin A sin BEquate the two expressions.
Worked examples
Checked at these angles
Two sides of the identity evaluated with the same engine that runs the verifier. A single line disagreeing would break the build.
| Angle | Left side | Right side | Agree |
|---|---|---|---|
| 0° | 0.987688 | 0.987688 | yes |
| 7.5° | 0.995805 | 0.995805 | yes |
| 15° | 0.999657 | 0.999657 | yes |
| 18° | 1 | 1 | yes |
| 22.5° | 0.999229 | 0.999229 | yes |
| 30° | 0.994522 | 0.994522 | yes |
| 37° | 0.986286 | 0.986286 | yes |
| 45° | 0.97237 | 0.97237 | yes |
| 53° | 0.953717 | 0.953717 | yes |
| 60° | 0.93358 | 0.93358 | yes |
| 67.5° | 0.908143 | 0.908143 | yes |
| 75° | 0.878817 | 0.878817 | yes |
| 90° | 0.809017 | 0.809017 | yes |
| 120° | 0.62932 | 0.62932 | yes |
| 135° | 0.522499 | 0.522499 | yes |
| 150° | 0.406737 | 0.406737 | yes |
| 180° | 0.156434 | 0.156434 | yes |
| 210° | -0.104528 | -0.104528 | yes |
| 240° | -0.358368 | -0.358368 | yes |
| 270° | -0.587785 | -0.587785 | yes |
| 300° | -0.777146 | -0.777146 | yes |
| 330° | -0.913545 | -0.913545 | yes |
| 360° | -0.987688 | -0.987688 | yes |
The mistake students make
Assuming cosine behaves like sine and keeps the sign. Inside the parentheses the sign flips in the middle term: cos(A − B) has '+'.
Try it
- Verify this identity — both sides are pre-filled; change one character and watch the counterexample appear.
- Ask “which identity should I use?” about the left-hand side — this identity is what the chooser should rank first.
- Cheat sheet entry for sum and difference identities.
Related identities
- cos(A + B) = cos A cos B − sin A sin BCosine of a sumdetailsproof
- sin(A − B) = sin A cos B − cos A sin BSine of a differencedetailsproof
- cos A cos B = ½[cos(A − B) + cos(A + B)]Product to sum: cos A cos Bdetailsproof
Category hub: Sum and difference identities · all identities: /identities