Physics
High Schoolmechanics

Simple Harmonic Motion

Why a mass on a spring, a pendulum swinging gently, and a guitar string all obey the exact same equation of motion — and what that equation actually is.

Before this, you should know:

Pluck a guitar string, nudge a mass hanging from a spring, or give a playground swing a small push. Three completely different physical setups — different materials, different forces, different sizes — and yet if you plotted position against time for any of them, you'd get the same shape of graph: a smooth, repeating wave. That's not a coincidence, and it's not a coarse approximation either. It's a genuinely precise mathematical fact, and by the end of this topic you'll see exactly why it has to be true.

The restoring force

Everything here starts from one idea: a restoring force, a push or pull that always points back toward some equilibrium position, growing stronger the farther you get from it. The cleanest example is an ideal spring, obeying Hooke's law:

F=kxF = -kx

Look closely at that minus sign, because it's doing all the work. xx is displacement from equilibrium, and FF is the force the spring exerts. Whichever direction you pull the mass, the spring pulls back the other way. Push it right, the force points left. Push it left, the force points right. There's no direction you can displace the mass in that doesn't get met with a force trying to undo it.

Guessing the solution, and checking it actually works

Combine Hooke's law with Newton's second law, F=ma=mx¨F = ma = m\ddot x, and you get a genuinely new kind of equation — one where the "answer," xx, appears on both sides, tangled up with its own second derivative:

mx¨=kxm\ddot{x} = -kx

Rather than grinding through the general machinery for solving this, let's do something very much in the spirit of physics: guess an answer, and check whether it works. A natural guess, given that we already expect repeating, wave-like motion, is:

x(t)=Acos(ωt+ϕ)x(t) = A\cos(\omega t + \phi)

where AA is the amplitude (how far the motion reaches from equilibrium), ϕ\phi is a phase constant that just shifts where the clock starts, and ω\omega is something we're about to pin down. Differentiate twice:

x˙=Aωsin(ωt+ϕ)x¨=Aω2cos(ωt+ϕ)=ω2x\dot x = -A\omega\sin(\omega t + \phi) \qquad\qquad \ddot x = -A\omega^2\cos(\omega t + \phi) = -\omega^2 x

Substitute that last result into mx¨=kxm\ddot x = -kx:

mω2x=kxω2=kmω=km-m\omega^2 x = -kx \quad\Longrightarrow\quad \omega^2 = \frac{k}{m} \quad\Longrightarrow\quad \omega = \sqrt{\frac{k}{m}}

It works — for any amplitude AA and any phase ϕ\phi, as long as ω\omega takes this exact value. That's the whole derivation. The guess wasn't a lucky accident; cosine (and sine) are, by definition, the functions whose second derivative is a negative multiple of themselves, which is exactly what x¨=ω2x\ddot x = -\omega^2 x demands.

ω\omega here is the angular frequency, and it sets the period — the time for one full cycle:

T=2πω=2πmkT = \frac{2\pi}{\omega} = 2\pi\sqrt{\frac{m}{k}}

Notice what's not in that formula: the amplitude. A spring oscillating through a wide swing and the same spring oscillating through a tiny swing take exactly the same time per cycle. That's a genuinely surprising, non-obvious feature of this kind of motion, and it's the reason a pendulum clock can keep steady time even as it gradually loses energy to friction and its swings shrink.

Where the energy goes, moment to moment

This is a perfect place to put the tools from work and energy back to work. The spring's potential energy is U=12kx2U = \frac{1}{2}kx^2, and kinetic energy is the usual K=12mv2K = \frac{1}{2}mv^2. Since no friction is acting, total mechanical energy is conserved:

E=K+U=12mv2+12kx2=constantE = K + U = \frac{1}{2}mv^2 + \frac{1}{2}kx^2 = \text{constant}

At the extremes of the motion (x=±Ax = \pm A), the mass is momentarily at rest (v=0v=0), so all the energy is potential: E=12kA2E = \frac{1}{2}kA^2. At the instant it passes through equilibrium (x=0x=0), all of that energy has converted to kinetic, giving the motion its maximum speed. Sitting between those two extremes, energy sloshes continuously back and forth between the two forms, twice every cycle, while their sum never wavers.

A mass on a spring attached to a wall, shown displaced from equilibrium, next to a graph of its position over time forming a cosine curve with amplitude A and period T labeled.

The same motion, shown two ways: a mass oscillating about equilibrium, and the cosine curve that describes its position at every instant.

The pendulum was secretly the same equation all along

Here's a satisfying loose end to tie off. In Lagrangian mechanics, we derived the exact equation of motion for a pendulum: θ¨=(g/L)sinθ\ddot\theta = -(g/L)\sin\theta. That's not the simple harmonic equation — it has sinθ\sin\theta in it, not θ\theta itself. But for small swings, there's a classic approximation: sinθθ\sin\theta \approx \theta when θ\theta is small (measured in radians). Make that substitution, and the pendulum's equation collapses into:

θ¨gLθ\ddot\theta \approx -\frac{g}{L}\theta

— exactly the simple-harmonic form, with ω=g/L\omega = \sqrt{g/L} standing in for k/m\sqrt{k/m}. This is precisely why a pendulum clock only keeps good time for small swings: push it through a wide arc and sinθθ\sin\theta \approx \theta stops being a good approximation, the motion stops being truly sinusoidal, and the period starts to depend on amplitude after all.

Worked example

A 0.50 kg mass on a spring with spring constant 50 N/m is pulled 0.20 m from equilibrium and released from rest. Find the period of oscillation and the mass's maximum speed. (click to reveal the solution)

Setting up: released from rest at x=A=0.20x = A = 0.20 m, so this is the amplitude. We're given m=0.50m = 0.50 kg and k=50k = 50 N/m.

Angular frequency:

ω=km=500.50=100=10 rad/s\omega = \sqrt{\frac{k}{m}} = \sqrt{\frac{50}{0.50}} = \sqrt{100} = 10 \text{ rad/s}

Period:

T=2πω=2π100.63 sT = \frac{2\pi}{\omega} = \frac{2\pi}{10} \approx 0.63 \text{ s}

Maximum speed, using conservation of energy — all the energy is potential at x=Ax=A, all of it kinetic at x=0x=0:

12kA2=12mvmax2vmax=Akm=Aω\frac{1}{2}kA^2 = \frac{1}{2}mv_{\max}^2 \quad\Longrightarrow\quad v_{\max} = A\sqrt{\frac{k}{m}} = A\omega vmax=(0.20)(10)=2.0 m/sv_{\max} = (0.20)(10) = 2.0 \text{ m/s}

Notice that vmax=Aωv_{\max} = A\omega falls straight out of the energy equation once you recognize k/m\sqrt{k/m} as ω\omega — the same angular frequency that set the period is also, quietly, the conversion factor between amplitude and top speed.

Where this fits

This topic sits alongside work-energy as a direct application of Newton's laws to one of the most common patterns in physics: a restoring force pulling a system back toward equilibrium. We've treated it here with nothing more than F=maF=ma and a good guess at the solution — but the same mass-on-a-spring system reappears later in the Hamiltonian mechanics topic, where its phase-space orbit turns out to be a perfect closed ellipse, and this exact equation resurfaces again, essentially unchanged, at the foundation of quantum mechanics.