Trig without Tears Part 7:

# Sum and Difference Formulas

Copyright © 1997–2016 Stan Brown, BrownMath.com

Trig without Tears Part 7:

Copyright © 1997–2016 Stan Brown, BrownMath.com

**Summary:**
Continuing with trig identities, this page looks at the
**sum and difference formulas**, namely
sin(*A* ± *B*),
cos(*A* ± *B*), and
tan(*A* ± *B*).
Remember one, and all the rest flow from it. There’s also a
**beautiful way to get them from Euler’s formula**.

Formulas for cos(*A* + *B*), sin(*A* − *B*), and so on are important
but hard to remember. Yes, you can derive them by strictly
trigonometric means. But such proofs are lengthy, too hard to reproduce
when you’re in the middle of an exam or of some long calculation.

This brings us to W.W. Sawyer’s marvelous idea, as expressed in chapter 15 of Mathematician’s Delight (1943; reprinted 1991 by Penguin Books). He shows how you can derive the sum and difference formulas by ordinary algebra and one simple formula.

The ordinary algebra is simply the rules for combining powers:

(46) *x*^{a} *x*^{b} = *x*^{a+b}

(*x*^{a})^{b} = *x*^{a b}

(If you’re a bit rusty on the laws of exponents, you may want to review them.)

You may already know the “simple formula” that I mentioned above. It’s

(47) **Memorize:**

cos *x* + i sin *x* = e^{i x}

The formula is not Sawyer’s, by the way; it’s commonly
called Euler’s
formula. I don’t even know whether the idea of using Euler’s formula
to get the sine and cosine of sum and difference is
original with Sawyer. But I’m going to give him credit, since his
explanation is **simple and clear** and I’ve never seen it explained in
this way anywhere else.

You’ll sometimes see cos *x* + i sin *x*
abbreviated as cis *x* for brevity.

I’ve marked Euler’s formula
“memorize”. Although
it’s not hard to derive (and Sawyer does it
in a few steps by means of
power series), you have to start *somewhere*. And that formula
has so many other applications that it’s well worth committing to
memory. For instance, you can use it to get
the roots
of a complex number and
the logarithm of
a negative number.

Okay, back to Sawyer’s idea. What happens if you substitute
*x* = *A* + *B* in equation 47 above? You get

cos(*A* + *B*) + i sin(*A* + *B*) =
e^{iA + iB}

Hmmm, this looks interesting. It involves exactly what we’re
looking for, cos(*A* + *B*) and sin(*A* + *B*). Can you simplify
the right-hand side? Use equation 46 and then
equation 47 to rewrite it:

e^{iA + iB} =
e^{iA}
e^{iB} =
(cos *A* + i sin *A*)
(cos *B* + i sin *B*)

Now multiply that out and set it equal to the original left-hand side:

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

Now here’s the sneaky part. If I tell you
*a*+*b*i = 7−9i and ask you
to solve for *a* and *b*, you know immediately that
*a* = 7 and *b* = −9, right?
More formally, if two complex numbers are equal, their real parts must
be equal and their imaginary parts must be equal. So
the above equation in sines and cosines is actually two equations,
one for the real part and one for the imaginary part.
(I’m showing them in the opposite order,
to put sine before cosine.)

(48) sin(*A* + *B*) = sin *A* cos *B* + cos *A* sin *B*

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

In just a few short steps, the formulas for cos(*A* + *B*) and
sin(*A* + *B*) flow right from
equation 47, Euler’s equation for
e^{i x}. No more need to memorize which one has
the minus sign and how all the sines and cosines fit on the right-hand
side: all you have to do is a couple of substitutions and a multiply.

**Example:** What’s the exact value of cos 75°
or cos(5π/12)?

**Solution:** 75° = 45°+30°
(5π/12 = π/4+π/6). Using equation 48,

cos 75° = cos(45°+30°)

cos 75° = cos 45° cos 30° − sin 45° sin 30°

cos 75° = (√2/2)×(√3/2) − (√2/2)×(1/2)

cos 75° = √6/4 − √2/4

What about the formulas for the differences of angles? You can write
them down at once from equation 48 by
substituting −*B* for *B* and using equation 22.
Or, if you prefer, you can get them by substituting
*x* = *A*−*B* in equation 47 above.
Either way, you get

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

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

I personally find the algebraic reasoning given above very easy to follow, though you do have to remember Euler’s formula.

If
you prefer geometric derivations of sin(*A* ± *B*) and
cos(*A* ± *B*), you’ll find
a beautiful set by Len and Deborah Smiley.
(Phil Kenny drew my attention to this page’s original version
and to the link at the University of Alaska.)
Eric’s Treasure Trove of Mathematics has
smaller versions of the pictures.

The fallback position is the standard proof: draw a diagram and use
the distance formula or Pythagorean Theorem to prove the formula for
cos(*A* − *B*).

