Pull a mass on a spring and let go: it swings back and forth, again and again. A swing, a guitar string and a building in an earthquake do the same. You already know how to describe a repeating motion by its amplitude, period and frequency; this topic explains what makes the motion repeat.
💡 Why it works
The spring force is a restoring force: it always points back toward equilibrium, and it grows in proportion to the displacement, $F = -kx$. So the acceleration is $$a = \frac{F}{m} = -\frac{k}{m}x.$$ Released at $x = A$, the mass is pulled back and speeds up. At $x = 0$ the force vanishes, but the mass is moving fast and overshoots. Now the spring pulls the other way, slows it, and stops it at $x = -A$. Then the whole thing runs in reverse. With no friction, nothing is lost, so it repeats forever between $+A$ and $-A$. Motion driven by a force like this is called simple harmonic motion (SHM).
🔑 Key idea
Simple harmonic motion comes from a restoring force proportional to displacement, $F = -kx$, so $a = -\dfrac{k}{m}x$. The amplitude $A$ is the largest displacement; the period $T$ is the time for one full cycle; the frequency is $f = \dfrac{1}{T}$, in hertz (cycles per second).
Position and acceleration: always opposite in sign, and the acceleration is largest at the turning points.
Worked examples
✏️ Worked example: Period and frequency
A mass on a spring completes $15$ full cycles in $12\ \text{s}$. Find its period and frequency.
$T = \dfrac{12\ \text{s}}{15} = 0.80\ \text{s}$ per cycle.
A $0.50\ \text{kg}$ block on a spring ($k = 80\ \text{N/m}$) is $0.05\ \text{m}$ left of equilibrium. Find its acceleration (right positive).
$x = -0.05\ \text{m}$.
$$a = -\dfrac{k}{m}x = -\dfrac{80}{0.50}(-0.05) = +8.0\ \text{m/s}^2:$$ to the right, back toward the middle.
Answer: $+8.0\ \text{m/s}^2$
✏️ Worked example: Distance in a few cycles
An oscillator with amplitude $0.10\ \text{m}$ runs for $3$ full periods. How far does it travel?
One cycle: from $+A$ to $-A$ and back, a distance of $4A = 0.40\ \text{m}$.
Three cycles: $1.2\ \text{m}$, though it ends exactly where it started (zero displacement).
Answer: $1.2\ \text{m}$
⚠️ Common mistake
Thinking the acceleration is greatest at the middle, where the speed is greatest. The acceleration depends on the position, $a = -\tfrac{k}{m}x$, not on the speed. At the middle $x = 0$, so the force and acceleration are zero; at the turning points the mass is momentarily at rest, yet its acceleration is largest. Check with the graphs above: the $a$ curve is zero exactly when the $x$ curve crosses zero.
Swinging pendulums are SHM too, as long as the swings are small. See fifteen of them drift in and out of step in the Pendulums and Resonance lab of the Science Lab.