Deriving the Heat Equation

A hot cup of coffee left on the table always cools down. It never gets hotter by itself, and it never cools in fits and jerks — the temperature glides smoothly from steaming to lukewarm to room temperature. Heat only ever flows from hot to cold, spreading out and evening itself along the way, never the other way round.

That everyday smoothing has an exact mathematical law behind it: u_t = \alpha\,u_{xx}, the heat equation. It isn't just a famous equation — it is the very equation Joseph Fourier set out to solve two centuries ago, and wrestling with it is what pushed him to invent the idea of writing any function as a sum of sines and cosines, the Fourier series. This page builds the equation up from first principles, then digs into what it is really saying.

The heat equation isn't pulled from a hat — it falls out of two physical facts about a thin rod whose temperature is u(x, t).

Fourier's law of conduction. Heat flows from hot to cold, at a rate proportional to the temperature gradient. The heat flux (energy per unit area per unit time) is

q = -k\,u_x,

where k > 0 is the conductivity. The minus sign encodes "downhill": where temperature decreases to the right (u_x < 0), heat flows right (q > 0).

Conservation of energy closes it

Energy balance. In a slice [x, x + \Delta x], the stored heat changes at the rate energy flows in minus the rate it flows out:

\rho c\,\Delta x\,u_t \approx q(x) - q(x + \Delta x) = -\big(q(x+\Delta x) - q(x)\big).

Divide by \Delta x and let it shrink — the right-hand side becomes -q_x:

\rho c\,u_t = -q_x = -(-k\,u_x)_x = k\,u_{xx}.

Collecting constants into the thermal diffusivity \alpha = k/(\rho c) gives the heat equation:

\boxed{\,u_t = \alpha\,u_{xx}.\,}

Its meaning is wonderfully simple. The second derivative u_{xx} measures how far a point sits below the average of its neighbours; the equation says temperature rises wherever a point is a local dip and falls wherever it is a local bump. That is diffusion: everything is pulled toward the local average, so bumps melt and the profile smooths.

A sharp spike vanishes fast; a gentle bump lingers

Picture a metal rod, cold everywhere except one narrow patch heated with a blowtorch into a sharp spike. Compare it with a second, identical rod given the same extra heat, but spread out into a wide, gentle bump. Both rods obey exactly the same equation u_t = \alpha\,u_{xx} — yet they do not behave alike at all.

Right at the spike's peak the profile is sharply curved, so u_{xx} is a large negative number there, which makes u_t hugely negative too — the peak collapses almost at once as heat rushes sideways into the cooler rod. The gentle bump is only mildly curved, so u_{xx} is small and its peak falls only slowly. Watch the two rods for a while: the spike has already rounded into a soft, low hump while the bump has barely changed shape. Given long enough, both settle to the same flat, lukewarm rod — the equation can't tell a sharp start from a smooth one once enough time has passed, only how quickly each one gets there.

Watch it smooth

A starting profile \sin x + \sin 3x on [0, \pi] (with \alpha = 1) evolves as u = e^{-t}\sin x + e^{-9t}\sin 3x. Advance time: the \sin 3x wiggle (decay rate 9) vanishes far faster than the smooth \sin x (rate 1), so the fine detail disappears first and the bump flattens toward zero.

The material decides the speed: the diffusivity \alpha

Two rods can obey exactly the same heat equation and still cool at wildly different speeds, because \alpha = k/(\rho c) is a property of the material, not of the shape of the temperature profile. A large \alpha means heat glides through effortlessly; a tiny \alpha means it barely creeps along.

A rod of copper has a diffusivity of roughly \alpha \approx 1.1 \times 10^{-4}\ \mathrm{m^2/s} — a hot spot spreads out and evens away in seconds. A rod of the same size and shape made of foam insulation can have an \alpha a thousand times smaller; the very same hot spot might take hours to noticeably even out. That is exactly why a metal spoon left standing in hot soup burns your fingers within seconds, while the soup itself — and the insulating handle of a good saucepan — stays comfortable to touch: the metal has a huge \alpha, the insulation a tiny one, and the very same equation governs both.

The heat equation is a one-way street. Give it a starting profile and it happily predicts the future: smoother and smoother, forever forward in time. But try to run it backward — asking "what earlier, presumably sharper, profile would smooth into the one I see right now?" — and the process falls apart.

The trouble is that smoothing destroys information: countless different starting profiles can smooth into almost the same shape a moment later, so there is no reliable way to undo it. Tiny, unavoidable errors in today's measurement blow up into wilder and wilder guesses about the past. Mathematicians call this a famous example of an ill-posed problem — the forward heat equation behaves beautifully, but its reverse does not, and no amount of computing power fixes that; it is baked into the equation itself.

Write u_t = \alpha\,u_{xx} on a fresh page, relabel the letters, and it stops being about temperature at all. Let u be the concentration of a drop of dye dissolved in a glass of still water instead of temperature, and the very same equation predicts how the colour spreads out and fades. Let u be a probability instead of a substance, and it describes how the likely position of a jittering pollen grain — Brownian motion — spreads out over time.

Stranger still, a clever change of variables turns the famous Black–Scholes equation for pricing stock options into this exact same heat equation in disguise — a result that startled the mathematicians of finance almost as much as it would have startled Fourier, who invented all this machinery just to keep track of a cooling cannon barrel.

See it explained