Precalculus · F.TF.C.9

Cosine of a sum or difference

The exact cosines of 60^\circ and 45^\circ are known. Is that enough to find the exact cosine of 105^\circ, and if so, how do the pieces combine?

Where you are 13 in Trigonometric identities

Why this exists

The unit circle gives exact sines and cosines at a handful of angles: the multiples of 30^\circ and 45^\circ, or of \displaystyle \frac{\pi}{6} and \displaystyle \frac{\pi}{4}. An angle such as 105^\circ is not on that list, but it is 60^\circ + 45^\circ, and both of those are. What is missing is a rule for the cosine of a sum.

The first guess, that the cosine of a sum is the sum of the cosines, is false. Take a = b = 60^\circ:

\begin{aligned} \cos(60^\circ + 60^\circ) &= \cos 120^\circ = -\frac{1}{2} \\ \cos 60^\circ + \cos 60^\circ &= 1 \end{aligned}

Cosine is not multiplication by a number, so it does not distribute over a sum. The true rule needs the sines of both angles as well as the cosines, and it comes straight out of the distance formula on the unit circle.

Definition

For all real numbers a and b (or angles in degrees), the difference formula for cosine and the sum formula for cosine are the identities

\begin{aligned} \cos(a - b) &= \cos a\cos b + \sin a\sin b \\ \cos(a + b) &= \cos a\cos b - \sin a\sin b \end{aligned}

They are identities in the sense of What an identity is: true for every pair a, b, with nothing excluded. Read in words, the cosine of a difference is “cosine cosine plus sine sine”, and the cosine of a sum has the same two products with a minus sign between them. Together they are often called the sum and difference formulas for cosine.

Intuition

P Q
a - b
P \text{ at } a, \; Q \text{ at } b
A B
a - b
A \text{ at } a - b, \; B = (1, 0)
Figure 1Turning the circle by -b carries Q to B = (1, 0) and P to A, the terminal point of a - b. Turning keeps distances, so chord PQ and chord AB have the same length.

Mark two points on the unit circle, P at angle a and Q at angle b. How far apart they are depends only on how far apart the angles are, a - b, and not on where the pair sits. Spin the whole circle and the chord PQ moves with it at the same length.

So spin it until Q lands on (1, 0). The chord now runs from (1, 0) to the terminal point of the single angle a - b, whose coordinates are \cos(a - b) and \sin(a - b). Measuring the same chord twice, once from the original points and once from the turned ones, gives one equation, and that equation is the difference formula.

Results

Difference formula. For all real a and b,

\cos(a - b) = \cos a\cos b + \sin a\sin b

Sum formula. For all real a and b,

\cos(a + b) = \cos a\cos b - \sin a\sin b

Chord length. Points of the unit circle at angles a and b are a distance \displaystyle \sqrt{2 - 2\cos(a - b)} apart.

Cofunctions again. With \displaystyle a = \frac{\pi}{2} the difference formula gives \displaystyle \cos\left(\frac{\pi}{2} - t\right) = \sin t, a second proof of the Cofunction identities.

Why it is true

The difference formula. Let P = (\cos a, \sin a) and Q = (\cos b, \sin b). By the distance formula,

\begin{aligned} PQ^2 &= (\cos a - \cos b)^2 \\ &\quad + (\sin a - \sin b)^2 \\ &= (\cos^2 a + \sin^2 a) \\ &\quad + (\cos^2 b + \sin^2 b) \\ &\quad - 2(\cos a\cos b + \sin a\sin b) \\ &= 2 - 2(\cos a\cos b + \sin a\sin b) \end{aligned}

The second line only regroups the six terms of the two expanded squares (commutative and associative properties), and the third uses \cos^2\theta + \sin^2\theta = 1 from The Pythagorean identities twice.

Now turn the whole circle about its center through -b, clockwise by b. A turn changes no distance and adds -b to every angle, so Q goes to B = (1, 0) at angle 0, and P goes to A = (\cos(a - b), \sin(a - b)) at angle a - b. Then

