mathematics / trigonometry / the compound angle formulas
The Compound Angle Formulas
sin(A + B) is not sin A + sin B. What it is instead, proved once from a chord and once from a rectangle, and what it buys: adding two waves, and composing two rotations.
By the end you can
- say why sin(A + B) is not sin A + sin B, and show the gap on a drawing
- derive the four sum and difference formulas from one rectangle
- add two waves of the same frequency into a single wave, and find its height and phase
- compose two rotations into one
Step 1 of 6
sin(A + B) is not sin A + sin B
sin(A + B) is not sin A + sin B, and one pair of angles is enough to prove it.
Every page so far has used one angle, written θ. This page needs two, because it is about what happens when angles are added together. Call them A and B, and measure both in degrees.
The natural guess is that sine hands itself out over the sum: sin(A + B) = sin A + sin B. It is wrong, and one pair of numbers settles it.
Take A = 30 degrees and B = 60 degrees. From page 6, sin(30 degrees) = 1/2 exactly and sin(60 degrees) = √3/2, which is 0.866 to three decimal places. Add them and the total is 1.366 to three decimal places. But A + B is 90 degrees, and sin(90 degrees) = 1 exactly. The guess overshoots by 0.366.
Figure 7.1
Adding the sines is not the sine of the sum
angle A
Black: the radius, always exactly 1. Teal solid: sin = 0.766.
1 unit = 60 px.
angle B
Black: the radius, always exactly 1. Teal solid: sin = 0.342.
1 unit = 60 px.
angle A + B
Black: the radius, always exactly 1. Teal solid: sin = 0.940.
1 unit = 60 px.
Every bar in this figure is a sine, so every bar is teal. Colour separates nothing here and must not be recruited to. The dashed line is sin(A + B) = 0.940. The middle bar reaches it. The left hand bar, which is sin B stacked on sin A, does not.
Three unit circles across the top, at A, at B, and at A + B. Each one draws its sine as a vertical drop.
Below them, bars on one shared scale ruled from minus 2 to 2. The first stacks sin B on sin A. The second is sin(A + B) on its own. A third holds the two products that do stack to sin(A + B), and it stays off screen until the toggle or a reduced motion setting brings it in.
Look at the dashed line first. It sits at the height of sin(A + B), and the figure is about which bar tops land on it. A bracket measures the distance between the first two tops when there is one.
Better angles will not rescue it. Sine never exceeds 1, because it is the y coordinate of a point on a circle of 1. Two sines can add up to as much as 2. Any rule that turns two sines into the sine of a sum has to land back inside the interval from minus 1 to 1, and plain addition does not.
The property being assumed here has a name. A function is one where f(x + y) = f(x) + f(y) and f(kx) = k f(x). A sum of inputs gives the sum of the outputs, and doubling the input doubles the output. Sine is not linear. Neither is cosine, and neither is tangent. You cannot break them apart over a sum, and you cannot pull a factor out through them: sin(2A) is not 2 sin A either.
So sin(A + B) has to be built out of sin A, cos A, sin B and cos B some other way. There is such a formula, it is exact, and the rest of this page derives it. The formulas for a function of a sum or a difference of two angles are the .
Step 2 of 6
cos(A − B) = cos A cos B + sin A sin B
cos(A − B) = cos A cos B + sin A sin B, proved by measuring one chord in two positions.
Four formulas usually arrive together: sine and cosine, each of a sum and of a difference. Only one of them has to be proved. The other three follow from it by substitution, and the traditional starting point is cos(A − B).
Put two points on the . P at angle A, so P = (cos A, sin A). Q at angle B, so Q = (cos B, sin B). The straight segment joining them is a . Measure its squared length with the distance formula, which is Pythagoras applied to the differences of the coordinates:
value at A = 50°, B = 20°
- PQ squared = (cos A − cos B) squared + (sin A − sin B) squared (cos A − cos B) squared is 0.088. (sin A − sin B) squared is 0.180. value 0.268
Expand both brackets.
= cos squared A − 2 cos A cos B + cos squared B + sin squared A − 2 sin A sin B + sin squared B value 0.268Reorder, so each function's two squares are next to each other. Nothing has changed but the order.
= (cos squared A + sin squared A) + (cos squared B + sin squared B) − 2 cos A cos B − 2 sin A sin B (cos squared A + sin squared A) is 1.000. (cos squared B + sin squared B) is 1.000. value 0.268Each bracket is 1, by sin² + cos² = 1 from page 2.
= 1 + 1 − 2 cos A cos B − 2 sin A sin B value 0.268Add the two ones, and take the common factor of −2 out.
PQ squared = 2 − 2(cos A cos B + sin A sin B) value 0.268
show this derivation as text
PQ squared = (cos A − cos B) squared + (sin A − sin B) squared (cos A − cos B) squared is 0.088. (sin A − sin B) squared is 0.180. Value 0.268. Expand both brackets. = cos squared A − 2 cos A cos B + cos squared B + sin squared A − 2 sin A sin B + sin squared B Value 0.268. Reorder, so each function's two squares are next to each other. Nothing has changed but the order. = (cos squared A + sin squared A) + (cos squared B + sin squared B) − 2 cos A cos B − 2 sin A sin B (cos squared A + sin squared A) is 1.000. (cos squared B + sin squared B) is 1.000. Value 0.268. Each bracket is 1, by sin² + cos² = 1 from page 2. = 1 + 1 − 2 cos A cos B − 2 sin A sin B Value 0.268. Add the two ones, and take the common factor of −2 out. PQ squared = 2 − 2(cos A cos B + sin A sin B) Value 0.268.
Teal underline: the sine family. Amber: the cosine family. There is no tangent in this block, so purple does not appear. The words stay in normal text colour. At A = 50° and B = 20°, cos A cos B = 0.604 and sin A sin B = 0.262. The right hand column is the value of that line, 0.268, and it is the same on every line because no step changed anything. Nothing here is coloured to mean plus or minus; the sign is the glyph.
Now measure the same chord a second time, from a different position. Rotate both points by minus B. Q lands on (1, 0) and P lands at angle A − B. Rotating moves both ends by the same amount and does not stretch the segment between them, so the length is unchanged. That is the rotational symmetry of the circle, and it is the one thing this proof assumes. Apply the distance formula again in the new position:
value at A = 50°, B = 20°
- PQ squared = (cos(A − B) − 1) squared + sin squared (A − B) (cos(A − B) − 1) squared is 0.018. sin squared (A − B) is 0.250. value 0.268
Expand, and the two squares add to 1 again.
= (cos squared (A − B) + sin squared (A − B)) − 2 cos(A − B) + 1 (cos squared (A − B) + sin squared (A − B)) is 1.000. value 0.268The bracket is 1, and that 1 and the one at the end make 2.
PQ squared = 2 − 2 cos(A − B) value 0.268
show this derivation as text
PQ squared = (cos(A − B) − 1) squared + sin squared (A − B) (cos(A − B) − 1) squared is 0.018. sin squared (A − B) is 0.250. Value 0.268. Expand, and the two squares add to 1 again. = (cos squared (A − B) + sin squared (A − B)) − 2 cos(A − B) + 1 (cos squared (A − B) + sin squared (A − B)) is 1.000. Value 0.268. The bracket is 1, and that 1 and the one at the end make 2. PQ squared = 2 − 2 cos(A − B) Value 0.268.
Teal underline: the sine family. Amber: the cosine family. There is no tangent in this block, so purple does not appear. The words stay in normal text colour. At A = 50° and B = 20°, A − B = 30° and cos(A − B) = 0.866. The right hand column is the value of that line, 0.268, which is the same length the block above measured, 0.268. That the two agree is the whole argument. Nothing here is coloured to mean plus or minus; the sign is the glyph.
The figure beside this step reaches that same expression by another route and labels the row the law of cosines. In the triangle OPQ two sides are radii of length 1, and the angle between them is A − B, so the law of cosines gives PQ² = 1 + 1 − 2 cos(A − B) in one line. Same number, same fact about the circle. The rotation above is the version that needs nothing beyond the distance formula, which is why it is the one written out here.
Two expressions for one length, so they are equal.
each side at A = 50°, B = 20°
- 2 − 2(cos A cos B + sin A sin B) = 2 − 2 cos(A − B) value 0.268 = 0.268
Subtract 2 from both sides.
−2(cos A cos B + sin A sin B) = −2 cos(A − B) value −1.732 = −1.732Divide both sides by −2. Dividing by a negative does not change an equality.
cos A cos B + sin A sin B = cos(A − B) value 0.866 = 0.866
show this derivation as text
2 − 2(cos A cos B + sin A sin B) = 2 − 2 cos(A − B) Value 0.268 = 0.268. Subtract 2 from both sides. −2(cos A cos B + sin A sin B) = −2 cos(A − B) Value −1.732 = −1.732. Divide both sides by −2. Dividing by a negative does not change an equality. cos A cos B + sin A sin B = cos(A − B) Value 0.866 = 0.866.
Teal underline: the sine family. Amber: the cosine family. There is no tangent in this block, so purple does not appear. The words stay in normal text colour. At A = 50° and B = 20° the right hand column prints both sides of the line, 0.268 = 0.268 on the first, and the two sides stay equal all the way down. The number itself changes, because subtracting 2 and dividing by −2 change it; what stays fixed is that the two sides agree, ending at 0.866 = 0.866. Nothing here is coloured to mean plus or minus; the sign is the glyph.
Nothing in that argument assumed the angles were acute, or positive, or that A was larger than B. It is coordinates and distances, and those work anywhere on the circle. That generality is the reason this is the formula to prove first. The picture in the next step is far easier to hold in your head, but it only draws itself while A, B and A + B all fit inside a right angle. The algebra covers the rest.
Check it on values you already know. A = 60 degrees, B = 30 degrees. cos A cos B is 0.5 × 0.866 = 0.433 and sin A sin B is 0.866 × 0.5 = 0.433, both to three decimal places. They add to 0.866. And cos(60 − 30) is cos(30 degrees), which is √3/2, or 0.866 to three decimal places.
Figure 7.2b
The chord check
Black: the radius, always exactly 1.
1 unit = 115 px.
Two points on the circle, at A and at B, with the straight line between them. The amber leg is the difference of the two cosines and the teal leg is the difference of the two sines, so Pythagoras on that triangle gives the square of the chord. The second row gets the same number a completely different way, from the law of cosines, and the only thing it needs is the angle between the two radii, which is A − B.
| route | arithmetic | on one 0 to 4 rule |
|---|---|---|
| chord² by coordinates | (cos A − cos B)² + (sin A − sin B)² = 0.088 + 0.180 = 0.268 | |
| chord² by the law of cosines | 2 − 2 cos(A − B) = 2 − 1.732 = 0.268 |
chord = 0.518. The two rows agree: 0.268 both ways.
One unit circle with a point at A, a point at B, and the straight chord between them. Where the two points are apart, the coordinate differences hang off that chord as the legs of a right triangle, and a small square marks the right angle. Set A equal to B and the chord shrinks to a single dot.
Under the drawing, a table with one row per route. The first column names the route, the second works it out, the third draws the result on a shared rule running from 0 to 4.
Read the two rows against each other. They reach the same squared length from different starting material, and the third column lets you see them land together without reading the digits.
Step 3 of 6
The rectangle worth remembering
A right triangle of hypotenuse 1 sitting on a tilted line, boxed into a rectangle, gives sin(A + B) and cos(A + B) from one drawing.
This is the construction worth remembering, because both plus formulas come out of it at once.
Start at the . Draw a line at angle A from the positive x axis. Build a right triangle on that line: its base lies along the line, its right angle sits at the far end of the base, and its hypotenuse has length exactly 1 and leaves the line at angle B.
The far vertex of that hypotenuse is then at angle A + B from the x axis and at distance 1 from the origin. By the definition from page 2, its coordinates are (cos(A + B), sin(A + B)).
Figure 7.2
The rectangle
P = (0.342, 0.940) = (cos 70°, sin 70°)
sin(A + B) = + = 0.720 + 0.220 = 0.940 and sin 70° is 0.940
cos(A + B) = − = 0.604 − 0.262 = 0.342 and cos 70° is 0.342
The rectangle's left edge is sin(A + B). The two teal pieces are the whole of it. Its bottom edge is cos A cos B, and the leftward arrow takes 0.262 off, which lands on cos(A + B) = 0.342.
Stage 6 of 6. sin A cos B is 0.720, cos A sin B is 0.220, and they stack to 0.940, which is sin of 70°. cos A cos B is 0.604, sin A sin B is 0.262, and the difference is 0.342, which is cos of 70°.
Vertical pieces are teal and horizontal pieces are amber, the same rule as the unit circle page. One tick marks angle A, two ticks mark angle B. The leftward arrowhead on sin A sin B is the minus sign in the cosine formula: nothing is coloured to say negative.
The construction, built in six stages by the numbered stepper: the ray at angle A and the radius out to P, a right triangle standing on that ray, its legs split into horizontal and vertical parts, a rail along each axis, and last the box, drawn only while it is still a genuine bounding box.
The segment strings are too long for a three unit square, so they sit in the keyed list under the drawing, one row per segment, each arriving with its stage.
Once the rails are drawn, read the left one first, then the bottom one. Point at a term in the formula block, a row naming a product, or a card in the next figure down, and every product segment fades except that term's own.
That inner triangle has hypotenuse 1 and angle B, so its two legs are cos B along the direction of A, and sin B perpendicular to that. Those two pieces are all there is to convert into a height and a width.
A segment of length L at angle A rises L sin A and runs L cos A. The first leg has length cos B and lies at angle A, so it rises cos B sin A and runs cos B cos A.
The second leg has length sin B and points a further quarter turn round, at angle A + 90 degrees. A segment at that angle rises sin B cos A and runs minus sin B sin A. Its run is negative because a quarter turn from A points it back towards the y axis.
Add the two legs and read off where the far vertex ends up:
sin(A + B) = sin A cos B + cos A sin B
cos(A + B) = cos A cos B − sin A sin B
Now the rectangle. Draw the box with horizontal and vertical sides that has the origin at its bottom left corner and the corner of the inner right triangle on its right edge.
Its height is sin(A + B), split by a horizontal line through the corner of the inner triangle into sin A cos B underneath and cos A sin B above. Its width is cos A cos B.
The far vertex sits on the top edge but short of the right hand corner, pulled in by sin A sin B, and the distance left between it and the vertical axis is cos(A + B). Every term in both formulas is a segment you can point at.
Check it against the counterexample from the first step. A = 60 degrees, B = 30 degrees. sin A cos B is 0.866 × 0.866, which is 3/4 exactly. cos A sin B is 0.5 × 0.5, which is 1/4 exactly. They add to 1, and sin(90 degrees) = 1. The wrong guess gave 1.366 for the same two angles.
One honest limit on the picture. It is drawn assuming A, B and A + B are all between 0 and 90 degrees, so that every piece is a positive length inside the box. Push past that and pieces go negative or change sides, and the drawing stops being the argument. The formulas still hold, because the chord proof in the previous step never used the drawing.
Step 4 of 6
Put minus B into the plus formulas
Put minus B into the plus formulas and each one turns into its minus version with a single sign changed.
There are not four formulas to derive. There are two, and then one substitution.
Page 4 established the symmetry: cos(−B) = cos B and sin(−B) = −sin B. Cosine is an and sine is an , because turning clockwise instead of anticlockwise reflects the point in the x axis, which leaves x alone and flips the sign of y.
A − B is A + (−B). So take the plus formulas from the last step and write −B wherever B appears:
sin(A − B) = sin A cos(−B) + cos A sin(−B) = sin A cos B − cos A sin B
cos(A − B) = cos A cos(−B) − sin A sin(−B) = cos A cos B + sin A sin B
In each case one term kept its sign and one term flipped, because one term contains sin(−B) and the other does not. The second result agrees with the chord proof from step 2, which is the check that the two derivations are consistent with each other.
All four together:
- sin(A + B) = sin A cos B + cos A sin B
- sin(A − B) = sin A cos B − cos A sin B
- cos(A + B) = cos A cos B − sin A sin B
- cos(A − B) = cos A cos B + sin A sin B
Figure 7.3
The sign flip: A − B is A + (−B)
B and −B
Black: the radius, always exactly 1. Amber solid: cos = 0.940. Teal solid: sin = 0.342.
1 unit = 100 px.
cos(−20°) = 0.940 = cos 20°. sin(−20°) = −0.342 = −sin 20°. The amber run is the same length and the same direction. The teal drop is the same length and the opposite direction.
A + B and A − B
Black: the radius, always exactly 1. Amber solid: cos = 0.342. Teal solid: sin = 0.940.
1 unit = 100 px.
A + B = 70°, A − B = 30°. Swapping A and B leaves A + B alone and negates A − B, so sin(A + B), cos(A + B) and cos(A − B) are unchanged and sin(A − B) is replaced by its negative.
| plus | minus | |
|---|---|---|
| sine | sin(A + B) sin(A + B) = sin A cos B+cos A sin B = 0.720 + 0.220 = 0.940 sin 70° = 0.940 sin A cos B = 0.720, cos A sin B = 0.220 | sin(A − B) sin(A − B) = sin A cos B−cos A sin B = 0.720 − 0.220 = 0.500 sin 30° = 0.500 sin A cos B = 0.720, cos A sin B = 0.220 |
| cosine | cos(A + B) cos(A + B) = cos A cos B−sin A sin B = 0.604 − 0.262 = 0.342 cos 70° = 0.342 cos A cos B = 0.604, sin A sin B = 0.262 | cos(A − B) cos(A − B) = cos A cos B+sin A sin B = 0.604 + 0.262 = 0.866 cos 30° = 0.866 cos A cos B = 0.604, sin A sin B = 0.262 |
Only the term with sin B in it can change, because sin(−B) = −sin B and cos(−B) = cos B. Sine has that term second and positive, so its sign follows the operation. Cosine has that term second and already negative, so its sign opposes the operation.
In each circle the solid point is the first angle its caption names and the hollow point is the second, so on the left the hollow point is B reflected in the x axis and on the right it is A − B, which is not a reflection of A + B. Teal is the vertical drop, amber the horizontal run. The shaded term in each card is the one containing sin B, which is the only thing a minus can reach.
Two unit circles, each drawing a pair of angles at once, one solid marker and one hollow. The pair is the point here, not the gap between them.
Under them, four cards, one per formula. They read in the order sine plus, sine minus, cosine plus, cosine minus: a two by two table where there is room, a single column where there is not.
Compare each plus card with the minus card that follows it. Both use the same pair of terms, so only a sign can differ.
Two things make them hard to misremember. The sign: cosine's sign is the opposite of the operation, and sine's sign matches it. Sum of angles, minus in the cosine formula and plus in the sine formula. Difference of angles, plus in the cosine formula and minus in the sine formula. And the pairing: sine mixes the two functions in both of its terms, sin cos and cos sin, while cosine keeps like with like, cos cos and sin sin.
One symmetry worth noticing. Three of the four are unchanged if you swap A and B. sin A cos B + cos A sin B reads the same both ways round, and so does cos A cos B − sin A sin B, so both sum formulas survive the swap. cos A cos B + sin A sin B is symmetric too, so cos(A − B) = cos(B − A).
Only sin(A − B) is different: swapping A and B turns sin A cos B − cos A sin B into its negative, so sin(A − B) = −sin(B − A). That is the odd symmetry of sine again, and it is the same fact as cos(−θ) = cos θ with sin(−θ) = −sin θ.
Step 5 of 6
Dividing the sine formula by the cosine formula
Dividing the sine formula by the cosine formula gives tan(A + B), and the product tan A tan B in its denominator is where it breaks.
Tangent is sine over cosine, from page 3, so divide the two formulas already derived. That is correct but useless, because it is written in sines and cosines rather than in tangents. Dividing the top and the bottom by cos A cos B fixes that and costs nothing, because dividing a fraction's numerator and denominator by the same quantity leaves its value alone. Watch the value column: it does not move.
value at A = 50°, B = 20°
- tan(A + B) = sin(A + B) / cos(A + B) sin(A + B) is 0.940. cos(A + B) is 0.342. value 2.747
Put in the sine and cosine formulas from the two steps above.
= (sin A cos B + cos A sin B) / (cos A cos B − sin A sin B) value 2.747Divide every term on the top and every term on the bottom by cos A cos B. The same quantity top and bottom, so the value cannot change. The right hand column is where you check that.
= (sin A cos B / cos A cos B + cos A sin B / cos A cos B) / (cos A cos B / cos A cos B − sin A sin B / cos A cos B) sin A cos B / cos A cos B is 1.192. cos A sin B / cos A cos B is 0.364. cos A cos B / cos A cos B is 1.000. sin A sin B / cos A cos B is 0.434. value 2.747Cancel. The first three share a factor top and bottom. The fourth cancels nothing: it splits into (sin A / cos A) times (sin B / cos B), which is tan A times tan B.
= (sin A cos B / cos A cos B + cos A sin B / cos A cos B) / (cos A cos B / cos A cos B − sin A sin B / cos A cos B) sin A cos B / cos A cos B cancels to tan A. cos A sin B / cos A cos B cancels to tan B. cos A cos B / cos A cos B cancels to 1. sin A sin B / cos A cos B becomes tan A tan B. value 2.747That is the formula, in tangents.
tan(A + B) = (tan A + tan B) / (1 − tan A tan B) tan A is 1.192. tan B is 0.364. 1 is 1.000. tan A tan B is 0.434. value 2.747
show this derivation as text
tan(A + B) = sin(A + B) / cos(A + B) sin(A + B) is 0.940. cos(A + B) is 0.342. Value 2.747. Put in the sine and cosine formulas from the two steps above. = (sin A cos B + cos A sin B) / (cos A cos B − sin A sin B) Value 2.747. Divide every term on the top and every term on the bottom by cos A cos B. The same quantity top and bottom, so the value cannot change. The right hand column is where you check that. = (sin A cos B / cos A cos B + cos A sin B / cos A cos B) / (cos A cos B / cos A cos B − sin A sin B / cos A cos B) sin A cos B / cos A cos B is 1.192. cos A sin B / cos A cos B is 0.364. cos A cos B / cos A cos B is 1.000. sin A sin B / cos A cos B is 0.434. Value 2.747. Cancel. The first three share a factor top and bottom. The fourth cancels nothing: it splits into (sin A / cos A) times (sin B / cos B), which is tan A times tan B. = (sin A cos B / cos A cos B + cos A sin B / cos A cos B) / (cos A cos B / cos A cos B − sin A sin B / cos A cos B) sin A cos B / cos A cos B cancels to tan A. cos A sin B / cos A cos B cancels to tan B. cos A cos B / cos A cos B cancels to 1. sin A sin B / cos A cos B becomes tan A tan B. Value 2.747. That is the formula, in tangents. tan(A + B) = (tan A + tan B) / (1 − tan A tan B) tan A is 1.192. tan B is 0.364. 1 is 1.000. tan A tan B is 0.434. Value 2.747.
Teal underline: the sine family. Amber: the cosine family. Purple: the tangent family. The words stay in normal text colour. At A = 50° and B = 20°, tan A = 1.192 and tan B = 0.364. The right hand column is the value of that line, 2.747, and it is the same on every line because no step changed anything. Nothing here is coloured to mean plus or minus; the sign is the glyph.
and replacing B by minus B, which negates tan B because tangent is odd:
value at A = 50°, B = 20°
- tan(A − B) = (tan A + tan(−B)) / (1 − tan A tan(−B)) value 0.577
Replace B by −B. Tangent is odd, so tan(−B) = −tan B, and only the two terms containing tan B change sign.
tan(A − B) = (tan A − tan B) / (1 + tan A tan B) value 0.577
show this derivation as text
tan(A − B) = (tan A + tan(−B)) / (1 − tan A tan(−B)) Value 0.577. Replace B by −B. Tangent is odd, so tan(−B) = −tan B, and only the two terms containing tan B change sign. tan(A − B) = (tan A − tan B) / (1 + tan A tan B) Value 0.577.
Purple underline: the tangent family; there is no sine and no cosine in this block, so teal and amber do not appear. The words stay in normal text colour. At A = 50° and B = 20°, tan A = 1.192 and tan B = 0.364, so tan(A − B) = 0.577 on both lines. The 1px boxes mark the two terms whose sign changed; they are grey, because a sign is a glyph and never a colour.
Check the plus version. A = 45 degrees, B = 30 degrees. tan(45 degrees) = 1 exactly and tan(30 degrees) = 1/√3, which is 0.577 to three decimal places. The numerator is 1.577, the denominator is 1 − 0.577 = 0.423, and the quotient is 3.732, all to three decimal places. tan(75 degrees) is 2 + √3, which is 3.732 to three decimal places.
Now the denominator. It reaches 0 when tan A tan B = 1, and dividing by 0 has no answer, so tan(A + B) is undefined there. That is not a defect of the formula.
Figure 7.4
Where the tangent formula blows up, and where it lies
Purple solid: tan = 2.747. Dashed grey uprights are the angles where the function is undefined.
Black curve: 1 − tan A tan B, plotted against B with A held at 50°. It is a plain number, not a tangent, so it wears no family colour. The hollow rings are where it reaches zero. The dashed uprights at B = ±90° are where tan B itself is undefined.
| formula | function |
|---|---|
| tan A = 1.192 | |
| tan B = 0.364 | |
| tan A × tan B = 0.434 | |
| tan A + tan B = 1.556 | |
| 1 − 0.434 = 0.566 | |
| (1.192 + 0.364) / 0.566 = 2.747 | tan(A + B) = tan 70° = 2.747 |
The formula and the function agree.
| B | 1 − tan A tan B | (tan A + tan B) / (1 − tan A tan B) |
|---|---|---|
| 25.00° | 0.192 | 11.430 |
| 28.00° | 0.079 | 28.636 |
| 29.50° | 0.020 | 114.6 |
| 29.90° | 0.004 | 573.0 |
| 29.99° | 0.000 | 5729.6 |
Two plots, one above the other, with the arithmetic under them.
The top plot is the tangent curve, drawn in separate pieces rather than joined across its , because it is not one connected curve. Its x axis is the tangent's own argument, so the marker on it tracks A + B.
The bottom plot moves with B. It draws the denominator 1 − tan A tan B against B, and there is a curve for every A that has a tangent. Where the value at the current B leaves the frame, its dot becomes a chevron at the edge.
Watch the denominator rather than the quotient. Wherever the formula can be written down at all, the denominator is the term that decides whether it has an answer.
Take A = 60 degrees and B = 30 degrees: tan A is √3, tan B is 1/√3, and their product is exactly 1. A + B is 90 degrees, and page 3 showed that tan(90 degrees) does not exist, because the radius becomes parallel to the tangent line and never meets it. The denominator going to zero is the algebra saying the same thing.
A note for anyone computing this rather than writing it down. In floating point the denominator is the only reliable test. The JavaScript function Math.tan at 90 degrees does not return infinity, it returns roughly 1.633 × 10¹⁶, because the angle in radians is not exactly π/2 and cannot be. A finiteness check will pass on that number and report a value where there is none. Test whether the denominator is within a small tolerance of 0 instead.
The division by cos A cos B carries its own condition. It is not allowed when either cosine is 0, so the tangent formulas say nothing about A or B being 90 degrees, where tangent is undefined to begin with. The sine and cosine formulas have no such gap and hold for every pair of angles.
Step 6 of 6
Two places these formulas do real work
Two places these formulas do real work: adding waves of the same frequency, and composing two rotations.
Adding two waves. Suppose you have a sin x and b cos x, two waves of the same but a quarter period apart, with different heights. Add them and you get one wave, of the same period, with a new height and a shift.
Write the claim as a sin x + b cos x = R sin(x + φ) and the compound angle formula proves it. Expand the right hand side: R sin(x + φ) = R cos φ sin x + R sin φ cos x.
Match the coefficients, so a = R cos φ and b = R sin φ. Then a² + b² = R²(cos²φ + sin²φ) = R², so R = √(a² + b²), and dividing gives tan φ = b / a.
Take a = 3 and b = 4. R is √(9 + 16) = 5 exactly, and φ is the angle whose tangent is 4/3, which is 53.130 degrees to three decimal places. So 3 sin x + 4 cos x is 5 sin(x + 53.130 degrees), the same curve drawn a shorter way.
Figure 7.5
Two waves add to one wave
Teal curve: the first ingredient, a · sin x, on its own at amplitude 3.000.
Amber curve: the second ingredient, b · cos x, on its own at amplitude 4.000.
Teal band: the two waves added point by point. Thin teal line inside it: R sin(x + φ) with R = 5.000 and φ = 53.130°. They are the same curve, which is why the thin line never leaves the band. The rings on the axis are 180° apart, the same spacing as the zeros of sin x, so the sum has the same period as its parts. Only the height and the starting point changed.
R = √(3.000² + 4.000²) = 5.000
φ = 53.130° = 0.9273 rad
largest gap between the two curves: 0.000
a sin x + b cos x at x = 30°: 1.500 + 3.464 = 4.964
R sin(x + φ) at x = 30°: 5.000 × sin 83.130° = 4.964
Vertical scale runs from −6.000 to 6.000, recomputed from R, which is 5.000.
R sin(x + φ) = R sin x cos φ + R cos x sin φ, so a = R cos φ = 5.000 × 0.600 = 3.000 and b = R sin φ = 5.000 × 0.800 = 4.000.
Three panels, with the arithmetic under them. Two are the ingredients on their own, a · sin x and b · cos x, side by side where the figure is wide enough and stacked where it is not. The third is taller and holds their sum, with a second curve drawn inside it. Look at that panel first: the question is whether the two curves are one curve.
The consequence matters more than the formula. Adding sinusoids of one frequency can change the and change the , and cannot produce any other frequency. That is why alternating current analysis replaces each sinusoid with a , a single amplitude and phase, and adds those instead of adding curves. It is also why a sum of sines at one frequency never grows a second one, which is the property that makes circuit analysis work at all.
Rotating a point. Page 6 gave the rotation: turning (x, y) about the origin by angle θ sends it to (x cos θ − y sin θ, x sin θ + y cos θ), and the four numbers involved are the entries of a . Rotate by A, then rotate the result by B. Geometrically that has to be the same as rotating once by A + B, because turning through one angle and then another is turning through their total.
Figure 7.6
Composing rotations
cos B 0.940 | −sin B −0.342 |
sin B 0.342 | cos B 0.940 |
cos A 0.643 | −sin A −0.766 |
sin A 0.766 | cos A 0.643 |
cos (A + B) 0.342 | −sin (A + B) −0.940 |
sin (A + B) 0.940 | cos (A + B) 0.342 |
R(B) × R(A) = R(A + B)
- start: (1.000, 0.000)
- after turning by A: (0.643, 0.766)
- after turning by B as well: (0.604 − 0.262, 0.220 + 0.720) = (0.342, 0.940)
- one turn of A + B = 70°: (0.342, 0.940)
- largest difference over the six corners: 0.000
The two step image and the one step image are the same shape in the same place.
The four numbers multiplied together to make that top left entry are cos A cos B = 0.604 and sin A sin B = 0.262, which are the two amber pieces of the rectangle in figure 7.2. The top right entry uses the two teal pieces, 0.720 and 0.220. The matrix product and the rectangle are the same four products.
Two turns land the unit point at 0.342, 0.940. One turn of 70° lands it at 0.342, 0.940. Largest difference over the six corners is 0.000.
Every outline is named at one of its own corners: start, after A, after A + B, and one turn, which is the dashed one. Each arc carries its letter, and keeps one tick for A and two for B. The one turn outline is drawn exactly on top of the after A + B outline rather than offset, because landing in the same place is the result, so the two names sit at opposite corners of what looks like a single shape.
The second figure rotates a six cornered L shape. The stepper turns it first by A, then by B as well. Three matrices and a list of landing points sit beside the drawing where there is room, and under it where there is not. The list says where the point (1, 0) ends up by each route. Read its last row first: it measures how far apart the two routes finish.
Multiply the two matrices out and see what the entries are.
value at A = 50°, B = 20°
The top left entry is the top row of the first matrix, times the left column of the second.
(cos B)(cos A) + (−sin B)(sin A) (cos B)(cos A) is 0.604. (−sin B)(sin A) is −0.262. value 0.342Multiply out.
= cos A cos B − sin A sin B value 0.342Which is the cosine formula from step 3.
= cos(A + B) value 0.342 = 0.342
show this derivation as text
The top left entry is the top row of the first matrix, times the left column of the second. (cos B)(cos A) + (−sin B)(sin A) (cos B)(cos A) is 0.604. (−sin B)(sin A) is −0.262. Value 0.342. Multiply out. = cos A cos B − sin A sin B Value 0.342. Which is the cosine formula from step 3. = cos(A + B) Value 0.342 = 0.342.
Teal underline: the sine family. Amber: the cosine family. There is no tangent in this block, so purple does not appear. The words stay in normal text colour. At A = 50° and B = 20°, cos A cos B = 0.604 and sin A sin B = 0.262, so the entry is 0.342. The last line prints both sides, and cos(A + B) is 0.342 as well. Nothing here is coloured to mean plus or minus; the sign is the glyph.
The bottom left entry is the bottom row of that first matrix against the same left column, and it comes to sin A cos B + cos A sin B, which is sin(A + B). The other two entries are those same two formulas over again, with the top right one negated. The compound angle formulas are what makes the two routes agree, and they are the reason a graphics engine can collapse a chain of rotations into a single angle before touching any vertices.
Challenge
Figure 7.5
Two waves add to one wave
Try it Neither amplitude goes past 5. Can these two waves add to one wave 6 tall?
Not yet Peak height 5.000. Not 6 yet.
Teal curve: the first ingredient, a · sin x, on its own at amplitude 3.000.
Amber curve: the second ingredient, b · cos x, on its own at amplitude 4.000.
Teal band: the two waves added point by point. Thin teal line inside it: R sin(x + φ) with R = 5.000 and φ = 53.130°. They are the same curve, which is why the thin line never leaves the band. The rings on the axis are 180° apart, the same spacing as the zeros of sin x, so the sum has the same period as its parts. Only the height and the starting point changed.
R = √(3.000² + 4.000²) = 5.000
φ = 53.130° = 0.9273 rad
largest gap between the two curves: 0.000
a sin x + b cos x at x = 30°: 1.500 + 3.464 = 4.964
R sin(x + φ) at x = 30°: 5.000 × sin 83.130° = 4.964
Vertical scale runs from −6.000 to 6.000, recomputed from R, which is 5.000.
R sin(x + φ) = R sin x cos φ + R cos x sin φ, so a = R cos φ = 5.000 × 0.600 = 3.000 and b = R sin φ = 5.000 × 0.800 = 4.000.