Login
📚 Differential Equations, Interactive Edition
Chapters ▾
⇩ Download ▾

4.2 The Pendulum and Its Energy

A pendulum — a mass on a rigid rod of length L — obeys θ+(g/L)sinθ=0. For small swings sinθθ, and this is Chapter 2's spring: oscillation at the natural frequency g/L. But a pendulum is not a spring. Push it hard enough and it goes over the top, something no linear equation ever does, so this section keeps the sine. Measuring time in units of L/g scrubs out the constants, leaving

x + sin x = 0 ,

or, as a system, x=y, y=sinx, where x is the angle from straight down and y the angular velocity.

The system rests wherever y=0 and sinx=0: the points (nπ,0). At even multiples of π the pendulum hangs straight down; at odd multiples it balances upside down. Near the bottom, sinxx gives the center x+x=0 — closed loops, dimensionless period 2π. Near the top, setting u=xπ gives u=sin(u+π)=sinuu: precisely the saddle in disguise from the last section, eigenvalues ±1. So the portrait must alternate — center, saddle, center, saddle — forever along the x-axis. What no linearization can say is how these local pictures knit together, and for that the pendulum volunteers a global gift. Multiply x+sinx=0 by x and recognize both terms as derivatives: ddt(12(x)2cosx)=0. The energy

[01cos(x)0]
The Jacobian of the pendulum system ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The Jacobian of the pendulum system, computed exactly by mojo-cas mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The linearization of x=y, y=sinx at any point, computed from the system itself. The alternation is visible in one entry: cosx is 1 at the hanging equilibria x=0,±2π and +1 at the inverted ones x=±π — the sign flip that turns each center into a saddle and back.

1+L2
Characteristic polynomial at the inverted equilibrium ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text Characteristic polynomial at the inverted equilibrium, computed exactly by mojo-cas mojocas 0.1.0, and confirmed to agree with the result stated in the text.

At x=π the Jacobian is [0110], so det(JλI) is the polynomial shown — whose roots are the eigenvalues ±1 named above, one positive and one negative, which is exactly what a saddle is. (L stands for λ.)

H ( x , y ) = y 2 2 cos x

— kinetic plus potential — is constant along every solution. That is a confession of imprisonment: each solution is confined for all time to a single level curve of H. To draw the complete phase portrait of an unsolvable nonlinear equation, no solving is required. Draw the contour map of H.

A flat map of dark nested curves: small closed ovals ringing the points x = 0 and x = plus or minus 2 pi on the horizontal axis, a pair of curves crossing at x = plus or minus pi that form cat's-eye corners, and open wavy curves running left to right above and below everything. Each curve is one energy level of the pendulum, so each is one possible motion: back-and-forth swings inside the eyes, over-the-top spinning outside.Explore in 3D (opens in a new tab)
Fourteen level curves of the energy H(x,y)=y2/2cosx on 6.5x6.5, 3y3, viewed face-on — the complete phase portrait of the pendulum. Closed ovals ring the resting equilibria at x=0 and x=±2π; the self-crossing curve through (±π,0) is the separatrix; the open wavy curves above and below it are over-the-top whirls.

Explore

  1. Observe. Three families of curves, three kinds of motion. The nested ovals around (0,0) and (±2π,0) are back-and-forth swings; the open curves running the full width of the window are whirls, over the top in the same direction forever; and the cat's-eye curve crossing itself at (±π,0)(±3.14,0) — the separatrix — is the frontier between them.
  2. Predict. No arrows are drawn. Use x=y: in the upper half-plane x must increase. Which way do the ovals circulate, and which way do the upper whirl curves run? Decide, then check that the lower half-plane tells a consistent story.
  3. Verify. The separatrix carries the energy of the balanced-upright state, H(±π,0)=1. Setting x=0 in y2/2cosx=1 gives y=2: the cat's-eye should stand exactly 2 grid units above and below the origin. Check it against the grid.
  4. Observe. The whirl curves undulate: farthest from the axis over x=0 and x=±2π, closest over x=±π. A whirling pendulum is fastest through the bottom and slowest over the top — readable straight off the map.
  5. Predict, then verify. An oval reaching maximum angle xmax has H=cosxmax, so it crosses the y-axis at height y=2(1cosxmax)=2sin(xmax/2). For the oval reaching out near xmaxπ/2, predict the height of its top — about 1.4 — then check.

The Lift

Why should the level curves of a function be the orbits of a system? The most convincing answer is to stop flattening. H is a function of two variables, so it is a landscape — a surface z=H(x,y) standing over the phase plane — and a level curve is a horizontal slice of that landscape, dropped to the floor. The second figure performs the lift.

