Book contents
Contents
raw Math

Repeatedly differentiating sine or cosine does not create increasingly complicated functions. The derivatives cycle through the same two functions with changing signs:

\[ \sin x\to\cos x\to-\sin x\to-\cos x\to\sin x\to\cdots. \]

This four-step cycle has a compact description. Each differentiation advances the phase by one quarter turn, making an arbitrary derivative order as easy to evaluate as the first derivative.

Higher Derivatives

For a sufficiently differentiable function \(f\), define its derivatives recursively by

\[ f^{(0)}=f, \qquad f^{(n+1)}=\frac{d}{dx}f^{(n)} \quad(n\ge0). \]

The superscript in \(f^{(n)}\) denotes the number of differentiations, not an ordinary power. The zeroth derivative is included so that formulas for arbitrary \(n\) also recover the original function.

Differentiation as a Phase Shift

The basic derivative identities are

\[ \frac{d}{dx}\sin x=\cos x, \qquad \frac{d}{dx}\cos x=-\sin x. \]

The angle-addition identities give the equivalent phase-shift forms

\[ \cos x=\sin\left(x+\frac{\pi}{2}\right), \qquad -\sin x=\cos\left(x+\frac{\pi}{2}\right). \]

Differentiation therefore preserves the shape and amplitude of a unit-frequency sine or cosine and advances its phase by \(\pi/2\). Repeating this observation suggests

\[ \boxed{ \frac{d^n}{dx^n}\sin x =\sin\left(x+\frac{n\pi}{2}\right) } \]

and

\[ \boxed{ \frac{d^n}{dx^n}\cos x =\cos\left(x+\frac{n\pi}{2}\right) }. \]

Both formulas hold for every integer \(n\ge0\).

Proof by Induction

For \(n=0\), both claims reduce to the original functions. Assume the sine formula holds for some \(n=k\ge0\). Differentiating once more gives

\[ \begin{aligned} \frac{d^{k+1}}{dx^{k+1}}\sin x &=\frac{d}{dx}\sin\left(x+\frac{k\pi}{2}\right)\\ &=\cos\left(x+\frac{k\pi}{2}\right)\\ &=\sin\left(x+\frac{k\pi}{2}+\frac{\pi}{2}\right)\\ &=\sin\left(x+\frac{(k+1)\pi}{2}\right). \end{aligned} \]

The same step for cosine yields

\[ \begin{aligned} \frac{d^{k+1}}{dx^{k+1}}\cos x &=\frac{d}{dx}\cos\left(x+\frac{k\pi}{2}\right)\\ &=-\sin\left(x+\frac{k\pi}{2}\right)\\ &=\cos\left(x+\frac{k\pi}{2}+\frac{\pi}{2}\right)\\ &=\cos\left(x+\frac{(k+1)\pi}{2}\right). \end{aligned} \]

Thus each formula at order \(k\) implies the corresponding formula at order \(k+1\). Since the zeroth-order formulas hold, induction proves both claims for all \(n\ge0\). \(\blacksquare\)

The Four-Step Cycle

Adding four derivative steps advances the phase by \(2\pi\). Periodicity therefore gives

\[f^{(n+4)}=f^{(n)}\]

for \(f=\sin\) or \(f=\cos\). Only the remainder of \(n\) after division by \(4\) matters:

\(n\bmod4\)\(\dfrac{d^n}{dx^n}\sin x\)\(\dfrac{d^n}{dx^n}\cos x\)
\(0\)\(\sin x\)\(\cos x\)
\(1\)\(\cos x\)\(-\sin x\)
\(2\)\(-\sin x\)\(-\cos x\)
\(3\)\(-\cos x\)\(\sin x\)

For example, \(2026\equiv2\pmod4\), so

\[ \frac{d^{2026}}{dx^{2026}}\sin x=-\sin x, \qquad \frac{d^{2026}}{dx^{2026}}\cos x=-\cos x. \]

A Linear-Algebra View

Consider a linear combination

\[f(x)=a\sin x+b\cos x.\]

Differentiation gives

\[f'(x)=-b\sin x+a\cos x.\]

The coefficient vector is transformed by

\[ \begin{pmatrix}a\\b\end{pmatrix} \longmapsto \begin{pmatrix}0&-1\\1&0\end{pmatrix} \begin{pmatrix}a\\b\end{pmatrix}. \]

The two-dimensional function space spanned by \(\sin x\) and \(\cos x\) is therefore closed under differentiation. The matrix above is a rotation by \(\pi/2\), and its fourth power is the identity matrix. This is the same four-step cycle expressed on coefficients rather than through phase shifts.

Arbitrary Amplitude, Frequency, and Phase

Let

\[f(x)=A\sin(\omega x+\varphi).\]

The chain rule contributes one factor of \(\omega\) at every differentiation, while the trigonometric part still advances by \(\pi/2\). Therefore

\[ \boxed{ f^{(n)}(x) =A\omega^n\sin\left(\omega x+\varphi+\frac{n\pi}{2}\right) }. \]

Similarly, for \(g(x)=A\cos(\omega x+\varphi)\),

\[ \boxed{ g^{(n)}(x) =A\omega^n\cos\left(\omega x+\varphi+\frac{n\pi}{2}\right) }. \]

When \(\omega<0\), the factor \(\omega^n\) automatically supplies the correct parity-dependent sign. When \(\omega=0\), the function is constant and every derivative of positive order vanishes, which the formula also captures.

Example with Frequency and Phase

Consider

\[f(x)=3\cos\left(2x-\frac{\pi}{3}\right).\]

Its fifth derivative is

\[ \begin{aligned} f^{(5)}(x) &=3\cdot2^5 \cos\left(2x-\frac{\pi}{3}+\frac{5\pi}{2}\right)\\ &=96\cos\left(2x+\frac{13\pi}{6}\right)\\ &=96\cos\left(2x+\frac{\pi}{6}\right). \end{aligned} \]

Connection to Differential Equations

Two differentiations advance the phase by \(\pi\), so

\[ \frac{d^2}{dx^2}\sin(\omega x+\varphi) =-\omega^2\sin(\omega x+\varphi), \]

and likewise for cosine. Both functions therefore solve the harmonic-oscillator equation

\[y''+\omega^2y=0.\]

Conversely, every real solution of this constant-coefficient equation has the form \(y=A\cos(\omega x)+B\sin(\omega x)\). The derivative cycle is thus not merely a mnemonic; it is the algebraic structure behind undamped oscillations.

Connection to Taylor Series

The Taylor coefficients at \(x=0\) are determined by these same derivative cycles:

\[ \sin^{(n)}(0)=\sin\frac{n\pi}{2}, \qquad \cos^{(n)}(0)=\cos\frac{n\pi}{2}. \]

The sine coefficients vanish for even \(n\), while the cosine coefficients vanish for odd \(n\). Substitution into the Taylor series formula yields

\[ \sin x=\sum_{k=0}^{\infty}(-1)^k\frac{x^{2k+1}}{(2k+1)!}, \qquad \cos x=\sum_{k=0}^{\infty}(-1)^k\frac{x^{2k}}{(2k)!}. \]

Common Mistakes

The general definition and differentiation rules used here are developed in Introduction to Derivatives.