mathematics / trigonometry / sums into products
Sums into Products
Add two compound angle formulas together and half the terms cancel. What is left turns any sum of two sines or two cosines into a product, which is what makes an equation solvable in one line and what makes two out of tune strings wobble.
By the end you can
- turn a sum of two sines into a product, and turn a product back into a sum
- solve in one line an equation that is not solvable while it is written as a sum
- explain why two strings slightly out of tune produce a slow wobble
Step 1 of 5
Add the two formulas
Stack sin(A+B) above sin(A−B), add them, and the two terms that carry cos A sin B cancel.
The produced four expansions. Each one is two terms:
sin(A+B) = sin A cos B + cos A sin B
sin(A−B) = sin A cos B − cos A sin B
Write them one above the other and add. The two cos A sin B terms have opposite signs, so they cancel. The two sin A cos B terms are identical, so they double:
2 sin A cos B = sin(A+B) + sin(A−B)
A = (C+D)/2 = 50°. B = (C−D)/2 = 20°. So A+B = C = 70° and A−B = D = 30°.
2 sin 50° cos 20° = 1.440. sin 70° + sin 30° = 0.940 + 0.500 = 1.440. Same number.
Each box is one term with its value at the current angles. Teal underlines a sine factor, amber a cosine factor; the words themselves stay in normal text colour. A struck box is a term that cancels: the two values above and below are the same size and opposite signs. There is no colour anywhere in this figure that means C or D.
One tab per formula. Each shows two rows, the (A+B) expansion above the (A−B) expansion, split into their two terms. Each box carries its own live value.
The build runs in four numbered steps. One pair of terms ends up struck out, the other pair merges into a single doubled term. Each lands in the column it came from, so the survivor is on the left for the two add tabs and on the right for the two subtract tabs.
Look at the struck pair first: two values of the same size with opposite signs. Then look at the pair that survived, the same number twice. That is where the 2 in front of the product comes from.
Subtract the second line from the first instead. Now the sin A cos B terms cancel and the other pair doubles:
2 cos A sin B = sin(A+B) − sin(A−B)
Do the same with the two cosine expansions:
cos(A+B) = cos A cos B − sin A sin B
cos(A−B) = cos A cos B + sin A sin B
Adding cancels the sin A sin B pair:
2 cos A cos B = cos(A+B) + cos(A−B)
Subtracting cancels the cos A cos B pair and leaves cos(A+B) − cos(A−B) = −2 sin A sin B. Multiply both sides by minus 1 to get rid of the minus sign in front of the product:
2 sin A sin B = cos(A−B) − cos(A+B)
Those four are the formulas. Every one of them came from adding or subtracting two lines you already had.
The last one carries the trap. In the first three, the (A+B) term is written first. In the fourth, the difference runs the other way: it is cos(A−B) minus cos(A+B), not cos(A+B) minus cos(A−B).
The reason is visible in the expansions. cos(A+B) is the one with minus sin A sin B in it, so subtracting it is what makes the product come out positive. Writing it the other way round gives an answer with the wrong sign at every angle where the product is not zero.
Check the last one with numbers. Take A = 60 degrees and B = 30 degrees. Then 2 sin A sin B = 2 × (√3/2) × (1/2), which is √3/2. And cos(A−B) − cos(A+B) = cos(30 degrees) − cos(90 degrees) = √3/2 minus 0, which is √3/2. The two agree.
Written the other way round the right hand side would be minus √3/2, and the product of two positive numbers is not negative.
These formulas had a job before they had a name in a textbook. Multiplying two six figure numbers by hand is slow; adding them is fast. Astronomers used the product to sum formulas to convert a multiplication into a table lookup and an addition, a technique called . Tycho Brahe's assistants were using it by about 1580, and it was the standard technique until Napier published logarithms in 1614.
Step 2 of 5
Rename the angles
Call the sum C and the difference D, and the four product-to-sum formulas turn into the four sum-to-product formulas.
The four formulas from the previous step start with a product and end with a sum. Most of the time you want the reverse. You are handed sin C + sin D and you want a product.
Reading the formulas right to left almost does that. The obstacle is the naming. The right hand sides are written in terms of A+B and A−B, and what you were handed is two angles with no A and B attached to them. So rename.
That is why the letters change on this page. On the compound angle page, A and B were the two angles you were adding. Here the two angles you are given are the sum and the difference of those, so they get the next two letters. A and B are the halves. C and D are the sum and the difference.
Set C = A+B and D = A−B. Add those two equations: C + D = 2A, so A = (C+D)/2. Subtract them: C − D = 2B, so B = (C−D)/2. Nothing is lost in the renaming. Any pair of angles C and D can be written this way, because the two formulas for A and B always give an answer.
the pair you have
the pair the compound formulas want
C = A + B = 70°. D = A − B = 30°.
The two inner braces are the same length, and together they are the outer brace. That is all (C−D)/2 means: half the gap. The upright tick sits exactly between the two triangles, which is all (C+D)/2 means: the average. Drag the tick and both angles move together. Drag the small square and they spread apart. No colour is used in this figure at all: nothing on this line is a sine or a cosine, so the marks are plain ink and the letters do the naming.
One angle line carrying four marks: the two angles you were handed, C and D, and the two the compound formulas want, the average A and the half difference B. There is no trigonometry in this figure. These are facts about two numbers on a line, true before any sine is taken.
Look first at the upright tick for the average. Then look at the spans under the line: half the gap above, the whole gap below. A zero length span is drawn as a dot, so nothing disappears when C and D meet. Every mark is a handle, and C and D on one side, A and B on the other, are the same two numbers written two ways.
Substitute into the four and you get the four everyone quotes:
sin C + sin D = 2 sin((C+D)/2) cos((C−D)/2)
sin C − sin D = 2 cos((C+D)/2) sin((C−D)/2)
cos C + cos D = 2 cos((C+D)/2) cos((C−D)/2)
cos C − cos D = −2 sin((C+D)/2) sin((C−D)/2)
These are the formulas. The first three substitutions are the same move three times over and mislead nobody. The fourth is the one worth watching, because the minus sign on it is not decoration and it is not a typo:
each side, at C = 70°, D = 30°
- 2 sin A sin B = cos(A − B) − cos(A + B) value 0.524 = 0.524
Substitute A = (C+D)/2 and B = (C−D)/2. Then A + B is C and A − B is D.
2 sin((C+D)/2) sin((C−D)/2) = cos D − cos C value 0.524 = 0.524That is the difference the wrong way round. Multiply both sides by −1. Both sides change sign together, so the value column flips here and the equation stays true.
−2 sin((C+D)/2) sin((C−D)/2) = cos C − cos D value −0.524 = −0.524Read it the other way round, which is the form everyone quotes.
cos C − cos D = −2 sin((C+D)/2) sin((C−D)/2) value −0.524 = −0.524
show this derivation as text
2 sin A sin B = cos(A − B) − cos(A + B) Value 0.524 = 0.524. Substitute A = (C+D)/2 and B = (C−D)/2. Then A + B is C and A − B is D. 2 sin((C+D)/2) sin((C−D)/2) = cos D − cos C Value 0.524 = 0.524. That is the difference the wrong way round. Multiply both sides by −1. Both sides change sign together, so the value column flips here and the equation stays true. −2 sin((C+D)/2) sin((C−D)/2) = cos C − cos D Value −0.524 = −0.524. Read it the other way round, which is the form everyone quotes. cos C − cos D = −2 sin((C+D)/2) sin((C−D)/2) Value −0.524 = −0.524.
Teal underlines a sine name, amber a cosine name; the words themselves stay in normal text colour. There is no tangent in this block, so purple does not appear. The 1px boxes on the second line mark what the substitution put there. At C = 70° and D = 30°, the first two lines are worth 0.524 on both sides and the last two are worth −0.524 on both sides, because the third line multiplies the whole equation by minus 1. There is no colour anywhere in this block that means C or D, and none that means plus or minus; the sign is the glyph.
Check it at C = 60 degrees and D = 0 with the control above; the right hand column does the arithmetic live. Every line reads the same number on both sides, and the number changes sign at the third line, because multiplying an equation by minus 1 changes both sides at once and leaves it true.
Drop that minus sign from the formula and you would be claiming a positive number where the left side is negative, which is wrong at every angle where the product is not zero.
Now read all four in words. Every right hand side is 2, times a function of half the sum, times a function of half the difference. That structure never changes. Half the sum and half the difference, every time. The only question is which function goes where.
Two facts settle most of it. A difference must be zero when C = D, so both difference formulas carry sin((C−D)/2), which is 0 when C = D. Both sum formulas carry cos((C−D)/2) instead, which is 1 when C = D, so a sum collapses to twice the common value. And the factor on the average keeps the function you started with for a sum (sines give a sine, cosines give a cosine) and swaps it for a difference.
That pattern is worth having, but it is not worth trusting under pressure. Re-deriving the formula takes the two lines from the previous step and about ten seconds, and a formula you can re-derive is one you cannot misremember.
Step 3 of 5
Why a product is easier
A product is zero when either factor is zero, and a product of two sines can be turned back into a sum of single waves, which is what makes it integrate in one step.
A sum of two waves is hard to work with. A product of two waves is easy. Two specific reasons.
First, a product is zero exactly when one of its factors is zero. That turns solving into reading. Second, a product of two sines or two cosines can be converted back into a sum of two single waves, and a single wave integrates in one step.
Take the equation sin 5x + sin 3x = 0. Guessing values gets you a few solutions and no confidence that you have them all. Factor it instead. Half the sum of the two angles is (5x + 3x)/2 = 4x. Half the difference is (5x − 3x)/2 = x. So:
sin 5x + sin 3x = 2 sin 4x cos x
The equation is now 2 sin 4x cos x = 0, and a product is zero when a factor is zero. So sin 4x = 0 or cos x = 0. Sine is zero at whole multiples of π, so 4x = kπ, giving x = kπ/4 for every integer k. Cosine is zero at π/2 plus whole multiples of π, so x = π/2 + kπ.
Figure 9.3. Three plots stacked over one shared horizontal axis running from 0 to 360 degrees. The top plot is the sum of sin 5x and sin 3x. The middle is sin 4x and the bottom is cos x. 9 dashed vertical lines cross all three plots. Each one passes through a point where the top curve meets the axis and through a point where one of the two lower curves meets the axis. At 2 of them, 90 and 270 degrees, both lower curves meet the axis at once and the top curve touches without crossing.
These are frequencies, in cycles per turn, not angles. Nothing in this figure changes C or D.
Teal: sines. Amber: a cosine. A hollow circle is a zero of sin 4x, a hollow square is a zero of cos x, and where the two shapes are drawn one inside the other both factors are zero at once. Every dashed upright is a zero of the top curve, and every one of them passes through a zero of one of the two curves below. 9 of them in 0° <= x <= 360°, counting both ends. The letter x here is a variable, not the angle C or D at the top of the page: the sliders above do not move this figure.
Both factors are zero here, so the curve touches the axis and turns back instead of crossing it.
sin 5x + sin 3x = 2 sin 4x · cos x
Hollow circles mark the zeros of sin 4x. They come from 180k over 4, not from scanning the curve for a change of sign.
Hollow squares mark the zeros of cos x, at 90 plus 180k degrees. This figure reads nothing from C and D.
zeros in 0° <= x <= 360°, counting both ends
sin 5x + sin 3x = 0 exactly when sin 4x = 0 or cos x = 0, which is x = 45k degrees for whole k. 9 of them in 0° <= x <= 360°, counting both ends.
Every zero of cos x in this window is already a zero of sin 4x, so the second factor contributes no new solutions here. That is why the distinct count is 9 and not 11.
Three panels stacked over the same range, 0° to 360°, each drawing its own axis. The top panel is the sum of two sines. The two beneath are the factors it turns into, and every panel marks its own zeros.
Read it in columns. Every mark on the top curve has a mark directly beneath it in at least one of the two factor panels. That is the claim: a zero of the sum is a zero of a factor.
One honest note about this particular example. The cosine solutions are already in the sine list: π/2 is 2 × π/4, and 3π/2 is 6 × π/4. So the complete answer here is x = kπ/4, and the second factor adds nothing new. That is a coincidence of these two frequencies, not a general rule. Change the equation to sin 5x + sin 2x = 2 sin(7x/2) cos(3x/2) and the two lists have no member in common.
The other direction serves integration. ∫ sin 5x sin 3x dx has no obvious antiderivative as it stands. Use 2 sin A sin B = cos(A−B) − cos(A+B) to rewrite the integrand as (cos 2x − cos 8x)/2, and now each term is a single cosine. The integral is (sin 2x)/4 − (sin 8x)/16, plus a constant.
That calculation is the machinery underneath Fourier series. Integrate sin 5x sin 3x over one full turn and both cosine terms give zero, because each completes a whole number of cycles across that interval. Two sine waves of different whole-number frequencies multiply to something whose average is zero. That is what lets a signal be split into frequency components independently of each other, which is the result quoted on page 6.
Step 4 of 5
Beats
Adding two waves of nearly equal frequency gives a fast wave at the average frequency whose amplitude is squeezed slowly by a cosine at half the difference.
Play two notes at almost the same pitch and you hear a single note that gets louder and quieter, over and over. The wobble is called , and the sum-to-product formula is the whole explanation.
Two waves of equal size at frequencies f₁ and f₂ give the sum sin(2πf₁t) + sin(2πf₂t). Feed that into sin C + sin D = 2 sin((C+D)/2) cos((C−D)/2), with C = 2πf₁t and D = 2πf₂t. Half the sum of the angles is 2π × ((f₁+f₂)/2) × t. Half the difference is 2π × ((f₁−f₂)/2) × t. So the sum of the two waves is:
2 sin(2π × (f₁+f₂)/2 × t) × cos(2π × (f₁−f₂)/2 × t)
Read the two factors separately. The sine is a wave at the average of the two frequencies. That is the pitch you hear. The cosine is a wave at half the difference of the two frequencies. If the two frequencies are close, half their difference is tiny, so this factor changes very slowly compared with the first.
A slowly changing factor multiplying a fast wave acts as a varying amplitude. The pair of curves +2cos(...) and −2cos(...) traces the boundary the fast wave stays inside, and that boundary is called the .
Figure 9.4. One plot over an axis from 0 to 360 degrees. Two faint waves of nearly equal frequency, their sum drawn heavily over them, and two curves tracing the sum's rising and falling height: a thin solid line, which is the half difference cosine itself, and a dashed grey line, which is its mirror. Ink ticks mark where the sum dies away: there are 2 of them in this turn. The brackets under the plot show that one cycle of the thin solid line contains two of those ticks.
These are frequencies, in cycles per turn, not angles. Nothing in this figure changes C or D.
sin 17x + sin 15x = 2 sin 16x · cos x
Two pale teal waves are the two tones, 17 and 15 cycles per turn. The heavy teal wave is their sum. The envelope is a pair: the thin ink line is 2 cos x itself, drawn solid so you can follow its cycle, and the dashed grey line is its mirror, minus 2 cos x. Those three are named on the plot itself. The two pale tones are not: both of them are at zero at each end of the window, so a label there could not belong to one rather than the other. Ink ticks mark the waists where the sum dies away: there are 2 of them in this turn. The brackets under the plot each span one full cycle of the thin ink line, and each bracket holds two ticks. That is why the beat rate is the difference, 2, and not the half difference, 1. The x here is a variable, not the angle C or D at the top of the page: this figure reads neither of them.
| waists in one turn | 2 |
|---|---|
| frequency difference | 17 − 15 = 2 |
| half difference | 1, which is NOT the beat rate |
2 waists at a difference of 2. Not four yet.
Each cycle of the thin ink line contains two waists, so the throb happens twice as often as that line does. Count the ticks: 2 in a turn, which is 17 minus 15.
If x sweeps one turn per second, these are a 17 hertz tone and a 15 hertz tone and you hear 2 beats a second.
One plot over 0° to 360°. The two waves being added are drawn faintly, and their sum is drawn boldly on top. A cosine and its mirror image are drawn over the whole thing, and that pair is the .
Look at the envelope first, not at the fast wave inside it. The ink ticks mark the waists, the places where the sum dies away. The table under the plot counts those waists and gives the frequency difference on the next row.
Now the rate, which is where people go wrong. The cosine factor has frequency (f₁−f₂)/2. The loudness does not follow the cosine, it follows the size of the cosine, and the size is largest twice per cycle: once when the cosine is at +1 and once when it is at −1. Both are loud.
So the envelope has two bulges per cycle of the cosine, and the wobbles arrive at twice the cosine's frequency. Twice (f₁−f₂)/2 is f₁−f₂. The beat rate is the difference of the two frequencies, not half of it.
Concretely, play 440 Hz against 444 Hz. You hear a single tone at 442 Hz, the average, getting louder and quieter 4 times a second. A piano tuner counts those wobbles, and 4 per second means the two strings are 4 Hz apart. Quoting 2 per second, the frequency of the cosine, is the classic error on this page.
Two limits worth stating. Between two bulges the envelope passes through zero, and at that instant the fast wave flips its sign, because the cosine has gone negative and a negative multiplier inverts the wave. The ear hears the size and so hears a gap, not a flip.
And this exact formula needs both waves to be the same size. Unequal waves still beat, but the envelope never reaches zero, so the quiet part is quiet rather than silent.
Step 5 of 5
The same fact as vectors
Adding two unit vectors at angles C and D gives a vector along the bisector at angle (C+D)/2 with signed length 2cos((C−D)/2), and its two components are the two sum-to-product formulas.
Put two unit vectors on the circle, one at angle C and one at angle D. Their components are (cos C, sin C) and (cos D, sin D), from the unit circle definition on page 2.
Add them. The x component of the sum is cos C + cos D. The y component is sin C + sin D. Both of those are left hand sides of formulas from two steps ago, so both turn into products:
x, then y, then the length, at C = 70°, D = 30°
- cos C + cos D = 2 cos((C+D)/2) cos((C−D)/2) 2 cos((C+D)/2) is 1.286. cos((C−D)/2) is 0.940. value 1.208 = 1.208
The y component, by the sine formula from the same step. The right hand factor is the same one, and it sits in the same column.
sin C + sin D = 2 sin((C+D)/2) cos((C−D)/2) 2 sin((C+D)/2) is 1.532. cos((C−D)/2) is 0.940. value 1.440 = 1.440The right hand column is the same on both lines. Take it out in front, and what is left is the unit vector at the average angle.
(x, y) = 2 cos((C−D)/2) (cos((C+D)/2), sin((C+D)/2)) value 1.879 = 1.879
show this derivation as text
cos C + cos D = 2 cos((C+D)/2) cos((C−D)/2) 2 cos((C+D)/2) is 1.286. cos((C−D)/2) is 0.940. Value 1.208 = 1.208. The y component, by the sine formula from the same step. The right hand factor is the same one, and it sits in the same column. sin C + sin D = 2 sin((C+D)/2) cos((C−D)/2) 2 sin((C+D)/2) is 1.532. cos((C−D)/2) is 0.940. Value 1.440 = 1.440. The right hand column is the same on both lines. Take it out in front, and what is left is the unit vector at the average angle. (x, y) = 2 cos((C−D)/2) (cos((C+D)/2), sin((C+D)/2)) Value 1.879 = 1.879.
Teal underlines a sine name, amber a cosine name; the words themselves stay in normal text colour. There is no tangent in this block, so purple does not appear. At C = 70° and D = 30°, the shared factor cos((C−D)/2) is 0.940, printed under itself in the same column on both of the first two lines. The right hand column is not one number repeated here, the way it is in a block that restates one quantity: it is x, then y, then the length, because the first two lines are different components of the same arrow, and on the third line both sides are arrows, so the column prints their lengths. Each line prints its own two sides, and the two agree because the step is legal. There is no colour anywhere in this block that means C or D, and none that means plus or minus; the sign is the glyph.
So the points at the average of the two angles, and the factor taken out in front is its signed length.
Figure 9.5. Two arrows of length one drawn from a common origin, one at angle C and one at angle D, completed into a parallelogram by two dashed sides. A dashed construction line shows the direction exactly midway between C and D, and two equal arcs, one on each side of it, show that it is midway. The diagonal of the parallelogram is drawn as a heavy arrow, lying along the construction line. From the arrow's tip, a teal segment runs across to the vertical axis, marking sin C plus sin D, and an amber segment runs to the horizontal axis, marking cos C plus cos D.
sin C + sin D = 1.440
cos C + cos D = 1.208
the (C+D)/2 direction, 50°
| length of the arrow | 1.879 | |
|---|---|---|
| 2 cos((C−D)/2) | 2 cos 20° = 1.879 | agrees |
| direction of the arrow | 50° | |
| (C+D)/2 | 50° | agrees |
Two arrows of length 1, one at C = 70° and one at D = 30°, added as a parallelogram. Solid black is C, lighter grey is D, and the letters say which is which; neither carries a colour, because neither is a function. The heavy arrow is their sum, 1.879 long, pointing at 50°, which is the average of C and D. Its height on the vertical axis, marked in teal, is sin C + sin D = 1.440. Its reach along the horizontal axis, marked in amber, is cos C + cos D = 1.208. The two equal arcs either side of the dashed (C+D)/2 line are both (C−D)/2 = 20°, which is what puts that line at the average, and the arrow's direction with it.
The unit circle with two vectors of length 1 on it, one at C and one at D. The parallelogram they span is completed with dashed sides. The diagonal from the origin is their sum, drawn as a heavy arrow whenever it has any length.
Look at the four sides of the parallelogram first. All four are length 1, so the shape is a rhombus and its diagonal splits the corner angle in half. That is why the sum lies on the dashed line at the average of the two angles.
The table of checks reads the length and the direction off the drawing, then off the formula, and says whether they agree.
The geometry says the same thing without algebra. Both vectors have length 1, so the parallelogram they span has four equal sides, which makes it a rhombus. The diagonal of a rhombus cuts its corner angle exactly in half. So the sum points along the bisector, which is the average angle.
As for the length, each vector makes an angle of half the difference with that bisector, so each contributes cos((C−D)/2) along it, and there are two of them.
One caveat about the length. cos((C−D)/2) goes negative once the two vectors are more than 180 degrees apart, and a length is not negative. Read the formula as giving a signed length along the direction (C+D)/2: when it is negative the resultant points the opposite way, at (C+D)/2 plus 180 degrees.
At exactly 180 degrees apart the half difference is 90 degrees, the cosine is 0, the two vectors cancel, and the sum is the zero vector, which has no direction at all.
This is why the average-and-half-difference pattern is worth seeing rather than memorising. The sine formula and the cosine formula are not two facts. They are the y component and the x component of one vector addition.
Challenge
Figure 9.4. One plot over an axis from 0 to 360 degrees. Two faint waves of nearly equal frequency, their sum drawn heavily over them, and two curves tracing the sum's rising and falling height: a thin solid line, which is the half difference cosine itself, and a dashed grey line, which is its mirror. Ink ticks mark where the sum dies away: there are 2 of them in this turn. The brackets under the plot show that one cycle of the thin solid line contains two of those ticks.
These are frequencies, in cycles per turn, not angles. Nothing in this figure changes C or D.
Try it Which frequency difference makes the sum swell and fade exactly four times per turn?
sin 17x + sin 15x = 2 sin 16x · cos x
Two pale teal waves are the two tones, 17 and 15 cycles per turn. The heavy teal wave is their sum. The envelope is a pair: the thin ink line is 2 cos x itself, drawn solid so you can follow its cycle, and the dashed grey line is its mirror, minus 2 cos x. Those three are named on the plot itself. The two pale tones are not: both of them are at zero at each end of the window, so a label there could not belong to one rather than the other. Ink ticks mark the waists where the sum dies away: there are 2 of them in this turn. The brackets under the plot each span one full cycle of the thin ink line, and each bracket holds two ticks. That is why the beat rate is the difference, 2, and not the half difference, 1. The x here is a variable, not the angle C or D at the top of the page: this figure reads neither of them.
| waists in one turn | 2 |
|---|---|
| frequency difference | 17 − 15 = 2 |
| half difference | 1, which is NOT the beat rate |
2 waists at a difference of 2. Not four yet.
Each cycle of the thin ink line contains two waists, so the throb happens twice as often as that line does. Count the ticks: 2 in a turn, which is 17 minus 15.
If x sweeps one turn per second, these are a 17 hertz tone and a 15 hertz tone and you hear 2 beats a second.