The Physical Pendulum
From the small-angle harmonic approximation to the exact solution via Jacobi elliptic functions — with a live pendulum, phase portrait, and period divergence at the separatrix.
Equation of motion
A pendulum of length $L$ and mass $m$ in gravity $g$ satisfies
$$\ddot\theta + \frac{g}{L}\sin\theta = 0.$$For small angles $\theta \ll 1$ we replace $\sin\theta \approx \theta$, giving simple harmonic motion with period $T_0 = 2\pi\sqrt{L/g}$ — independent of amplitude. For large amplitudes this approximation breaks down badly, and the true period depends on the initial angle through a complete elliptic integral.
The exact solution is obtained from energy conservation. With $\dot\theta = 0$ at the maximum angle $\theta_0$, the energy equation gives
$$\frac{d\theta}{dt} = \pm\sqrt{\frac{2g}{L}(\cos\theta - \cos\theta_0)}.$$Substituting $\sin(\theta/2) = k\sin\varphi$ where $k = \sin(\theta_0/2)$ transforms this into a standard elliptic integral of the first kind.
Exact period
The quarter-period — time from $\theta = 0$ to $\theta = \theta_0$ — equals
$$\frac{T}{4} = \sqrt{\frac{L}{g}}\int_0^{\pi/2}\frac{d\varphi}{\sqrt{1 - k^2\sin^2\varphi}} = \sqrt{\frac{L}{g}}\,K(k^2),$$so the exact period is
$$\boxed{T = 4\sqrt{\frac{L}{g}}\,K(k^2), \quad k = \sin\!\left(\frac{\theta_0}{2}\right).}$$Here $K(m) = \int_0^{\pi/2}(1 - m\sin^2\varphi)^{-1/2}\,d\varphi$ is the complete elliptic integral of the first kind. As $\theta_0 \to \pi$ (pendulum approaches vertical), $k \to 1$ and $K(k^2) \to \infty$ logarithmically — the period diverges.
The familiar small-angle result $T_0 = 2\pi\sqrt{L/g}$ is the limiting case $K(0) = \pi/2$, giving $T = 4\sqrt{L/g}\cdot\pi/2 = 2\pi\sqrt{L/g}$.
Series expansion
Expanding $K(k^2)$ in powers of $k = \sin(\theta_0/2)$ gives the asymptotic series
$$T = T_0\left(1 + \frac{1}{16}\theta_0^2 + \frac{11}{3072}\theta_0^4 + \cdots\right), \quad \theta_0 \ll 1.$$At $\theta_0 = 30°$ the first correction term is already sufficient; by $60°$ three terms are needed for 0.1% accuracy. Beyond $120°$ no finite truncation is adequate — you must evaluate $K(k^2)$ exactly.
| θ₀ | k² | K(k²) | T / T₀ (exact) | T / T₀ (small-angle) | Error |
|---|
Exact trajectory via Jacobi sn
The full time-domain solution uses the Jacobi elliptic function $\operatorname{sn}(u \mid m)$. Released from rest at $\theta_0$ (so $\dot\theta(0) = 0$), the exact angle is
$$\theta(t) = 2\arcsin\!\left(k\,\operatorname{sn}\!\left(K(k^2) - \sqrt{\frac{g}{L}}\,t\;\Big|\;k^2\right)\right), \quad k = \sin\!\left(\frac{\theta_0}{2}\right),$$where $K(k^2)$ is the complete elliptic integral of the first kind. The angular velocity is
$$\dot\theta(t) = -2k\sqrt{\frac{g}{L}}\,\operatorname{cn}\!\left(K(k^2) - \sqrt{\frac{g}{L}}\,t\;\Big|\;k^2\right).$$Initial conditions verified: $\operatorname{sn}(K \mid k^2) = 1$, so $\theta(0) = 2\arcsin k = \theta_0$ ✓; $\operatorname{cn}(K \mid k^2) = 0$, so $\dot\theta(0) = 0$ ✓. Small-angle limit: $k \to 0$, $K(0) = \pi/2$, $\operatorname{sn}(\pi/2 - \omega_0 t \mid 0) = \cos(\omega_0 t)$ → $\theta(t) \approx \theta_0\cos(\omega_0 t)$ ✓.
Phase portrait and energy curves
Each orbit in the $(\theta, \dot\theta)$ plane is a level set of the conserved energy
$$E = \frac{1}{2}\dot\theta^2 - \frac{g}{L}\cos\theta = -\frac{g}{L}\cos\theta_0.$$This gives the phase-portrait equation
$$\dot\theta = \pm\sqrt{\frac{2g}{L}(\cos\theta - \cos\theta_0)}.$$The family of curves is parameterized by $k^2 = \sin^2(\theta_0/2) \in [0,1)$ for libration (bounded oscillation) and $k^2 > 1$ for rotation (full revolution). The boundary $k = 1$ is the separatrix, the heteroclinic orbit connecting the unstable equilibria at $\theta = \pm\pi$.
Jacobi elliptic functions
The three functions $\operatorname{sn}$, $\operatorname{cn}$, $\operatorname{dn}$ are defined via the amplitude $\varphi = \operatorname{am}(u \mid m)$ — the inverse of $F(\varphi \mid m)$:
$$\operatorname{sn}(u \mid m) = \sin\varphi, \quad \operatorname{cn}(u \mid m) = \cos\varphi, \quad \operatorname{dn}(u \mid m) = \sqrt{1 - m\sin^2\varphi}.$$They satisfy the differential equations
$$\frac{d\,\operatorname{sn}}{du} = \operatorname{cn}\,\operatorname{dn}, \quad \frac{d\,\operatorname{cn}}{du} = -\operatorname{sn}\,\operatorname{dn}, \quad \frac{d\,\operatorname{dn}}{du} = -m\,\operatorname{sn}\,\operatorname{cn},$$and the identities $\operatorname{sn}^2 + \operatorname{cn}^2 = 1$, $m\,\operatorname{sn}^2 + \operatorname{dn}^2 = 1$.
For the pendulum: $\operatorname{sn}$ gives $\theta(t)$, $\operatorname{cn}$ gives $\dot\theta(t)$, and $\operatorname{dn}$ gives the kinetic energy factor. The modulus $m = k^2$ controls the shape — from sinusoidal ($m = 0$) to hyperbolic ($m = 1$).
The separatrix and period divergence
As $\theta_0 \to \pi^-$ (pendulum released just below vertical), $k \to 1$ and the period diverges logarithmically:
$$K(k^2) \;\underset{k\to 1}{\sim}\; \ln\!\frac{4}{\sqrt{1-k^2}} \;=\; \ln\!\frac{4}{\cos(\theta_0/2)}.$$Physically: near the inverted equilibrium the restoring force vanishes and the pendulum lingers indefinitely. This is the separatrix in the phase portrait — the boundary between oscillation and rotation. The exact form at $k = 1$ is the heteroclinic orbit
$$\theta(t) = 4\arctan\!\left(e^{\sqrt{g/L}\,t}\right) - \pi, \quad \dot\theta = 2\sqrt{\frac{g}{L}}\operatorname{sech}\!\left(\sqrt{\frac{g}{L}}\,t\right).$$The physical (compound) pendulum
A real pendulum is not a point mass on a massless rod. For an extended rigid body pivoting about a fixed axis, the equation of motion is
$$I\ddot\theta + mgd\sin\theta = 0,$$where $I$ is the moment of inertia about the pivot and $d$ is the distance from the pivot to the centre of mass. Defining the equivalent length $L_\text{eq} = I/(md)$, this is identical to the mathematical pendulum with $L \to L_\text{eq}$. The exact period is therefore
$$T = 4\sqrt{\frac{I}{mgd}}\,K(k^2), \quad k = \sin\!\left(\frac{\theta_0}{2}\right).$$The equivalent length is always $\geq$ the distance $d$ (by the parallel-axis theorem), so the physical pendulum is always slower than a simple pendulum of length $d$.
Common shapes
| Shape | Pivot | $I$ | $d$ | $L_\text{eq} = I/(md)$ |
|---|---|---|---|---|
| Point mass on rod (length $L$) | End | $mL^2$ | $L$ | $L$ |
| Uniform rod (length $L$) | End | $\tfrac{1}{3}mL^2$ | $L/2$ | $\tfrac{2}{3}L$ |
| Uniform rod (length $L$) | $L/4$ from end | $\tfrac{7}{48}mL^2$ | $L/4$ | $\tfrac{7}{12}L$ |
| Solid disk (radius $R$) | Edge | $\tfrac{3}{2}mR^2$ | $R$ | $\tfrac{3}{2}R$ |
| Hollow ring (radius $R$) | Edge | $2mR^2$ | $R$ | $2R$ |
Summary
| Quantity | Small-angle | Exact (elliptic) |
|---|---|---|
| Period $T$ | $2\pi\sqrt{L/g}$ | $4\sqrt{L/g}\,K(k^2)$ |
| Trajectory $\theta(t)$ | $\theta_0\cos(\omega_0 t)$ | $2\arcsin\!\left(k\operatorname{sn}(K(k^2){-}\omega_0 t\mid k^2)\right)$ |
| Angular velocity $\dot\theta(t)$ | $-\theta_0\omega_0\sin(\omega_0 t)$ | $-2k\omega_0\operatorname{cn}(K(k^2){-}\omega_0 t\mid k^2)$ |
| At separatrix ($\theta_0\to\pi$) | Breaks down | $\theta(t) = 4\arctan(e^{\omega_0 t}) - \pi$ |
| Valid for | $\theta_0 \lesssim 15°$ (<1% error) | All $\theta_0 \in (0°, 180°)$ |
Code
Using the elliptic-functions Python package:
import numpy as np, elliptic g, L, theta0 = 9.81, 1.0, 2.5 # near separatrix: 143° k = np.sin(theta0 / 2) K = float(elliptic.cel1(np.sqrt(1 - k**2))) # K(k²) T = 4 * K * np.sqrt(L / g) # exact period t = np.linspace(0, T, 500) sn, cn, dn, _ = elliptic.ellipj(K - t * np.sqrt(g / L), k**2) theta = 2 * np.arcsin(k * np.asarray(sn)) theta_dot = -2 * k * np.sqrt(g / L) * np.asarray(cn)
In MATLAB/Octave:
g = 9.81; L = 1.0; theta0 = 2.5; k = sin(theta0/2); K = cel1(sqrt(1 - k^2)); % K(k²) T = 4 * K * sqrt(L/g); t = linspace(0, T, 500); [sn, cn] = ellipj(K - t * sqrt(g/L), k^2); theta = 2 * asin(k * sn); theta_dot = -2 * k * sqrt(g/L) * cn;