Combining sine and cosine

Consider the graph of y=sinx+cosxy = \sin x + \cos x. Using the combination of trigonometric functions, the two waves collapse into a single sine.

Combining

sinx+cosx=2sin(x+π4)\sin x + \cos x = \sqrt{2}\,\sin\left(x + \frac{\pi}{4}\right)

This has amplitude 2\sqrt{2} and is the graph of y=sinxy = \sin x shifted left by π4\dfrac{\pi}{4}. The values run between 2-\sqrt{2} and 2\sqrt{2}, and the maximum 2\sqrt{2} is reached where x+π4=π2x + \dfrac{\pi}{4} = \dfrac{\pi}{2}, that is at x=π4x = \dfrac{\pi}{4}.

Where the 2\sqrt{2} and the π4\dfrac{\pi}{4} come from

Running the addition formula backwards explains both. Expanding the right-hand side gives the following.

2sin(x+π4)=2(sinxcosπ4+cosxsinπ4)=2(22sinx+22cosx)=sinx+cosx\begin{align*} \sqrt{2}\,\sin\left(x + \frac{\pi}{4}\right) &= \sqrt{2}\left(\sin x \cos\frac{\pi}{4} + \cos x \sin\frac{\pi}{4}\right) \\ &= \sqrt{2}\left(\frac{\sqrt{2}}{2}\sin x + \frac{\sqrt{2}}{2}\cos x\right) \\ &= \sin x + \cos x \end{align*}

It does return to the left-hand side.

The general combination

asinx+bcosx=a2+b2sin(x+α)a\sin x + b\cos x = \sqrt{a^2 + b^2}\,\sin(x + \alpha)

Here α\alpha is the angle determined by tanα=ba\tan\alpha = \dfrac{b}{a}. The formula can also be read as saying that the length of the point (a,b)(a, b) is the amplitude and its argument is the phase shift.

Point (a,b)(a, b)Amplitude a2+b2\sqrt{a^2+b^2}Phase α\alpha
(1,1)(1, 1)2\sqrt{2}π4\dfrac{\pi}{4}
(1,0)(1, 0)1100
(0,1)(0, 1)11π2\dfrac{\pi}{2}
(3,1)(\sqrt{3}, 1)22π6\dfrac{\pi}{6}

In our case the point (1,1)(1, 1) has length 2\sqrt{2} and argument π4\dfrac{\pi}{4}.

What the combination is saying

What the combination says is that adding sine waves of the same period gives a sine wave of that same period. Only the amplitude and the phase change; the shape of the wave and its period do not.

That is why adding sinx\sin x and cosx\cos x produces no new kind of wave, only a sine wave slightly taller and slightly shifted to the left. The property is the foundation for superposing two voltages in an alternating-current circuit and for computing the interference of several waves.

The horizontal lines y=±2y = \pm\sqrt{2} show the amplitude, and the large dot is the maximum at (π4,2)\left( \dfrac{\pi}{4}, \sqrt{2} \right).