Physics/Lessons/Oscillations/SHM Equations & Graphs
Physics · Oscillations · A2 Level

SHM Equations & Graphs

Knowing acceleration is proportional to displacement is only half the story — the practical power of SHM comes from the worked-out equations for displacement, velocity and acceleration at any moment, and from two neat period formulae that predict exactly how fast a mass-spring system or pendulum will oscillate before you ever set it swinging.

11 min read

The equations of motion for SHM

The defining equation $a=-\omega^2x$ is a starting condition, not a complete description — to know where an oscillating object actually is at a given time, you need the solved equations for $x$, $v$ and $a$ as functions of $t$. For an object released from rest at maximum displacement $x_0$ (the amplitude) at $t=0$:

$x = x_0\cos(\omega t)$
$v = -x_0\omega\sin(\omega t)$
$a = -x_0\omega^2\cos(\omega t) = -\omega^2 x$

Velocity and acceleration follow from displacement by successive differentiation with respect to time, though for A-level purposes it's the equations themselves that matter most.

If instead the object starts at $t=0$ passing through equilibrium (moving at maximum speed), sine and cosine swap:

$x = x_0\sin(\omega t) \qquad v = x_0\omega\cos(\omega t) \qquad a = -x_0\omega^2\sin(\omega t)$

Which pair to use depends on the starting condition in the question — cosine for "released from maximum displacement", sine for "starts at the centre moving at maximum speed". Both describe the same SHM, just with a different choice of $t=0$.

A displacement-independent relationship for velocity

It's often more useful to know speed at a given displacement rather than a given time. Combining the $x$ and $v$ equations (using $\sin^2+\cos^2=1$) eliminates $t$ entirely:

$v = \pm\omega\sqrt{x_0^2 - x^2}$

This applies regardless of starting condition, and confirms two intuitive facts: speed is greatest ($v=\pm\omega x_0$) at $x=0$, and zero at $x=\pm x_0$, where the object momentarily stops before reversing.

$x = x_0\cos(\omega t)$ — displacement starts at maximum positive amplitude $x_0$ and follows a cosine curve.
$v = -x_0\omega\sin(\omega t)$ — velocity starts at zero and leads displacement by a quarter cycle (90°).
$a = -x_0\omega^2\cos(\omega t)$ — acceleration starts at its most negative and is a half cycle (180°) out of phase with displacement, always the reverse sign.
Reading the phase relationships between the three graphs

The $x$, $v$ and $a$ graphs share the same period $T$ but are offset: $v$ is a quarter-cycle (90°) ahead of $x$ — velocity is zero when displacement is maximum, and maximum when displacement is zero. $a$ is a half-cycle (180°) out of phase with $x$ — acceleration is always the exact opposite sign to displacement, the SHM condition $a=-\omega^2x$ restated graphically.

Period of a mass-spring system and a simple pendulum

Since $\omega = 2\pi/T$, and each SHM system has its own characteristic $\omega^2$ set by its physical properties, each has its own period formula.

Mass-spring system

A mass $m$ on a spring of spring constant $k$ has $\omega^2 = k/m$. Substituting into $\omega = 2\pi/T$ and rearranging:

$T = 2\pi\sqrt{\dfrac{m}{k}}$

A homogeneity check: $\sqrt{\dfrac{\text{kg}}{\text{N}\,\text{m}^{-1}}} = \sqrt{\dfrac{\text{kg}}{\text{kg}\,\text{s}^{-2}}} = \sqrt{\text{s}^2} = \text{s}$, a time, as expected.

Simple pendulum

For a simple pendulum of length $l$ swinging through small angles:

$T = 2\pi\sqrt{\dfrac{l}{g}}$

where $g$ is gravitational field strength. Same check: $\sqrt{\dfrac{\text{m}}{\text{m}\,\text{s}^{-2}}} = \sqrt{\text{s}^2} = \text{s}$.

A striking feature of both formulae: no amplitude

Neither formula contains amplitude $x_0$. A mass-spring system or small-angle pendulum takes exactly the same time per oscillation whether swinging through a large amplitude or a tiny one — why pendulum clocks keep time even as their swing shrinks due to friction. It's a direct consequence of $a\propto x$: a bigger displacement comes with proportionally bigger restoring acceleration, so extra distance and extra acceleration scale together, leaving the cycle time unchanged.

