TExcelTAD
Home › Pre-Calculus, Geometry & Trigonometry › Sum, Difference and Double-Angle Formulas

Sum, Difference and Double-Angle Formulas

What is sin⁡(α+β)\sin(\alpha + \beta)? It is not sin⁡α+sin⁡β\sin\alpha + \sin\beta. This lesson proves the correct sum formulas twice, once with rotations and once with distances, and derives the double- and half-angle formulas from them.

The formulas

sin⁡(α+β)=sin⁡αcos⁡β+cos⁡αsin⁡βsin⁡(α−β)=sin⁡αcos⁡β−cos⁡αsin⁡βcos⁡(α+β)=cos⁡αcos⁡β−sin⁡αsin⁡βcos⁡(α−β)=cos⁡αcos⁡β+sin⁡αsin⁡βtan⁡(α+β)=tan⁡α+tan⁡β1−tan⁡αtan⁡β\begin{aligned} \sin(\alpha + \beta) &= \sin\alpha\cos\beta + \cos\alpha\sin\beta \\ \sin(\alpha - \beta) &= \sin\alpha\cos\beta - \cos\alpha\sin\beta \\ \cos(\alpha + \beta) &= \cos\alpha\cos\beta - \sin\alpha\sin\beta \\ \cos(\alpha - \beta) &= \cos\alpha\cos\beta + \sin\alpha\sin\beta \\ \tan(\alpha + \beta) &= \frac{\tan\alpha + \tan\beta}{1 - \tan\alpha\tan\beta} \end{aligned}

A quick sanity check shows that the naive guess fails: sin⁡(30∘+60∘)=sin⁡90∘=1\sin(30^\circ + 60^\circ) = \sin 90^\circ = 1, but sin⁡30∘+sin⁡60∘=12+32≈1.366\sin 30^\circ + \sin 60^\circ = \frac{1}{2} + \frac{\sqrt{3}}{2} \approx 1.366.

Proof 1: composing rotations

Rotating a point (x,y)(x, y) about the origin by an angle θ\theta sends it to (xcos⁡θ−ysin⁡θ,xsin⁡θ+ycos⁡θ)(x\cos\theta - y\sin\theta, x\sin\theta + y\cos\theta). (Check it on (1,0)(1, 0), which goes to (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta), and on (0,1)(0, 1), which goes to (−sin⁡θ,cos⁡θ)(-\sin\theta, \cos\theta), a quarter turn ahead.) As a matrix:

R(θ)=[cos⁡θ−sin⁡θsin⁡θcos⁡θ]R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}

Rotating by β\beta and then by α\alpha is the same as rotating once by α+β\alpha + \beta, so R(α)⋅R(β)=R(α+β)R(\alpha) \cdot R(\beta) = R(\alpha + \beta). Multiply the left side out:

R(α)⋅R(β)=[cos⁡αcos⁡β−sin⁡αsin⁡β−(sin⁡αcos⁡β+cos⁡αsin⁡β)sin⁡αcos⁡β+cos⁡αsin⁡βcos⁡αcos⁡β−sin⁡αsin⁡β]R(α+β)=[cos⁡(α+β)−sin⁡(α+β)sin⁡(α+β)cos⁡(α+β)]\begin{aligned} R(\alpha) \cdot R(\beta) &= \begin{bmatrix} \cos\alpha\cos\beta - \sin\alpha\sin\beta & -(\sin\alpha\cos\beta + \cos\alpha\sin\beta) \\ \sin\alpha\cos\beta + \cos\alpha\sin\beta & \cos\alpha\cos\beta - \sin\alpha\sin\beta \end{bmatrix} \\[1ex] R(\alpha + \beta) &= \begin{bmatrix} \cos(\alpha+\beta) & -\sin(\alpha+\beta) \\ \sin(\alpha+\beta) & \cos(\alpha+\beta) \end{bmatrix} \end{aligned}

Matching the entries gives both sum formulas at once. Replacing β\beta by −β-\beta (and using cos⁡(−β)=cos⁡β\cos(-\beta) = \cos\beta, sin⁡(−β)=−sin⁡β\sin(-\beta) = -\sin\beta) gives the difference formulas. SymPy does the matrix product for us:

