Trig without Tears Part 7:

# Sum and Difference Formulas

revised 13 Apr 2014

Copyright © 1997–2014 Stan Brown, Oak Road Systems

Trig without Tears Part 7:

revised 13 Apr 2014

Copyright © 1997–2014 Stan Brown, Oak Road Systems

**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}*)

(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*^{ix}

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, equation 47,
“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 told you
*a*+*b**i* = 7−9*i* and asked you
to solve for *a* and *b*, you could immediately tell me 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:

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

*sin*(A+B) = *sin* A *cos* B + *cos* 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*^{ix}. 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 at <http://www.maa.org/pubs/mm_supplements/smiley/trigproofs.html>
or <http://math.uaa.alaska.edu/~smiley/trigproofs.html>,
worth the wait for the page to load.
(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 at
<http://mathworld.wolfram.com/TrigonometricAdditionFormulas.html>.

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 (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. But
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*sin* B/*cos* A*cos* B]

Hmmm, looks like this is the right track. Simplify it using
the definition of *tan* *x* (see equation 3), 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

**Advice to the reader:** The formulas in this section aren’t
really very useful in trigonometry itself, but are used in calculus.
You may wish to skip them, especially on a first reading.

next: 8/Double and Half Angles

Sometimes you need to simplify an expression like
*cos* 3x *cos* 5x. Of course it’s not equal to
*cos*(15x²), 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 the formulas in 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* 2x *cos* 3x,

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 = 2x and B = 3x, to rewrite the function as a sum:

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

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

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

Use equation 22, *cos*(−x) = *cos* x:

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

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

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* 5x *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))

next: 8/Double and Half Angles

this page: http://oakroadsystems.com/twt/sumdiff.htm

Was this page useful? Visit
my other Math Articles.

Want to show your appreciation? Please
donate a few bucks to the author.