\begin{aligned} AB^2 &= (\cos(a - b) - 1)^2 + \sin^2(a - b) \\ &= \cos^2(a - b) + \sin^2(a - b) \\ &\quad - 2\cos(a - b) + 1 \\ &= 2 - 2\cos(a - b) \end{aligned}

Since AB = PQ, the two right sides are equal:

2 - 2\cos(a - b) = 2 - 2(\cos a\cos b + \sin a\sin b)

Subtract 2 and divide by -2. Nothing assumed a > b, or that either angle is acute, or that the angles are less than a full turn: adding -b to every angle is a turn for every real b.

The sum formula. Write a + b as a - (-b) and use the difference formula, then the even and odd identities \cos(-b) = \cos b and \sin(-b) = -\sin b from Unit circle symmetry and even-odd identities:

\begin{aligned} \cos(a + b) &= \cos a\cos(-b) + \sin a\sin(-b) \\ &= \cos a\cos b - \sin a\sin b \end{aligned}

A second proof of the cofunction identities. Put \displaystyle a = \frac{\pi}{2}, b = t:

\begin{aligned} \cos\left(\tfrac{\pi}{2} - t\right) &= \cos\tfrac{\pi}{2}\cos t + \sin\tfrac{\pi}{2}\sin t \\ &= 0 + \sin t = \sin t \end{aligned}

This holds for every real t, so it holds for \displaystyle u = \frac{\pi}{2} - t: \displaystyle \cos\left(\frac{\pi}{2} - u\right) = \sin u, and since \displaystyle \frac{\pi}{2} - u = t, that reads \displaystyle \cos t = \sin\left(\frac{\pi}{2} - t\right). No reflection and no figure were needed.

Worked examples

Example 1

An exact value in degrees

Find the exact value of \cos 105^\circ.

Solution

Split 105^\circ into two angles with known values: 105^\circ = 60^\circ + 45^\circ. The sum formula gives

\begin{aligned} \cos 105^\circ &= \cos 60^\circ\cos 45^\circ - \sin 60^\circ\sin 45^\circ \\ &= \frac{1}{2}\cdot\frac{\sqrt{2}}{2} - \frac{\sqrt{3}}{2}\cdot\frac{\sqrt{2}}{2} \\ &= \frac{\sqrt{2} - \sqrt{6}}{4} \end{aligned}

Check. \displaystyle \frac{\sqrt{2} - \sqrt{6}}{4} \approx -0.2588, negative as it must be for an angle in Quadrant II, and a calculator gives the same. The wrong rule would have given \cos 60^\circ + \cos 45^\circ \approx 1.207, more than 1, which no cosine can be.

Example 2

An exact value in radians, two ways

Find the exact value of \displaystyle \cos\frac{19\pi}{12}.

Solution

Over the denominator 12, the special angles are \displaystyle \frac{\pi}{6} = \frac{2\pi}{12}, \displaystyle \frac{\pi}{4} = \frac{3\pi}{12}, \displaystyle \frac{\pi}{3} = \frac{4\pi}{12} and their multiples. One split is \displaystyle \frac{19\pi}{12} = \frac{16\pi}{12} + \frac{3\pi}{12} = \frac{4\pi}{3} + \frac{\pi}{4}. With \displaystyle \cos\frac{4\pi}{3} = -\frac{1}{2} and \displaystyle \sin\frac{4\pi}{3} = -\frac{\sqrt{3}}{2},

\begin{aligned} \cos\tfrac{19\pi}{12} &= \left(-\tfrac{1}{2}\right)\tfrac{\sqrt{2}}{2} - \left(-\tfrac{\sqrt{3}}{2}\right)\tfrac{\sqrt{2}}{2} \\ &= \frac{\sqrt{6} - \sqrt{2}}{4} \end{aligned}

A difference works too: \displaystyle \frac{19\pi}{12} = \frac{21\pi}{12} - \frac{2\pi}{12} = \frac{7\pi}{4} - \frac{\pi}{6}. With \displaystyle \cos\frac{7\pi}{4} = \frac{\sqrt{2}}{2} and \displaystyle \sin\frac{7\pi}{4} = -\frac{\sqrt{2}}{2}, the difference formula gives