python · try it yourself
import sympy as sp

a, b = sp.symbols("alpha beta")

def R(t):
    return sp.Matrix([[sp.cos(t), -sp.sin(t)], [sp.sin(t), sp.cos(t)]])

P = R(a) * R(b)
print("top-left   :", P[0, 0])
print("bottom-left:", P[1, 0])
print("equal to R(a+b)?", sp.simplify(P - R(a + b)) == sp.zeros(2, 2))
top-left   : -sin(alpha)*sin(beta) + cos(alpha)*cos(beta)
bottom-left: sin(alpha)*cos(beta) + sin(beta)*cos(alpha)
equal to R(a+b)? True

The top-left entry is cos⁡(α+β)\cos(\alpha + \beta) and the bottom-left entry is sin⁡(α+β)\sin(\alpha + \beta), exactly as claimed. The rotation fact itself is shown in Translations, Reflections and Rotations, and the matrix view comes back in rotation in 2D.

Proof 2: equal chords

Here is a proof that uses only the distance formula. Put A=(cos⁡α,sin⁡α)A = (\cos\alpha, \sin\alpha) and B=(cos⁡β,sin⁡β)B = (\cos\beta, \sin\beta) on the unit circle. The angle between them is α−β\alpha - \beta. Compute the squared distance ∣AB∣2\lvert AB \rvert^2 in two ways.

Directly:∣AB∣2=(cos⁡α−cos⁡β)2+(sin⁡α−sin⁡β)2=(cos⁡2α+sin⁡2α)+(cos⁡2β+sin⁡2β)−2(cos⁡αcos⁡β+sin⁡αsin⁡β)=2−2(cos⁡αcos⁡β+sin⁡αsin⁡β)After rotating the picture by −β (distances do not change), B goes to (1,0)and A goes to (cos⁡(α−β),sin⁡(α−β)):∣AB∣2=(cos⁡(α−β)−1)2+sin⁡2(α−β)=2−2cos⁡(α−β)Compare:cos⁡(α−β)=cos⁡αcos⁡β+sin⁡αsin⁡β\begin{aligned} &\text{Directly:} \\ \lvert AB \rvert^2 &= (\cos\alpha - \cos\beta)^2 + (\sin\alpha - \sin\beta)^2 \\ &= (\cos^2\alpha + \sin^2\alpha) + (\cos^2\beta + \sin^2\beta) - 2(\cos\alpha\cos\beta + \sin\alpha\sin\beta) \\ &= 2 - 2(\cos\alpha\cos\beta + \sin\alpha\sin\beta) \\[1ex] &\text{After rotating the picture by } -\beta \text{ (distances do not change), } B \text{ goes to } (1, 0) \\ &\text{and } A \text{ goes to } (\cos(\alpha-\beta), \sin(\alpha-\beta)) \text{:} \\ \lvert AB \rvert^2 &= (\cos(\alpha-\beta) - 1)^2 + \sin^2(\alpha-\beta) = 2 - 2\cos(\alpha-\beta) \\[1ex] &\text{Compare:} \quad \cos(\alpha - \beta) = \cos\alpha\cos\beta + \sin\alpha\sin\beta \end{aligned}

Every other formula follows from this one: put −β-\beta for β\beta to get cos⁡(α+β)\cos(\alpha + \beta), and use sin⁡θ=cos⁡(π/2−θ)\sin\theta = \cos(\pi/2 - \theta) to turn it into the sine formulas. Dividing the sine formula by the cosine formula, then dividing top and bottom by cos⁡αcos⁡β\cos\alpha\cos\beta, gives the tangent formula.

Double- and half-angle formulas

Put β=α\beta = \alpha in the sum formulas:

sin⁡2α=2sin⁡αcos⁡αcos⁡2α=cos⁡2α−sin⁡2α=2cos⁡2α−1=1−2sin⁡2αtan⁡2α=2tan⁡α1−tan⁡2α\begin{aligned} \sin 2\alpha &= 2\sin\alpha\cos\alpha \\ \cos 2\alpha &= \cos^2\alpha - \sin^2\alpha = 2\cos^2\alpha - 1 = 1 - 2\sin^2\alpha \\ \tan 2\alpha &= \frac{2\tan\alpha}{1 - \tan^2\alpha} \end{aligned}

