The relationship between sine and cosine

The graphs of y=sinxy = \sin x and y=cosxy = \cos x have exactly the same shape and differ only by a horizontal shift. Here we confirm that relationship with formulas.

The translation

The cosine is the sine shifted left by π2\dfrac{\pi}{2}.

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

Shifting a graph left by π2\dfrac{\pi}{2} amounts to replacing xx with x+π2x + \dfrac{\pi}{2}, and the crests of the sine then land exactly on the crests of the cosine. In general y=f(xa)y = f(x - a) is the graph shifted right by aa, so a +π2+\dfrac{\pi}{2} produces a shift to the left. The sign is easy to read backwards, so it is worth some care.

Checking with the crests

FunctionWhere the maximum fallsZeros
y=sinxy = \sin xπ2+2nπ\dfrac{\pi}{2} + 2n\pinπn\pi
y=cosxy = \cos x2nπ2n\piπ2+nπ\dfrac{\pi}{2} + n\pi

The crest of the cosine sits π2\dfrac{\pi}{2} to the left of the crest of the sine, which is exactly the amount of the shift. The zeros are displaced by the same amount.

Seeing it on the unit circle

The relationship is clearest on the unit circle. For a point on that circle the cosine is the horizontal coordinate and the sine is the vertical one. Advancing the angle by π2\dfrac{\pi}{2} rotates the point by 9090^\circ, so the present vertical coordinate becomes the next horizontal one.

sin(θ+π2)=cosθ\sin\left(\theta + \frac{\pi}{2}\right) = \cos\theta

The shift that differentiation produces

Since (sinx)=cosx(\sin x)' = \cos x, differentiation can be read as an operation that shifts the wave left by π2\dfrac{\pi}{2}.

Times differentiatedResultTotal shift
11cosx\cos xπ2\dfrac{\pi}{2}
22sinx-\sin xπ\pi
33cosx-\cos x3π2\dfrac{3\pi}{2}
44sinx\sin x2π2\pi

That four differentiations return the original fits this reading: the total shift is a full 2π2\pi.

The relation the other way round

Equally, the sine is the cosine shifted right by π2\dfrac{\pi}{2}.

sinx=cos(xπ2)\sin x = \cos\left(x - \frac{\pi}{2}\right)

Phase difference

This displacement between two waves is called the phase difference. It is a basic idea in applications, such as the current through an inductor or a capacitor in an alternating-current circuit running π2\dfrac{\pi}{2} out of step with the voltage.

The large dots on the graph are the crest of the cosine at (0,1)(0, 1) and the crest of the sine at (π2,1)\left( \dfrac{\pi}{2}, 1 \right).