Math Methods · interactive

The Heat & Wave Equations

Two of the most important PDEs in all of engineering look almost identical on paper — one has a first time-derivative, the other a second. That tiny difference is the whole personality: one diffuses and forgets, the other oscillates and remembers. Shape an initial state, pick an equation, and watch separation of variables play out mode by mode.

∂u/∂t = α ∂²u/∂x²
Heat equation. Both share the same spatial modes sin(nπx/L) pinned by the fixed ends — they differ only in how each mode evolves in time.

u(x, t) on a rod with both ends held fixed

initial state u(x,0) current u(x,t) individual modes

Modal spectrum · how much of each sin(nπx/L) is present now

Time
0.00
Modes kept
20
Energy remaining
100%

Equation

Initial state u(x,0)

Knobs

0.50
20

Separation of variables, made visible

Guess that the solution factors into a shape times a time: u(x,t) = X(x)·T(t). Plug it in and the PDE splits into two ODEs. The fixed ends force the spatial part to be X(x) = sin(nπx/L) — the same standing-wave shapes for both equations. So any initial state is first broken into those modes (a Fourier sine series, exactly like the Fourier builder), and then each mode evolves on its own. All the difference between heat and waves lives in that time factor T(t).

The heat equation forgets

For diffusion, each mode decays: T_n(t) = e^(−(nπ/L)²αt). The exponent grows with , so high-frequency wiggles vanish almost instantly while the smooth fundamental lingers. That's why heat smooths — start with a jagged square pulse and watch the corners melt within a blink, leaving a gentle hump that fades to flat. Information about the sharp initial detail is gone forever. Watch the modal spectrum collapse from the right.

The wave equation remembers

For vibration, each mode oscillates without decaying: T_n(t) = cos(nπct/L). Nothing is lost — the high modes keep ringing alongside the low ones, so sharp corners survive and the whole shape periodically reassembles itself. A plucked guitar string returns to its starting shape every period. Switch to Wave and watch the spectrum stay lit while the shape travels and rebuilds. Same modes, opposite fate — that's the lesson.

EngineeringCandy · analytic eigenmode (separation-of-variables) solution, summed live · shape it, switch it, learn