The last two forms of cos⁡2α\cos 2\alpha come from replacing sin⁡2α\sin^2\alpha or cos⁡2α\cos^2\alpha using sin⁡2+cos⁡2=1\sin^2 + \cos^2 = 1. Solving them for cos⁡2α\cos^2\alpha and sin⁡2α\sin^2\alpha gives the power-reduction and half-angle formulas, much used in calculus:

cos⁡2α=1+cos⁡2α2sin⁡2α=1−cos⁡2α2cos⁡α2=±1+cos⁡α2sin⁡α2=±1−cos⁡α2\begin{aligned} \cos^2\alpha &= \frac{1 + \cos 2\alpha}{2} & \sin^2\alpha &= \frac{1 - \cos 2\alpha}{2} \\ \cos\frac{\alpha}{2} &= \pm\sqrt{\frac{1 + \cos\alpha}{2}} & \sin\frac{\alpha}{2} &= \pm\sqrt{\frac{1 - \cos\alpha}{2}} \end{aligned}

The sign is chosen by the quadrant of α/2\alpha/2. Example: cos⁡15∘=cos⁡(45∘−30∘)\cos 15^\circ = \cos(45^\circ - 30^\circ) exactly, and also cos⁡15∘=1+cos⁡30∘2\cos 15^\circ = \sqrt{\frac{1 + \cos 30^\circ}{2}}:

python · try it yourself
import sympy as sp

d = sp.pi / 180
via_difference = sp.cos(45*d)*sp.cos(30*d) + sp.sin(45*d)*sp.sin(30*d)
via_half_angle = sp.sqrt((1 + sp.cos(30*d)) / 2)
print("difference formula:", via_difference, "≈", sp.N(via_difference, 10))
print("half-angle formula:", via_half_angle, "≈", sp.N(via_half_angle, 10))
print("cos 15° numerically:", sp.N(sp.cos(15*d), 10))
print("expand_trig(sin(3x)):", sp.expand_trig(sp.sin(3*sp.Symbol('x'))))
difference formula: sqrt(2)/4 + sqrt(6)/4 ≈ 0.9659258263
half-angle formula: sqrt(sqrt(3)/4 + 1/2) ≈ 0.9659258263
cos 15° numerically: 0.9659258263
expand_trig(sin(3x)): -4*sin(x)**3 + 3*sin(x)

So cos⁡15∘=6+24\cos 15^\circ = \frac{\sqrt{6} + \sqrt{2}}{4}, which equals 2+32\frac{\sqrt{2 + \sqrt{3}}}{2} even though the two look different.

In software

  • Incremental rotation. To rotate a sprite by a small fixed step δ\delta each frame, you do not need sin and cos every frame. The sum formulas give cos⁡(θ+δ)\cos(\theta+\delta) and sin⁡(θ+δ)\sin(\theta+\delta) from the previous values with four multiplications. This is how cheap oscillators and old demo-scene effects generated circles.
  • Audio oscillators. The identity sin⁡(θ+δ)=2cos⁡δ⋅sin⁡θ−sin⁡(θ−δ)\sin(\theta + \delta) = 2\cos\delta \cdot \sin\theta - \sin(\theta - \delta) (add the sum and difference formulas) produces a sine wave with one multiply and one subtract per sample.
  • Graphics shaders use the double-angle formulas to get cos⁡2θ\cos 2\theta from cos⁡θ\cos\theta without a second trig call.
python · try it yourself
import math

delta = math.radians(1)          # 1° per step
c, s = 1.0, 0.0                  # cos 0, sin 0
cd, sd = math.cos(delta), math.sin(delta)
for step in range(360):
    c, s = c * cd - s * sd, s * cd + c * sd      # sum formulas
print("after 360 steps:", round(c, 12), round(s, 12) + 0.0)

# two-term recurrence for a sine wave
k = 2 * math.cos(delta)
prev, cur = math.sin(-delta), 0.0
for _ in range(30):
    prev, cur = cur, k * cur - prev
