Simple Harmonic Motion & Pendulums · Guide · glidepathscience.org
GuideSimple Harmonic Motion & Pendulums
Contents
This Guide explains the ideas and equations behind every Walkthrough step, Concept Challenge question and Predict round, in the order a textbook would take them. Part 1 prepares the Intro track and Part 2 the Advanced track; each takes about fifteen minutes to read. Each section ends with a worked example that is not one of the sim's own problems.
Part 1 · The essentials
Math you’ll need: algebra, square roots, sines and cosines in radians, and $e^{x}$ for damping.
A force that pulls back, and the time it keeps
Almost anything that keeps time swings back and forth: a clock's pendulum, the quartz crystal in a watch, a car on its springs, a tall building in the wind, the atoms of a solid. Each has an equilibrium where it would sit still, and whenever it is pushed away a restoring force pulls it back toward that place.
A mass on a spring is the simplest case. Stretched or squeezed a distance x from its natural length, the spring pulls back with a force proportional to x, and Newton's second law turns that force into an acceleration:
$F = -kx$ $a = F/m = -\frac{k}{m}x$
Here k is the spring constant (N/m), m the moving mass (kg) and x the displacement from equilibrium (m). The minus sign says the force always points back toward the middle. Released from a stretch A, the amplitude, the mass speeds up all the way in, overshoots, slows on the far side, stops for an instant at −A and comes back.
So the speed is largest in the middle, where the spring has finished speeding the mass up, and the acceleration is largest at the ends, where the stretch and the force are largest. The usual mistake is to think a mass at rest has no acceleration. At the end of its swing the mass is at rest only for an instant, and its velocity is changing faster there than anywhere else.
One complete trip, out and back on both sides, takes the period T. The frequency f counts cycles per second in hertz (Hz), and the angular frequency ω counts radians per second, since a cycle is 2π radians of the turning circle met two sections on:
$f = 1/T$ $\omega = 2\pi f$
On a record of x against time, successive peaks are one period apart, and so are successive crossings of zero in the same direction. Timing several cycles and dividing by their number beats timing one, because the errors at the two ends are shared by every cycle between them.
A period can be measured. The next question is what sets it.
What sets the period of a spring
A stiffer spring pulls harder and makes the motion faster; a heavier mass responds more sluggishly and makes it slower. The rule $a = -(k/m)x$ has solutions that repeat with $\omega^2 = k/m$, so
$T = 2\pi\sqrt{m/k}$ $\omega = 2\pi f = \sqrt{k/m}$
Because of the square root, four times the mass doubles the period and four times the stiffness halves it. Writing the ratio upside down is a common slip; a heavier mass must give a longer period, a quick test of any formula you write.
The amplitude is missing from the formula, and that matters as much as what is in it. Pull the mass twice as far and the spring pulls twice as hard at every point, so the mass moves twice as fast along a path twice as long: the wider swing is a scaled copy of the narrow one and takes the same time. Students often expect the bigger swing to take longer because it has farther to go; it also goes faster, and the two effects cancel exactly. That is what makes an oscillator a clock.
The period says how long a cycle takes, not where the mass is within it. For that we need the motion itself.
Position, velocity and acceleration, and the reference circle
Motion under a restoring force proportional to the displacement is simple harmonic motion (SHM). Its position is a cosine of time, and its slopes give the velocity and the acceleration:
$x = A\cos(\omega t+\varphi)$
$v = -A\omega\sin(\omega t+\varphi)$ $a = -A\omega^2\cos(\omega t+\varphi) = -\omega^2x$
The phase constant φ says where in its cycle the motion is at t = 0. The largest speed, in the middle, and the largest acceleration, at the ends, are
$v_{max} = A\omega$ $a_{max} = A\omega^2$
On graphs against time the three curves are shifted copies: v reaches each peak a quarter cycle before x (v leads x by a quarter cycle), and a is the mirror image of x, half a cycle away. A common slip is to use f in place of ω, which loses a factor of 2π.
One picture makes all of this obvious. Imagine a point going counterclockwise round a circle of radius A at the steady angular speed ω, starting at the angle φ from the right. Its shadow on the horizontal diameter moves exactly as x = A cos(ωt + φ). This is the reference circle. The shadow is fastest when the point crosses the top or bottom, moving sideways, and stops at the ends. Choosing φ is choosing where the point starts: φ = 0 puts the mass at +A at rest, and φ = 90° puts it in the middle, moving left.
The motion trades speed for displacement in a regular way, and energy says exactly how.
Energy sloshes between the spring and the mass
The spring stores elastic energy $U = \tfrac{1}{2}kx^2$ and the mass carries kinetic energy $K = \tfrac{1}{2}mv^2$. Without friction their sum never changes, and at the ends, where the mass is at rest, all of it is in the spring:
$E = \tfrac{1}{2}kA^2 = \tfrac{1}{2}kx^2+\tfrac{1}{2}mv^2$
Twice a cycle the energy flows from the spring into the mass and back. Solving for the speed at any position gives
$v = \omega\sqrt{A^2-x^2}$
The squares are what matter. Halfway out the spring holds only a quarter of the energy, so the speed is still √3/2, 87 %, of its peak. Assuming the speed falls in proportion to the distance from the middle, which would give half, is the usual mistake.
So far the spring has lain on a level track. Hanging it adds a force that never lets go.
Hanging a spring: gravity moves the middle
A mass hung from a spring stretches it until kd = mg, so the equilibrium moves down by
$d = mg/k$
Measure x from this new equilibrium. A distance x below it, the spring pulls up with k(d + x) and gravity pulls down with mg = kd, so the net force is −kx, exactly as on the level track. The constant weight only shifts the middle; it adds nothing that grows with x, so the period is still $T = 2\pi\sqrt{m/k}$. Gravity helps on the way down and hinders on the way up by exactly as much. Guessing that the weight lengthens the period, or that gravity's help shortens it, are the common errors. Measured from the new equilibrium, the elastic and gravitational energies together make ½kx², though either alone can be negative.
With no spring at all, gravity is the restoring force of a pendulum.
The pendulum, and why wide swings are slow
A bob on a light rod or string of length L, pulled aside by an angle θ, feels a restoring force mg sin θ along its arc. For small angles sin θ ≈ θ in radians, and with the arc length s = Lθ the force is about −(mg/L)s: a spring with k = mg/L. The mass cancels, as it does in free fall, because a heavier bob is pulled harder and is harder to move in the same proportion:
$T = 2\pi\sqrt{L/g}$
L runs from the pivot to the center of the bob. Expecting a heavier bob to swing faster or slower is the most common error with pendulums. Gravity does appear: on the Moon a pendulum swings about 2.5 times more slowly, while a mass on a spring keeps the same time anywhere.
The formula holds only while sin θ ≈ θ. Farther out sin θ falls short of θ (by 17 % at 60°), so the bob is pulled back less than SHM would need and the swing takes longer: the exact period is 0.19 % longer than 2π√(L/g) at 10°, 1.7 % at 30°, 7.3 % at 60° and 18 % at 90°. A pendulum keeps nearly, not exactly, the same time at every amplitude.
Real pendulums and springs do not swing forever. Next: how they run down.
Damping takes amplitude, not rhythm
Air, a pivot or a shock absorber takes energy out of every oscillator. The simplest model is viscous damping, a drag −bv proportional to the velocity, with b in kg/s. Such a drag takes a big bite from a fast, wide swing and a small one from a slow, narrow swing, so the amplitude falls by the same fraction each cycle, exponentially:
$A = A_0e^{-bt/2m}$
Here $A_0$ is the starting amplitude. Each cycle multiplies the amplitude by $e^{-bT/2m}$, so the drops shrink and the motion never quite stops. The energy, which goes as the amplitude squared, falls twice as fast, and every joule lost becomes heat. Falling by the same amount each cycle is the signature of dry friction, a constant force such as a block sliding on a table.
The rhythm barely notices weak damping: the zero crossings stay evenly spaced, and the period is longer by only a tiny fraction of a percent. Nor does it shorten as the swing shrinks; a linear oscillator's period does not depend on its amplitude. Strong damping is different. Once b reaches $2\sqrt{mk}$ the oscillation ends altogether, and the mass creeps back to the middle without crossing it.
One number says how lightly damped an oscillator is, its quality factor $Q = \sqrt{mk}/b$. The smaller the drag, the larger Q; the oscillation just ends at Q = ½. Each cycle multiplies the amplitude by $e^{-\pi/Q}$, so a lightly damped oscillator rings for about Q/π cycles before its amplitude falls to 1/e, about a third.
Damping drains an oscillator. A well-timed push refills it.
Pushing in rhythm: resonance
Every oscillator has a natural frequency $f_0$ at which it swings when left alone; for a mass on a spring it is $\frac{1}{2\pi}\sqrt{k/m}$. Push it with a small force at a drive frequency $f_d$ and, once the start-up wobble has died away, it swings steadily at the drive frequency, not its own. Far below $f_0$ the mass simply follows the push; far above, it cannot keep up and moves against it. The largest swings come when
$f_d \approx f_0 = \frac{1}{2\pi}\sqrt{k/m}$
At $f_0$ the mass lags the push by a quarter cycle, so the push is always in step with the velocity, every push adds energy, and the swing grows until the damping takes out each cycle what the drive puts in.
Driven exactly at $f_0$, the amplitude is Q times the stretch $F_0/k$ the same force would give held steady, with Q the quality factor of the last section: the lighter the damping, the bigger the swing. The usual mistake is to think pushing harder or faster is what matters: pushes at the wrong rhythm fight the motion as often as they help.
Part 2 · Going further
Math you’ll need: derivatives (dots for time) and linear differential equations.
The equation of motion and phase space
Newton's second law for a mass on a spring, with dots for time derivatives, is $m\ddot{x} = -kx$:
$\ddot{x} = -\omega_0^2x$ $\omega_0 = \sqrt{k/m}$
Its general solution $x = A\cos(\omega_0t+\varphi)$ has two constants, fixed by the start: $x_0 = A\cos\varphi$ and $v_0 = -A\omega_0\sin\varphi$, so
$A = \sqrt{x_0^2+(v_0/\omega_0)^2}$ $\tan\varphi = -v_0/(\omega_0x_0)$
with the quadrant of φ set by the signs of $x_0$ and $-v_0$. Dividing $v_0$ by $\omega_0$ turns a speed into a length, and the two lengths add in quadrature, like the sides of a right triangle; adding them directly is the usual slip.
The same triangle lives in phase space, a plot of the state (x, v/$\omega_0$). The energy is $\tfrac{1}{2}k\left(x^2+(v/\omega_0)^2\right)$, so constant energy is a circle of radius $\sqrt{2E/k} = A$. The state goes round it clockwise (v/$\omega_0$ upward) at the steady angular speed $\omega_0$, and every circle takes one period, whatever its size: time has become an angle. The reference circle plots −v/ω instead, the same picture upside down, running counterclockwise.
Many oscillators have no single spring constant or moving mass. Energy handles them too.
The energy method and the physical pendulum
Any system with one coordinate q, kinetic energy $\tfrac{1}{2}m_{eff}\dot{q}^2$ and potential energy $\tfrac{1}{2}k_{eff}q^2$ oscillates like a mass on a spring:
$\omega^2 = k_{eff}/m_{eff}$
For a rigid body swinging about a pivot (a physical pendulum) the coordinate is θ, the "mass" is the moment of inertia I about the pivot, and for small angles the "stiffness" is mgd, with d from the pivot to the center of mass:
$T = 2\pi\sqrt{I/mgd}$
A uniform rod pivoted at one end has $I = mL^2/3$ and d = L/2, so T = 2π√(2L/3g), the time of a simple pendulum two thirds its length; in general $I/(md)$ is the length of the equivalent simple pendulum. With the parallel-axis theorem, $I = m\kappa^2 + md^2$ (κ the radius of gyration, L/√12 for a rod), the period is $2\pi\sqrt{(\kappa^2+d^2)/gd}$: shortest at d = κ, and growing without bound as the pivot nears the center of mass. Treating the rod as a point mass at its end or its center, or using the moment of inertia about the center, are the usual mistakes.
The method also weighs a spring's own mass $m_s$: its coils move at speeds rising from zero at the fixed end, and their kinetic energy adds a third of it, $m_{eff} = m + m_s/3$ (Rayleigh's method).
Both pendulums were linearized at small angles. Now we drop that approximation.
The exact pendulum, and swinging over the top
Without the small-angle approximation the pendulum obeys $\ddot{\theta} = -\omega_0^2\sin\theta$, with $\omega_0 = \sqrt{g/L}$ and $T_0 = 2\pi/\omega_0$. Energy conservation gives the speed at every angle, and adding up the time to cross each piece of the arc gives the exact period as a complete elliptic integral. Its fast route is the arithmetic–geometric mean: from a = 1 and b = cos($\theta_0$/2), replace a with (a + b)/2 and b with √(ab), and repeat; within three or four steps the two agree, and
$T = T_0/\mathrm{AGM}(1,\cos(\theta_0/2))$
The series $T_0(1 + \theta_0^2/16 + 11\theta_0^4/3072 + \ldots)$, $\theta_0$ in radians, is handy for moderate swings, but trusting its first terms far out is a mistake: at 90° the first correction gives 1.154 $T_0$ against the true 1.180.
Released almost upside down, the pendulum lingers near the top, where the restoring torque is tiny, and rushes through the bottom. Its period grows without bound, close to (2/π) ln(8/(π − $\theta_0$)) $T_0$ near 180°, and its graph flattens into a square-shouldered wave rich in odd harmonics. In phase space the boundary between swinging and going over the top is the separatrix, the orbit with just enough energy to reach the top:
$\dot{\theta}/\omega_0 = \pm2\cos(\theta/2)$
Inside it the orbits are closed loops and the pendulum swings; outside, it goes round and round. Released from rest anywhere below 180°, it is inside, so it never goes over the top.
Back to small swings, with damping strong enough to change the motion's character.
Damping in full: under, critical and over
With a drag −bẋ, Newton's law becomes
$\ddot{x}+2\beta\dot{x}+\omega_0^2x = 0$ $\beta = b/2m$
Trying $x = e^{rt}$ gives $r = -\beta \pm \sqrt{\beta^2-\omega_0^2}$, and the damping ratio $\zeta = \beta/\omega_0$ sorts the solutions. Underdamped (ζ < 1), the mass rings in a shrinking envelope, $x = Ae^{-\beta t}\cos(\omega_dt+\varphi)$, at
$\omega_d = \sqrt{\omega_0^2-\beta^2}$ $t_{1/2} = \ln 2/\beta$
where $t_{1/2}$ is the amplitude's half-life; the energy halves twice as fast, and writing β = b/m finds the energy's half-life by mistake. At critical damping (ζ = 1, b = 2√(mk)) the roots merge, $x = (A+Bt)e^{-\omega_0t}$: the quickest return without overshoot. Overdamped (ζ > 1), there is no oscillation, $x = Ae^{-\lambda_1t}+Be^{-\lambda_2t}$ with $\lambda = \beta \mp \sqrt{\beta^2-\omega_0^2}$, and the slow rate, close to $\omega_0^2/2\beta$, sets the return. It slows as the damping grows: heavier damping does not mean a faster return, the most common error here. Door closers and meter needles are built near critical; a car's suspension is underdamped, with ζ of a few tenths, for a softer ride.
A light ring-down holds one number that says how good an oscillator is.
Q from a ring-down, and dry friction
The quality factor compares the natural frequency with the damping rate:
$\zeta = \beta/\omega_0$ $Q = \omega_0/2\beta \approx \pi N/\ln(x_n/x_{n+N})$
Successive peaks are one damped period apart, so each is $e^{-\beta T_d}$ times the last. The logarithm of that ratio, the logarithmic decrement Λ = $\beta T_d$, is very nearly π/Q, so the amplitude falls to 1/e in about Q/π cycles. Reading peaks N cycles apart, as in the last expression, beats using neighbors: the ratio is bigger, so reading errors matter less. Forgetting to divide by N, or taking Q as 1/Λ, are the usual slips. A pendulum may have Q of a few hundred, a guitar string thousands, a quartz watch crystal tens of thousands, a car on its springs about 2.
Dry (Coulomb) friction is different: a constant force $\mu_kmg$ against the motion, whatever the speed. Each half cycle is then exact SHM about a center shifted $\mu_kmg/k$ toward where it began, so the turning points fall by $4\mu_kmg/k$ every cycle, in a straight line, and the mass stops dead at the first turning point where $|kx| \le \mu_smg$, seldom exactly in the middle. Viscous damping gives a curve that never quite reaches zero: how the peaks fall tells the two apart.
Damping and driving together make the full driven oscillator.
The driven oscillator: steady state and transients
A force $F_0\cos\omega t$ gives
$\ddot{x}+2\beta\dot{x}+\omega_0^2x = (F_0/m)\cos\omega t$
Once the start-up dies away the motion follows the drive, $x = A(\omega)\cos(\omega t-\delta)$, with
$A(\omega) = \frac{F_0/m}{\sqrt{(\omega_0^2-\omega^2)^2+(2\beta\omega)^2}}$
$\tan\delta = 2\beta\omega/(\omega_0^2-\omega^2)$
Far below resonance the spring dominates, A approaches $F_0/k$ and δ approaches 0. Far above, inertia dominates and δ approaches 180°. Driven exactly at $\omega_0$, whatever the damping,
$A(\omega_0) = (F_0/k)Q$ δ = 90°
so the drive is in step with the velocity and does positive work all the time. The amplitude peaks a little lower, at $\sqrt{\omega_0^2-2\beta^2}$, while the power absorbed peaks exactly at $\omega_0$: where "the" resonance is depends on which response you plot. The lag at $\omega_0$ does not depend on Q, a common mistake; only how sharply it swings from 0 to 180° does.
The full motion adds a free, decaying oscillation at $\omega_d$ that matches the start; from rest it begins equal and opposite to the steady state. Off resonance the two drift in and out of step, so the amplitude beats, roughly every $2\pi/|\omega-\omega_d|$, while the free part dies as $e^{-\beta t}$, over a few times Q/π cycles.
The width of the resonance gives a second measure of Q.
Bandwidth, and beyond linear
The average power the drive feeds in,
$P(\omega) = \frac{F_0^2}{2m}\cdot\frac{2\beta\omega^2}{(\omega_0^2-\omega^2)^2+(2\beta\omega)^2}$
peaks exactly at $\omega_0$ and falls to half where $\omega_0^2-\omega^2 = \pm2\beta\omega$. Those quadratics give $\sqrt{\beta^2+\omega_0^2} \mp \beta$, so the full width at half maximum is exactly
$\Delta\omega = 2\beta$ $Q = \omega_0/\Delta\omega$
the same Q a ring-down gives: a narrow resonance and a long ring-down are one fact seen two ways. The amplitude curve's 1/√2 points give nearly the same width when Q is large. Quoting the half width β, or the width in hertz when rad/s was asked, are the usual slips.
All of this assumed a linear oscillator, whose natural frequency does not depend on its amplitude. A pendulum's does: its wide swings are slower. Driven hard, its resonance peak leans toward low frequency, and over a range of drive frequencies two steady amplitudes are possible, so a sweep up and a sweep down jump at different places. Harder still, the motion can turn chaotic: it never repeats, and two runs started a hair apart soon differ completely. The Sandbox's chaotic pendulum uses Baker and Gollub's parameters: damping q = 2, a drive torque 1.5 times the largest gravitational torque, at two thirds of $\omega_0$.
Reference
Common mistakes
Part 1
- Zero speed means zero acceleration. At the ends the acceleration is largest.
- A wider swing takes longer. Not on a spring; a pendulum only at wide angles.
- k/m upside down, or f for ω. A heavier mass gives a longer period; $v_{max}$ = Aω with ω in rad/s.
- Speed falls in proportion to distance. Use energy: $v = \omega\sqrt{A^2-x^2}$.
- Gravity changes a hanging spring's period. It only moves the middle, by mg/k.
- A heavier bob swings differently. The mass cancels.
- Damping takes the same amount each cycle. Viscous damping takes the same fraction.
- Resonance is about pushing hard. It is about pushing in step with the velocity.
Part 2
- More damping returns faster. Beyond critical, it returns more slowly.
- β = b/m, or Q = 1/Λ. β = b/2m, and Q ≈ π/Λ, with Λ the decrement per cycle.
Equation sheet
| Part 1 | |
|---|---|
| spring | $F = -kx$; $T = 2\pi\sqrt{m/k}$ |
| rates | $f = 1/T$, $\omega = 2\pi f = \sqrt{k/m}$ |
| motion | $x = A\cos(\omega t+\varphi)$; $v_{max} = A\omega$, $a_{max} = A\omega^2$ |
| energy | $E = \tfrac{1}{2}kA^2 = \tfrac{1}{2}kx^2+\tfrac{1}{2}mv^2$ |
| hanging | $d = mg/k$, the same T |
| pendulum | $T = 2\pi\sqrt{L/g}$ (small swings, any mass) |
| damped | $A = A_0e^{-bt/2m}$; $Q = \sqrt{mk}/b$ |
| resonance | $f_d \approx f_0 = \frac{1}{2\pi}\sqrt{k/m}$; $A = (F_0/k)Q$ at $f_0$ |
| Part 2 | |
|---|---|
| start | $A = \sqrt{x_0^2+(v_0/\omega_0)^2}$ |
| physical | $T = 2\pi\sqrt{I/mgd}$; $m_{eff} = m+m_s/3$ |
| exact | $T = T_0/\mathrm{AGM}(1,\cos(\theta_0/2))$ |
| equation | $\ddot{x}+2\beta\dot{x}+\omega_0^2x = (F_0/m)\cos\omega t$, $\beta = b/2m$ |
| damped | $\omega_d = \sqrt{\omega_0^2-\beta^2}$, $t_{1/2} = \ln 2/\beta$ |
| Q | $\zeta = \beta/\omega_0$, $Q = \omega_0/2\beta \approx \pi N/\ln(x_n/x_{n+N})$ |
| driven | $A(\omega) = \frac{F_0/m}{\sqrt{(\omega_0^2-\omega^2)^2+(2\beta\omega)^2}}$, $A(\omega_0) = (F_0/k)Q$ |
| lag, width | $\tan\delta = 2\beta\omega/(\omega_0^2-\omega^2)$, $\Delta\omega = 2\beta$ |
Symbols: x displacement from equilibrium (m) · A amplitude · k spring constant (N/m) · m mass (kg) · T period (s) · f frequency (Hz) · ω angular frequency (rad/s), $\omega_0$ the natural one · φ phase constant · E energy (J) · L pendulum length (m) · g = 9.81 m/s² · θ angle from straight down, $\theta_0$ the release angle · I moment of inertia about the pivot · d pivot to center of mass · b damping constant (kg/s) · β = b/2m damping rate (s⁻¹) · ζ damping ratio · Q quality factor · $F_0$ drive amplitude (N) · δ lag behind the drive · Λ logarithmic decrement per cycle · AGM the arithmetic–geometric mean.
Further reading
OpenStax, University Physics Volume 1, chapter 15 (Oscillations); J. R. Taylor, Classical Mechanics, chapter 5 (damped and driven oscillations, Q and the resonance width); G. L. Baker and J. P. Gollub, Chaotic Dynamics: An Introduction (the driven pendulum). The Field Manual lists every source and what the model leaves out.
Simple Harmonic Motion & Pendulums v1.8 · © 2026 Dr. David Meier · CC BY-NC-SA 4.0 · glidepathscience.org