Sometimes—though not very often—you have to deal with the tangent of the sum or difference of two angles. I have only a vague idea of the formula, but it’s easy enough to work out “on the fly”:

tan(*A* + *B*) = sin(*A* + *B*) / cos(*A* + *B*)

tan(*A* + *B*) = (sin *A* cos *B* + cos *A* sin *B*) / (cos *A* cos *B* − sin *A* sin *B*)

What a mess! There’s no way to factor that and remove common
terms—or is there? Suppose you start with a vague idea
that you’d like to know tan(*A*+*B*) in terms of tan *A* and
tan *B* rather than all those sines and cosines. The numerator and
denominator contain sines and cosines, so if you divide by cosines
you’d expect to end up with sines or perhaps sines over cosines. And
sine/cosine is tangent, so this seems like a promising line of attack.
Since you’ve got cosines of angles *A* and *B* to contend with, try
dividing the numerator and denominator of the fraction by
cos *A* cos *B*:

tan(*A* + *B*) = (sin *A* cos *B* + cos *A* sin *B*) / (cos *A* cos *B* − sin *A* sin *B*)

tan(*A* + *B*) =
[sin *A*/cos *A* + sin *B*/cos *B*] /
[1 − (sin *A*/cos *A*)(sin *B*/cos *B*)]

Success! Simplify it using
the definition of tan *x*, and you have

(50) tan(*A* + *B*) = (tan *A* + tan *B*) / (1 − tan *A* tan *B*)

Now if you replace *B*
with −*B*, you have the formula for
tan(*A* − *B*). (Take a minute to review why
tan(−*x*) = −tan *x*.)

(51) tan(*A* − *B*) = (tan *A* − tan *B*) / (1 + tan *A* tan *B*)

**Example:** What’s the exact value of tan 15°
or tan(π/12)?

**Solution:** 15° = 60°−45°
(π/12 = π/3 − π/4). Therefore

tan(π/12) = tan(π/3 − π/4)

tan(π/12) = [tan(π/3) − tan(π/4)] / [1 + tan(π/3) tan(π/4)]

tan(π/12) = (√3− 1) / (1 + √3×1)

tan(π/12) = (√3− 1) / (√3 + 1)

If you like, you can rationalize the denominator:

tan(π/12) = (√3− 1)² / (√3 + 1)(√3 − 1)

tan(π/12) = (3 − 2√3 + 1) / (3 − 1)

tan(π/12) = (4 − 2√3) / 2

tan(π/12) = 2 − √3

To get the most benefit from these problems, work them without first looking at the solutions. Refer back to the chapter text if you need to refresh your memory.

**Recommendation**: Work them on paper —
it’s harder to fool yourself about whether you really
understand a problem completely.

You’ll find full solutions for all problems. Don’t just check your answers, but check your method too.

1
Find sin(−15°) exactly.

2
Find tan 105° exactly.

3
Prove: cos 2*A* = 2 cos² *A* − 1.
(Hint: 2*A* = *A* + *A*.)

Sometimes you need to simplify an expression like
cos 3*x* cos 5*x*. Of course it’s not equal to
cos(15*x*²), but can it be simplified at all? The answer is
yes, and in fact you need this technique for calculus work. There are
four formulas that can be used to break up a product of sines or
cosines.

These product-to-sum formulas come from
equation 48 and equation 49 for sine and cosine of *A* ± *B*.
First let’s develop one of these formulas, and then we’ll look at an
application before developing the others.

Take the two formulas for cos(*A* ± *B*) and add
them:

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

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

cos(*A* − *B*) +
cos(*A* + *B*) = 2 cos *A* cos *B*

½ [cos(*A* − *B*) +
cos(*A* + *B*)] = cos *A* cos *B*

**Example:** Suppose you need to graph the function

f(*x*) = cos 2*x* cos 3*x*,

or perhaps you need to find its integral. Both of these are rather
hard to do with the function as it stands. But you can use the
product-to-sum formula, with *A* = 2*x* and *B* = 3*x*, to
rewrite the function as a sum:

f(*x*) = cos 2*x* cos 3*x*

f(*x*) = ½
[cos(2*x* − 3*x*) + cos(2*x* + 3*x*)]

f(*x*) = ½ [cos(−*x*) + cos 5*x*]

You know that
cos(−*x*) = cos *x*,
and therefore

f(*x*) = ½ [cos *x* + cos 5*x*]

f(*x*) = ½ cos *x* + ½ cos 5*x*

This is quite easy to integrate. And while it’s not exactly
trivial to graph, it’s much easier than the original, because
cos *x* and cos 5*x* *are* easy to graph.

The other three product-to-sum formulas come from the other three ways to add or subtract the formulas in equation 48 and equation 49. If you subtract the two cosine formulas instead of adding:

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

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

you get

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

½ [cos(*A*−*B*) − cos(*A* + *B*)] = sin *A* sin *B*