A half-transparent rolling surface shaped like an egg carton stretched along one direction - bowls at x = 0 and x = plus or minus 2 pi, saddle passes between them - floating above a flat sheet of dark curves at height zero. Every dark curve is a horizontal slice of the surface dropped to the floor, so the pendulum's phase portrait is revealed as the surface's contour map.Explore in 3D (opens in a new tab)
The energy landscape z=H(x,y)=y2/2cosx, half-transparent, floating above its own fourteen-level contour map in the plane z=0. Bowls sit over the resting equilibria at x=0 and x=±2π; mountain passes of height 1 sit over the saddle points (±π,0); every orbit on the floor is a horizontal slice of the surface overhead.
  1. Observe. The surface is an egg carton stretched along the x-direction — bowls at the hanging equilibria, passes between them — with walls climbing like y2/2 toward the front and back. Orbit the camera until you can see one floor curve and the surface slice directly above it at the same time.
  2. Predict, then verify. A horizontal slice below pass height (1<H<1) is trapped inside one bowl; dropped to the floor it is a closed ring around a well — a swing. A slice above every pass (H>1) clears the whole range and runs unbroken from end to end — a whirl. Match each family on the floor to its slice height on the surface.
  3. Observe. The slice at exactly pass height, H=1, pinches onto the passes themselves: dropped down, it is the separatrix, crossing itself precisely at the saddle points. The frontier between swinging and whirling is the altitude of a mountain pass.

Connect

One picture now settles questions that formulas struggle with. The bottom equilibrium is the floor of a bowl, and nearby slices are small closed rings: a pendulum nudged from rest swings near rest forever — stable, though not attracting, since nothing here dissipates. The top equilibrium is a mountain pass, terrain falling away on two sides, the slice through it crossing itself: the saddle instability of the last section, now with a topographic reason. Even timing is visible: ovals deep in a bowl are traversed with period near 2π, ovals near the separatrix take longer and longer, and the separatrix itself takes forever — released ever closer to upside down, the pendulum hangs ever longer near the top before committing.

The landscape also explains what conservation costs. Add a little friction, x+cx+sinx=0, and the energy obeys ddtH=cy20: the state can no longer hold its altitude and slides downhill across the level sets, every swing and every whirl eventually spiraling into some well. The contour map stops being the portrait, but the landscape still governs — now as terrain being descended. That is Chapter 2's inward spiral, seen from above.

Crossing the Threshold

The contour map is an argument from conservation: orbits must lie on level curves, so drawing the levels draws the orbits. It is worth watching the same picture arrive by a completely different route — integrating the system forward in time, step by step, with no mention of energy at all. The figure below launches the pendulum from the bottom at three speeds, one either side of the threshold y0=2 and one exactly on it, and integrates.

Four computed trajectories drawn over a faint gray copy of the pendulum's energy contour map, all launched from marked points on the vertical axis. From the lowest mark a red closed oval traces round and round one well — a swing. From the mark at height 2 an orange curve leaves rightward and flattens as it creeps toward the balance point near x = 3.1 without ever arriving, retracing the separatrix. From the highest mark a blue wavy curve runs off the right edge above the separatrix — a whirl — and its mirror twin, launched downward, runs off the left edge below. Each computed curve lies exactly along one of the faint contour lines beneath it.Explore in 3D (opens in a new tab)
Three launch speeds from the hanging position, integrated numerically over the faint energy contour map. Red starts at y0=1.2 and closes into a swing; orange starts at exactly y0=2 and creeps toward the balance point; blue starts at y0=2.6 and whirls over the top, with a mirror launch downward.
  1. Observe. Follow the red trajectory. It closes on itself — the pendulum returns to its starting state and repeats forever. Which family of the contour map does it belong to?
  2. Predict. The orange launch is exactly at the threshold energy. Before looking closely: does it reach the balance point at x=π, and if it does, what happens next?
  3. Verify. Trace the orange curve toward x3.14. It flattens and slows without arriving, because arriving would mean sitting at an equilibrium — and a solution that reaches an equilibrium in finite time would have to leave it again, which no solution of an autonomous system does.
  4. Observe. The blue curve never returns to the axis: it runs off the right edge, having gone over the top. Its downward-launched twin runs off to the left. Compare their undulation with the map's whirl curves.
  5. Predict, then verify. Each computed curve should lie exactly on top of one faint contour line, because energy is conserved along solutions. Check one, and say what a visible drift off the contour would have told you about the integrator rather than about the pendulum.

An original work of XYZ Homework, built around interactive XYZ 3D figures, following the standard first-course sequence (first-order equations through systems and the phase plane). Distinct from the LibreTexts-sourced Differential Equations for Engineers (Lebl) edition, which has its own attribution. License: CC-BY-NC-SA-4.0.