trigidentity.com

Sum and difference identities · trigonometric identity

cos(A − B) = cos A cos B + sin A sin B — Cosine of a difference

cos(A − B) = cos A cos B + sin A sin B

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.

  1. P = (cos A, sin A), Q = (cos B, sin B)
    Two points on the unit circle.
  2. 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
  3. PQ² = 2 − 2 cos(A − B)
    Central angle A − B, chord length.
  4. cos(A − B) = cos A cos B + sin A sin B
    Equate 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.

Both sides evaluated at the same angles — left side cos(A - B), right side cos(A)cos(B) + sin(A)sin(B).
AngleLeft sideRight sideAgree
0°0.9876880.987688yes
7.5°0.9958050.995805yes
15°0.9996570.999657yes
18°11yes
22.5°0.9992290.999229yes
30°0.9945220.994522yes
37°0.9862860.986286yes
45°0.972370.97237yes
53°0.9537170.953717yes
60°0.933580.93358yes
67.5°0.9081430.908143yes
75°0.8788170.878817yes
90°0.8090170.809017yes
120°0.629320.62932yes
135°0.5224990.522499yes
150°0.4067370.406737yes
180°0.1564340.156434yes
210°-0.104528-0.104528yes
240°-0.358368-0.358368yes
270°-0.587785-0.587785yes
300°-0.777146-0.777146yes
330°-0.913545-0.913545yes
360°-0.987688-0.987688yes

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

Category hub: Sum and difference identities · all identities: /identities

sampled at 800 random anglesSource: OpenStax Precalculus, Ch. 7.2–7.3 · Paul's Online Math Notes · revised 2026-09-26 ·how we check ·accuracy policy ·report an error