Learning path

Full curriculum

Full curriculum

Unit content

Harmonic oscillator equation and sinusoidal solutions

The differential equation

$$\boxed{y''+\omega^2y=0}$$

with constant $\omega>0$ is the harmonic oscillator equation. It says that the second derivative of $y$ is proportional to $-y$:

$$y''=-\omega^2y.$$

That structure produces oscillation because whenever $y$ is positive its curvature is negative, and whenever $y$ is negative its curvature is positive.

Why sine and cosine solve the equation

Consider

$$y(t)=A\cos(\omega t).$$

Differentiating twice,

$$y'(t)=-A\omega\sin(\omega t),$$

$$y''(t)=-A\omega^2\cos(\omega t)=-\omega^2y(t).$$

So this function satisfies the harmonic oscillator equation. The same is true for

$$B\sin(\omega t).$$

Because differentiation is linear, their sum is also a solution:

$$\boxed{y(t)=A\cos(\omega t)+B\sin(\omega t)}.$$

The two constants $A$ and $B$ allow the solution to match an independently specified initial value $y(0)$ and initial derivative $y'(0)$.

At $t=0$,

$$y(0)=A,$$

while

$$y'(0)=B\omega.$$

Therefore, if

$$y(0)=y_0,\qquad y'(0)=v_0,$$

then

$$\boxed{A=y_0,\qquad B=\frac{v_0}{\omega}}.$$

Example

Suppose

$$y''+9y=0,$$

with

$$y(0)=2,\qquad y'(0)=-3.$$

Here $\omega=3$. The initial conditions give

$$A=2,$$

$$B=\frac{-3}{3}=-1,$$

so

$$\boxed{y(t)=2\cos(3t)-\sin(3t)}.$$

Differentiating twice verifies directly that this function satisfies $y''+9y=0$.

Amplitude-phase form

Using the angle-addition identity, the same solution can be written as one shifted sinusoid:

$$\boxed{y(t)=C\cos(\omega t+\phi)}.$$

Expanding,

$$C\cos(\omega t+\phi) =C\cos\phi\cos(\omega t)-C\sin\phi\sin(\omega t).$$

Comparing with

$$A\cos(\omega t)+B\sin(\omega t)$$

gives

$$A=C\cos\phi,\qquad B=-C\sin\phi,$$

and therefore

$$\boxed{C=\sqrt{A^2+B^2}}.$$

The amplitude $C$ gives the largest magnitude reached by $y$, while the phase $\phi$ specifies where in the oscillation the motion begins.

Frequency and period

Sine and cosine repeat when their argument changes by $2\pi$. Therefore the period is

$$\boxed{T=\frac{2\pi}{\omega}},$$

and the ordinary frequency is

$$\boxed{f=\frac1T=\frac{\omega}{2\pi}}.$$

The parameter $\omega$ is consequently called the angular frequency.

The harmonic oscillator equation is a special differential equation with an especially important sinusoidal solution. General methods for solving broader families of second-order differential equations can reproduce this result, but they are not required to establish or use the harmonic solution itself.