\begin{aligned} &\cos\tfrac{7\pi}{4}\cos\tfrac{\pi}{6} + \sin\tfrac{7\pi}{4}\sin\tfrac{\pi}{6} \\ &= \frac{\sqrt{6}}{4} - \frac{\sqrt{2}}{4} \end{aligned}

the same number, as an identity guarantees. It is about 0.2588, positive, and \displaystyle \frac{19\pi}{12} is in Quadrant IV, where cosine is positive.

Example 3

Kritika’s two angles

Kritika knows only that \displaystyle \cos a = -\frac{8}{17} with a in Quadrant II, and \displaystyle \sin b = -\frac{20}{29} with b in Quadrant IV. Find \cos(a - b) and \cos(a + b).

Solution

Each formula needs all four of \cos a, \sin a, \cos b, \sin b. The Pythagorean identity gives each missing value up to sign, and the quadrant picks the sign. In Quadrant II sine is positive:

\sin a = \sqrt{1 - \tfrac{64}{289}} = \sqrt{\tfrac{225}{289}} = \frac{15}{17}

In Quadrant IV cosine is positive:

\cos b = \sqrt{1 - \tfrac{400}{841}} = \sqrt{\tfrac{441}{841}} = \frac{21}{29}

The two products are \displaystyle \cos a\cos b = -\frac{168}{493} and \displaystyle \sin a\sin b = -\frac{300}{493}, since 17 \cdot 29 = 493. So

\begin{aligned} \cos(a - b) &= -\tfrac{168}{493} - \tfrac{300}{493} = -\frac{468}{493} \\ \cos(a + b) &= -\tfrac{168}{493} + \tfrac{300}{493} = \frac{132}{493} \end{aligned}

Kritika never finds a or b themselves. Both answers lie between -1 and 1, as cosines must.

Example 4

Reading the formula backward

Write each as a single cosine and simplify: (a) \cos 80^\circ\cos 20^\circ + \sin 80^\circ\sin 20^\circ; (b) \cos 6x\cos 2x - \sin 6x\sin 2x.

Solution

(a) “Cosine cosine plus sine sine” is the right side of the difference formula with a = 80^\circ, b = 20^\circ, so it equals \displaystyle \cos(80^\circ - 20^\circ) = \cos 60^\circ = \frac{1}{2}.

(b) A minus sign between the products is the sum formula with a = 6x, b = 2x, so it equals \cos(6x + 2x) = \cos 8x, for every real x.

Example 5

An identity with both formulas

Show that \cos(a + b)\cos(a - b) = \cos^2 a - \sin^2 b for all a and b.

Solution

Expand both factors. They have the form (p - q)(p + q) with p = \cos a\cos b and q = \sin a\sin b, a difference of squares:

\begin{aligned} &\cos(a + b)\cos(a - b) \\ &= \cos^2 a\cos^2 b - \sin^2 a\sin^2 b \end{aligned}

The target has no \cos^2 b, so replace it by 1 - \sin^2 b (the Pythagorean identity):

\begin{aligned} &\cos^2 a(1 - \sin^2 b) - \sin^2 a\sin^2 b \\ &= \cos^2 a - \sin^2 b(\cos^2 a + \sin^2 a) \\ &= \cos^2 a - \sin^2 b \end{aligned}

The middle step factors -\sin^2 b out of two terms (the distributive property). Check at \displaystyle a = \frac{\pi}{3}, \displaystyle b = \frac{\pi}{6}: the left side is \displaystyle \cos\frac{\pi}{2}\cos\frac{\pi}{6} = 0 and the right side is \displaystyle \frac{1}{4} - \frac{1}{4} = 0.

Example 6

Old symmetries from the new formula

Mihir uses the formulas to recheck facts from Unit circle symmetry and even-odd identities. Simplify \cos(\pi - x) and \cos(x + 2\pi).