Worked exampleFinding the spring constant from a measured period
1
A mass of $0.25\,\text{kg}$ on a spring completes 20 full oscillations in $18.4\,\text{s}$. Find the spring constant.
2
Period per oscillation: $T = \dfrac{18.4}{20} = 0.92\,\text{s}$.
Timing many oscillations and dividing reduces the percentage error from reaction-time uncertainty in starting/stopping a stopwatch — the same idea used in the Required Practical below.
3
Rearrange $T=2\pi\sqrt{m/k}$ for $k$: square both sides, $T^2 = 4\pi^2\dfrac{m}{k}$, so $k = \dfrac{4\pi^2m}{T^2}$.
4
$k = \dfrac{4\pi^2\times0.25}{0.92^2} = \dfrac{9.87}{0.846} \approx 11.7\,\text{N}\,\text{m}^{-1}$.
▪ solved

Required Practical: Investigating Simple Harmonic Motion

AQA Required Practical

This is AQA's Required Practical 7: investigating the period of an oscillating system.

Equipment

EquipmentPurpose
Spring + mass set, or pendulum bob and stringThe oscillating system under investigation
Retort stand and clampSuspends the spring or pendulum securely
Split cork / clampFixes the pendulum's point of suspension precisely, for a consistent length measurement
StopwatchTimes multiple oscillations
Metre rulerMeasures pendulum length $l$ (or spring extension, if needed)
Fiducial markerMarks the equilibrium position, giving a fixed, high-speed point to time from
ProtractorChecks the pendulum's starting angle stays small (below about 10°)

Method

MethodFinding T² against l (or m)
1
For a pendulum: clamp the string securely (e.g. between a split cork) and measure its length $l$ from the point of suspension to the centre of the bob. For a mass-spring system: suspend the spring vertically and attach a known mass to its free end.
2
Place a fiducial marker at the system's equilibrium (rest) position, to time against.
3
Displace the system by a small amount — for a pendulum, less than about 10° from vertical, checked with a protractor — and release it.
4
Using the stopwatch, time 20 complete oscillations, starting and stopping the watch as the system passes the fiducial marker (where it's moving fastest, making the exact moment easiest to judge).
5
Divide the total time by 20 to find the period $T$ for one oscillation.
6
Repeat the timing three times at the same length (or mass) and average, to reduce random error.
7
Repeat steps 1–6 for a range of different pendulum lengths $l$ (or masses $m$, or spring constants using different springs/combinations).
8
Since $T \propto \sqrt{l}$ (or $\sqrt{m}$) would give a curved graph, linearise by plotting $T^2$ against $l$ (or $m$): $T^2 = \dfrac{4\pi^2}{g}\,l$ for a pendulum, $T^2 = \dfrac{4\pi^2}{k}\,m$ for a mass-spring system — both straight lines through the origin.
9
Find the gradient of the best-fit line and rearrange to extract $g$ (pendulum) or $k$ (mass-spring): $g=\dfrac{4\pi^2}{\text{gradient}}$.
▪ method

Sources of error and how to minimise them

Reaction time when timing manually

A fixed reaction-time uncertainty (perhaps ±0.2 s) becomes a much smaller percentage of the total time when timing 20 oscillations rather than 1 — always time as many oscillations as practical and divide, rather than timing a single swing.

Large amplitude invalidating the SHM approximation

A pendulum swinging through too large an angle deviates from true SHM, systematically distorting the measured period away from $T=2\pi\sqrt{l/g}$. Keep the starting displacement small (below about 10°) throughout, checked with a protractor.

Inconsistent reference point for length

Measuring $l$ to the top or bottom of the bob instead of consistently to its centre introduces a small but avoidable systematic error into every reading, and hence into the gradient (and $g$) extracted from the graph. Always measure to the same point — the centre of the bob.

Air resistance and pivot friction damping the motion

Damping gradually shrinks the amplitude and can slightly affect timing over many oscillations. Use a dense, compact bob to minimise air resistance, and minimise friction at the pivot.

Key takeaways

  • SHM solutions: $x=x_0\cos(\omega t)$, $v=-x_0\omega\sin(\omega t)$, $a=-x_0\omega^2\cos(\omega t)$ (released from rest at max displacement); sine and cosine swap if released from the centre at maximum speed instead.
  • $v = \pm\omega\sqrt{x_0^2-x^2}$ links speed directly to displacement, without needing time — maximum speed at $x=0$, zero speed at $x=\pm x_0$.
  • On x/v/a-against-time graphs: $v$ leads $x$ by a quarter cycle (90°); $a$ is exactly out of phase with $x$ (180°), consistent with $a=-\omega^2x$.
  • Period formulae: mass-spring $T=2\pi\sqrt{m/k}$; simple pendulum (small angle) $T=2\pi\sqrt{l/g}$. Neither depends on amplitude.
  • AQA Required Practical 7: time 10–20 oscillations and divide to reduce percentage timing error; plot $T^2$ against $l$ (or $m$) for a straight line through the origin, and use the gradient to find $g$ (or $k$).