To get the other two product-to sum formulas, add the two sine formulas from equation 48 and equation 49, or subtract them. Here are all four formulas together:

(52) cos *A* cos *B* = ½ cos(*A* − *B*) + ½ cos(*A* + *B*)

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

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

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

The fourth one of those formulas really isn’t needed, because
you can always evaluate
cos *p* sin *q* as
sin *q* cos *p*. But it’s traditional to
present all four formulas.

There are also formulas that combine a sum or difference into a product. Heon Joon Choi, a physics student from Cornell, has kindly told me of an application: “superposing two waves and trying to figure out the nodes is much easier if they are multiplied, rather than added.” This makes sense: solving most equations is easier once you’ve factored them. The sum-to-product formulas are also used to prove the Law of Tangents, though that itself is no longer used in solving triangles.

Here’s how to get the sum-to-product formulas. First make these definitions:

*A* = ½(*u* + *v*), and *B* = ½(*u* − *v*)

Then you can see that

*A* + *B* = *u*, and *A* − *B* = *v*

Now make those substitutions in all four formulas of equation 52, and after simplifying you will have the sum-to-product formulas:

(53) cos *u* + cos *v* = 2 cos(½(*u* + *v*)) cos(½(*u* − *v*))

cos *u* − cos *v* = −2 sin(½(*u* + *v*)) sin(½(*u* − *v*))

sin *u* + sin *v* = 2 sin(½(*u* + *v*)) cos(½(*u* − *v*))

sin *u* − sin *v* = 2 sin(½(*u* − *v*)) cos(½(*u* + *v*))

Euler’s formula (equation 47) is easily proved by means of power series. Start with the formulas

You can click the image to see a larger version. Or if you can’t see the image at all, here are the formulas in linear text:

e^{x} = SUM [ *x*^{k} / *k*! ] = 1 + *x* + *x*^{2}/2! + *x*^{3}/3! + ⋯

cos *x* = SUM [ (−1)^{k} *x*^{2k} / (2*k*)! ] = *1* − *x*^{2}/2! + *x*^{4}/4! − *x*^{6}/6! + ⋯

sin *x* = SUM [ (−1)^{k} *x*^{2k+1} / (2*k*+1)! ] = *x* − *x*^{3}/3! + *x*^{5}/5! − *x*^{7}/7! + ⋯

(These are how the function values are
actually calculated, by the way. All three series converge quickly,
meaning that you get quite an accurate result from computing just the
first few terms. If you want to know the value of
e^{2}, you just substitute 2 for *x* in the
formula and compute until the additional terms fall within your
desired accuracy.)

Now we have to find
the value of e^{ix}, where i =
√−1.
Use the first formula to find e^{ix}, by
substituting i*x* for *x*:

e^{ix} =
SUM [ (i*x*)^{k} / *k*! ]

e^{ix} =
1 + (i*x*) +
(i*x*)^{2}/2! + (i*x*)^{3}/3! +
(i*x*)^{4}/4! + (i*x*)^{5}/5! +
(i*x*)^{6}/6! + (i*x*)^{7}/7! + ...

Simplify the powers of i, using i² = −1:

e^{ix} =
1 + i*x* −
*x*^{2}/2! − i*x*^{3}/3! +
*x*^{4}/4! + i*x*^{5}/5! −
*x*^{6}/6! − i*x*^{7}/7! + ...

Finally, group the real and imaginary terms separately:

e^{ix} =
[1 − *x*^{2}/2! +
*x*^{4}/4! − *x*^{6}/6! + ...] +
i[*x* − *x*^{3}/3! +
*x*^{5}/5! − *x*^{7}/7! + ...]

Those should look familiar. If you refer back to the
power series at the start of this section,
you’ll see that the first group of terms
is just cos *x* and the second group is just sin *x*. So you
have

e^{ix} =
cos *x* + i sin *x*

which is Euler’s formula, as advertised!

You may wonder where the series for cos *x*, sin *x*, and
e^{x} come from. The answer is that they
are the Taylor series expansions of the functions. (You’ll probably
study Taylor series in second- or third-semester calculus.)

**26/27 Nov 2016**:- Added practice problems.
- Marked the product-sum formulas section as BTW.
- Flipped the order of equation 48, because everyone expects to see sine before cosine.
- Added an Equation Editor image of equation 54 (formerly equation 81), to make the fractions and exponents stand out better.
- Updated the mathematical notation, particularly the use of italics and spaces, to conform to the standard. I used Jukka Korpela’s comprehensive Writing Mathematical Expressions (2014, Suomen E-painos Oy), ISBN 978-952-6613-25-3.

- (intervening changes suppressed)
**19 Feb 1997**: New document.

next: 8/Double and Half Angles

Because this textbook helps you,

please click to donate!Because this textbook helps you,

please donate at

BrownMath.com/donate.

please click to donate!Because this textbook helps you,

please donate at

BrownMath.com/donate.

Updates and new info: http://BrownMath.com/twt/