Solution

With \cos\pi = -1 and \sin\pi = 0, the difference formula gives

\cos(\pi - x) = (-1)\cos x + 0\cdot\sin x = -\cos x

the reflection across the y-axis. With \cos 2\pi = 1 and \sin 2\pi = 0, the sum formula gives

\cos(x + 2\pi) = \cos x\cdot 1 - \sin x\cdot 0 = \cos x

which is periodicity. Every shift by a multiple of \displaystyle \frac{\pi}{2} works the same way, because the sine and cosine of the shift are each 0, 1 or -1 (Exact values on the unit circle).

Boundaries

  • The formulas hold for every pair of real numbers, in radians or in degrees, provided a, b and a \pm b are in the same unit.
  • Cosine does not distribute: \cos(a + b) = \cos a + \cos b is false in general, and so is \cos 2a = 2\cos a. Exercise 23 shows they can agree at a few particular values, which does not make them identities.
  • An exact answer needs angles whose exact sines and cosines are known. 105^\circ = 100^\circ + 5^\circ is true, and the formula still holds, but it gives nothing exact.
  • From one value such as \displaystyle \cos a = -\frac{8}{17} alone, \sin a could be \displaystyle \frac{15}{17} or \displaystyle -\frac{15}{17}, and \cos(a - b) takes a different value for each. The quadrant is part of the data.

Where this goes next