print("recurrence sin 30°:", round(cur, 12), " math.sin:", round(math.sin(math.radians(30)), 12))
after 360 steps: 1.0 0.0
recurrence sin 30°: 0.5  math.sin: 0.5

Note: Rounding errors accumulate in such recurrences over millions of steps. Real code renormalises (divide (c,s)(c, s) by its length now and then) or recomputes from the true angle occasionally.

Exercises

Exercise 1: An exact value

Find sin⁡75∘\sin 75^\circ exactly using a sum formula.

Answer

sin⁡75∘=6+24≈0.9659\sin 75^\circ = \frac{\sqrt{6} + \sqrt{2}}{4} \approx 0.9659.

Solution
sin⁡75∘=sin⁡(45∘+30∘)=sin⁡45∘cos⁡30∘+cos⁡45∘sin⁡30∘=(22)(32)+(22)(12)=6+24\begin{aligned} \sin 75^\circ &= \sin(45^\circ + 30^\circ) = \sin 45^\circ\cos 30^\circ + \cos 45^\circ\sin 30^\circ \\ &= \left(\frac{\sqrt{2}}{2}\right)\left(\frac{\sqrt{3}}{2}\right) + \left(\frac{\sqrt{2}}{2}\right)\left(\frac{1}{2}\right) = \frac{\sqrt{6} + \sqrt{2}}{4} \end{aligned}

Exercise 2: Combine two angles

α\alpha and β\beta are acute with sin⁡α=35\sin\alpha = \frac{3}{5} and cos⁡β=513\cos\beta = \frac{5}{13}. Find cos⁡(α+β)\cos(\alpha + \beta) and sin⁡(α−β)\sin(\alpha - \beta).

Answer

cos⁡(α+β)=−1665\cos(\alpha + \beta) = -\frac{16}{65}, sin⁡(α−β)=−3365\sin(\alpha - \beta) = -\frac{33}{65}.

Solution
cos⁡α=45,sin⁡β=1213(acute, so positive)cos⁡(α+β)=(45)(513)−(35)(1213)=2065−3665=−1665sin⁡(α−β)=(35)(513)−(45)(1213)=1565−4865=−3365\begin{aligned} \cos\alpha &= \tfrac{4}{5}, \quad \sin\beta = \tfrac{12}{13} && \text{(acute, so positive)} \\ \cos(\alpha+\beta) &= \left(\tfrac{4}{5}\right)\left(\tfrac{5}{13}\right) - \left(\tfrac{3}{5}\right)\left(\tfrac{12}{13}\right) = \tfrac{20}{65} - \tfrac{36}{65} = -\tfrac{16}{65} \\ \sin(\alpha-\beta) &= \left(\tfrac{3}{5}\right)\left(\tfrac{5}{13}\right) - \left(\tfrac{4}{5}\right)\left(\tfrac{12}{13}\right) = \tfrac{15}{65} - \tfrac{48}{65} = -\tfrac{33}{65} \end{aligned}
python · try it yourself
import math
a, b = math.asin(3/5), math.acos(5/13)
print(round(math.cos(a + b), 6), round(-16/65, 6), round(math.sin(a - b), 6), round(-33/65, 6))
-0.246154 -0.246154 -0.507692 -0.507692

Exercise 3: Double angle

If cos⁡θ=−13\cos\theta = -\frac{1}{3} and θ\theta is in quadrant II, find sin⁡2θ\sin 2\theta and cos⁡2θ\cos 2\theta.

Answer

sin⁡2θ=−429≈−0.6285\sin 2\theta = -\frac{4\sqrt{2}}{9} \approx -0.6285, cos⁡2θ=−79\cos 2\theta = -\frac{7}{9}.