Sine and tangent of a sum or difference turns these into the sine and tangent formulas, through the cofunction identities. Setting b = a in the sum formula gives \cos 2a = \cos^2 a - \sin^2 a, the start of the double angle formulas and of the Power reducing and half angle formulas. Adding and subtracting the two formulas, as in Exercises 15 and 16, gives the Product to sum and sum to product formulas. Expanding \cos(t - c) shows that a shifted cosine wave is a mix of \cos t and \sin t, which run backward is Combining a sine and a cosine into one wave. The chord length \displaystyle \sqrt{2 - 2\cos(a - b)} is the law of cosines for a triangle with two sides of length 1. Later the sum formulas are why angles add when complex numbers multiply (Multiplying, powers and De Moivre's theorem).

Exercises

Exact values

  1. Find the exact value of \cos 165^\circ.
  2. Find the exact value of \cos 345^\circ.
  3. Find the exact value of \displaystyle \cos\frac{13\pi}{12}.
  4. Find the exact value of \displaystyle \cos\left(-\frac{5\pi}{12}\right), using a difference.
  5. Compute \cos(90^\circ + 30^\circ) with the sum formula, and compare it with \cos 90^\circ + \cos 30^\circ.

From a value and a quadrant

  1. \displaystyle \sin a = \frac{12}{37} with a in Quadrant I, and \displaystyle \cos b = -\frac{9}{41} with b in Quadrant III. Find \cos(a - b) and \cos(a + b).
  2. \displaystyle \cos a = \frac{1}{3} with a in Quadrant IV, and \displaystyle \sin b = \frac{1}{4} with b in Quadrant II. Find \cos(a + b) exactly.
  3. Angles a and b are acute, with \displaystyle \sin a = \frac{7}{25} and \displaystyle \cos b = \frac{20}{29}. Find \cos(a + b), and decide whether a + b is acute or obtuse.

Reading backward and simplifying

  1. Find the exact value of \cos 112^\circ\cos 22^\circ + \sin 112^\circ\sin 22^\circ.
  2. Find the exact value of \displaystyle \cos\frac{2\pi}{9}\cos\frac{\pi}{9} - \sin\frac{2\pi}{9}\sin\frac{\pi}{9}.
  3. Write \cos 4x\cos x + \sin 4x\sin x as a single cosine.
  4. Simplify \cos(x - \pi).
  5. Expand and simplify \displaystyle \cos\left(x + \frac{3\pi}{4}\right).
  6. Simplify \displaystyle \cos\left(\frac{\pi}{3} + x\right) + \cos\left(\frac{\pi}{3} - x\right).

Identities, distances and equations

  1. Show that \cos(a + b) + \cos(a - b) = 2\cos a\cos b.
  2. Show that \cos(a - b) - \cos(a + b) = 2\sin a\sin b.
  3. Show that \cos 2x = \cos^2 x - \sin^2 x, and then that \cos 2x = 2\cos^2 x - 1.
  4. Lavanya marks the points of the unit circle at t = 1.9 and t = 0.4. Find the distance between them to three decimal places.
  5. Mihir must solve \displaystyle \cos 3x\cos x + \sin 3x\sin x = \frac{1}{2} for x in [0, 2\pi). Find every solution.

Reasoning

  1. Lavanya writes \cos(a + b) = \cos a + \cos b. Give one pair a, b that shows this is not an identity, and explain why no “distributing” rule can hold for cosine.
  2. In the proof, P is at angle a and Q at angle b. Explain why the proof still works when b > a, or when a - b is more than a full turn.
  3. Use the sum formula to prove \displaystyle \cos\left(t + \frac{\pi}{2}\right) = -\sin t for every real t.
  4. Kritika suspects \cos 2a = 2\cos a is never true. Using Exercise 17, find every value of \cos a for which it is true, and one such a in [0, \pi] to three decimal places.
  5. Explain why the difference formula gives the same value for \cos(a - b) and \cos(b - a), and why that had to happen.
Answers
  1. \displaystyle -\frac{\sqrt{2} + \sqrt{6}}{4}. 165^\circ = 120^\circ + 45^\circ: \displaystyle \left(-\frac{1}{2}\right)\frac{\sqrt{2}}{2} - \frac{\sqrt{3}}{2}\cdot\frac{\sqrt{2}}{2}.
  2. \displaystyle \frac{\sqrt{2} + \sqrt{6}}{4}. 345^\circ = 300^\circ + 45^\circ: \displaystyle \frac{1}{2}\cdot\frac{\sqrt{2}}{2} - \left(-\frac{\sqrt{3}}{2}\right)\frac{\sqrt{2}}{2}.
  3. \displaystyle -\frac{\sqrt{2} + \sqrt{6}}{4}. \displaystyle \frac{13\pi}{12} = \frac{3\pi}{4} + \frac{\pi}{3}: \displaystyle \left(-\frac{\sqrt{2}}{2}\right)\frac{1}{2} - \frac{\sqrt{2}}{2}\cdot\frac{\sqrt{3}}{2}.
  4. \displaystyle \frac{\sqrt{6} - \sqrt{2}}{4}. \displaystyle -\frac{5\pi}{12} = \frac{\pi}{4} - \frac{2\pi}{3}: \displaystyle \frac{\sqrt{2}}{2}\left(-\frac{1}{2}\right) + \frac{\sqrt{2}}{2}\cdot\frac{\sqrt{3}}{2}.
  5. \displaystyle \cos 120^\circ = 0\cdot\frac{\sqrt{3}}{2} - 1\cdot\frac{1}{2} = -\frac{1}{2}, while \displaystyle \cos 90^\circ + \cos 30^\circ = \frac{\sqrt{3}}{2}. They differ.
  6. \displaystyle \cos(a - b) = -\frac{795}{1517} and \displaystyle \cos(a + b) = \frac{165}{1517}. Here \displaystyle \cos a = \frac{35}{37} (positive in Quadrant I) and \displaystyle \sin b = -\frac{40}{41} (negative in Quadrant III); the products are \displaystyle -\frac{315}{1517} and \displaystyle -\frac{480}{1517}.
  7. \displaystyle \frac{2\sqrt{2} - \sqrt{15}}{12}. \displaystyle \sin a = -\frac{2\sqrt{2}}{3} (negative in Quadrant IV), \displaystyle \cos b = -\frac{\sqrt{15}}{4} (negative in Quadrant II); then \displaystyle \frac{1}{3}\left(-\frac{\sqrt{15}}{4}\right) - \left(-\frac{2\sqrt{2}}{3}\right)\frac{1}{4}.
  8. \displaystyle \cos(a + b) = \frac{333}{725}, so a + b is acute. \displaystyle \cos a = \frac{24}{25} and \displaystyle \sin b = \frac{21}{29}, so \displaystyle \frac{480 - 147}{725}. The sum of two acute angles is between 0^\circ and 180^\circ, and there a positive cosine means less than 90^\circ.
  9. 0. It is \cos(112^\circ - 22^\circ) = \cos 90^\circ.
  10. \displaystyle \frac{1}{2}. It is \displaystyle \cos\left(\frac{2\pi}{9} + \frac{\pi}{9}\right) = \cos\frac{\pi}{3}.
  11. \cos 3x, the difference formula with a = 4x, b = x.
  12. -\cos x. \cos x\cos\pi + \sin x\sin\pi = -\cos x.
  13. \displaystyle -\frac{\sqrt{2}}{2}(\cos x + \sin x). \displaystyle \cos x\left(-\frac{\sqrt{2}}{2}\right) - \sin x\cdot\frac{\sqrt{2}}{2}.
  14. \cos x. The \displaystyle \sin\frac{\pi}{3}\sin x terms cancel, leaving \displaystyle 2\cos\frac{\pi}{3}\cos x = \cos x.
  15. Add \cos a\cos b - \sin a\sin b and \cos a\cos b + \sin a\sin b. The \sin a\sin b terms cancel, and the sum is \cos(a + b) + \cos(a - b) = 2\cos a\cos b.
  16. Subtract \cos a\cos b - \sin a\sin b from \cos a\cos b + \sin a\sin b. The \cos a\cos b terms cancel, and the difference is \cos(a - b) - \cos(a + b) = 2\sin a\sin b.
  17. With a = b = x the sum formula gives \cos 2x = \cos^2 x - \sin^2 x. Replacing \sin^2 x by 1 - \cos^2 x gives 2\cos^2 x - 1.
  18. About 1.363. The distance is \displaystyle \sqrt{2 - 2\cos(1.9 - 0.4)}, which is \displaystyle \sqrt{2 - 2\cos 1.5} \approx \sqrt{1.8585}.
  19. \displaystyle x = \frac{\pi}{6}, \frac{5\pi}{6}, \frac{7\pi}{6}, \frac{11\pi}{6}. The left side is \cos 2x. With 2x in [0, 4\pi), \displaystyle \cos 2x = \frac{1}{2} at \displaystyle 2x = \frac{\pi}{3}, \frac{5\pi}{3}, \frac{7\pi}{3}, \frac{11\pi}{3} (Solving basic trig equations).
  20. a = b = 0: \cos 0 = 1, but \cos 0 + \cos 0 = 2. The right side can reach 2, and no cosine exceeds 1; cosine reads a coordinate off a circle, and coordinates of turned points do not add.
  21. The distance formula squares each difference, so PQ^2 is the same with P and Q swapped, and nothing used the order of a and b. The turn by -b adds -b to every angle for any real b, and the terminal point of a - b is defined for any real number, however many turns it wraps.
  22. By the sum formula, \displaystyle \cos\left(t + \frac{\pi}{2}\right) is \displaystyle \cos t\cos\frac{\pi}{2} - \sin t\sin\frac{\pi}{2}, and that is \cos t\cdot 0 - \sin t\cdot 1 = -\sin t.
  23. \displaystyle \cos a = \frac{1 - \sqrt{3}}{2} only, and a \approx 1.946. By Exercise 17 the equation is 2c^2 - 1 = 2c with c = \cos a, so \displaystyle c = \frac{1 \pm \sqrt{3}}{2}; the root \displaystyle \frac{1 + \sqrt{3}}{2} \approx 1.366 is more than 1, so it is no cosine. So the two sides agree at a few angles, but not at all of them.
  24. The right side \cos a\cos b + \sin a\sin b does not change when a and b trade places (multiplication is commutative). It had to: b - a = -(a - b), and cosine is even, so \cos(b - a) = \cos(a - b).
kg1128 · updated 2026-10-20 · CC-BY-SA-4.0