Solution
sin⁡θ=+1−19=89=223(positive in quadrant II)sin⁡2θ=2sin⁡θcos⁡θ=2⋅223⋅(−13)=−429cos⁡2θ=2cos⁡2θ−1=29−1=−79\begin{aligned} \sin\theta &= +\sqrt{1 - \tfrac{1}{9}} = \sqrt{\tfrac{8}{9}} = \frac{2\sqrt{2}}{3} && \text{(positive in quadrant II)} \\ \sin 2\theta &= 2\sin\theta\cos\theta = 2 \cdot \frac{2\sqrt{2}}{3} \cdot \left(-\frac{1}{3}\right) = -\frac{4\sqrt{2}}{9} \\ \cos 2\theta &= 2\cos^2\theta - 1 = \frac{2}{9} - 1 = -\frac{7}{9} \end{aligned}

Exercise 4: Triple angle

Prove cos⁡3x=4cos⁡3x−3cos⁡x\cos 3x = 4\cos^3 x - 3\cos x, then check it with SymPy.

Answer

The identity holds; SymPy's difference is 0.

Solution
cos⁡3x=cos⁡(2x+x)=cos⁡2xcos⁡x−sin⁡2xsin⁡x=(2cos⁡2x−1)cos⁡x−2sin⁡2xcos⁡x=2cos⁡3x−cos⁡x−2(1−cos⁡2x)cos⁡x=4cos⁡3x−3cos⁡x\begin{aligned} \cos 3x &= \cos(2x + x) = \cos 2x\cos x - \sin 2x\sin x \\ &= (2\cos^2 x - 1)\cos x - 2\sin^2 x\cos x \\ &= 2\cos^3 x - \cos x - 2(1 - \cos^2 x)\cos x \\ &= 4\cos^3 x - 3\cos x \end{aligned}
python · try it yourself
import sympy as sp
x = sp.Symbol("x")
print(sp.simplify(sp.expand_trig(sp.cos(3*x)) - (4*sp.cos(x)**3 - 3*sp.cos(x))))
0

Exercise 5: Rotate without trig calls

Starting from (c,s)=(1,0)(c, s) = (1, 0), apply the incremental rotation with δ=3∘\delta = 3^\circ for 30 steps. Print the final (c,s)(c, s) rounded to 6 decimals and compare with cos⁡90∘\cos 90^\circ, sin⁡90∘\sin 90^\circ.

Answer

(0.0,1.0)(0.0, 1.0), matching (cos⁡90∘,sin⁡90∘)(\cos 90^\circ, \sin 90^\circ).

Solution
python · try it yourself
import math
d = math.radians(3)
cd, sd = math.cos(d), math.sin(d)
c, s = 1.0, 0.0
for _ in range(30):
    c, s = c * cd - s * sd, s * cd + c * sd
print(round(c, 6) + 0.0, round(s, 6))
0.0 1.0

Test yourself

Which formula is correct?

  1. cos⁡(α+β)=cos⁡α+cos⁡β\cos(\alpha + \beta) = \cos\alpha + \cos\beta
  2. cos⁡(α+β)=cos⁡αcos⁡β+sin⁡αsin⁡β\cos(\alpha + \beta) = \cos\alpha\cos\beta + \sin\alpha\sin\beta
  3. cos⁡(α+β)=cos⁡αcos⁡β−sin⁡αsin⁡β\cos(\alpha + \beta) = \cos\alpha\cos\beta - \sin\alpha\sin\beta
  4. cos⁡(α+β)=sin⁡αcos⁡β+cos⁡αsin⁡β\cos(\alpha + \beta) = \sin\alpha\cos\beta + \cos\alpha\sin\beta

Which of these is NOT a correct form of cos⁡2θ\cos 2\theta?

  1. cos⁡2θ−sin⁡2θ\cos^2\theta - \sin^2\theta
  2. 2cos⁡2θ−12\cos^2\theta - 1
  3. 1−2sin⁡2θ1 - 2\sin^2\theta
  4. 2sin⁡θcos⁡θ2\sin\theta\cos\theta

Why does R(α)⋅R(β)=R(α+β)R(\alpha) \cdot R(\beta) = R(\alpha + \beta) prove the sum formulas?

  1. Because matrix multiplication is commutative
  2. Because rotating by β\beta then α\alpha is one rotation by α+β\alpha + \beta, so matching matrix entries gives the formulas
  3. Because the determinant of R is 1
  4. It only proves them for acute angles