Skip to content

The heat equation by separation of variables

6 min read

Short answer

For a rod 0≤x≤L0\le x\le L with ends held at 00, the solution of ut=k uxxu_t=k\,u_{xx} is u(x,t)=∑n≥1bnsin⁡nπxL e−k(nπ/L)2tu(x,t)=\sum_{n\ge1}b_n\sin\dfrac{n\pi x}{L}\,e^{-k(n\pi/L)^2t}, where the bnb_n are the sine-series coefficients of the initial temperature. Higher modes die out faster, so the profile smooths over time.

Bar chartn=1n=2n=3n=4Decay factors e^(−n²t) at t = 1: only the first mode survives.
Mode n decays like exp(−n² t): the slowest mode dominates later.

The steps

Try u=X(x)T(t)u=X(x)T(t). Then T′kT=X′′X=−λ\dfrac{T'}{kT}=\dfrac{X''}{X}=-\lambda. The spatial problem X′′+λX=0X''+\lambda X=0, X(0)=X(L)=0X(0)=X(L)=0 forces λn=(nπ/L)2\lambda_n=(n\pi/L)^2 and Xn=sin⁡nπxLX_n=\sin\tfrac{n\pi x}{L}. Each mode has Tn=e−kλntT_n=e^{-k\lambda_nt}. Combine them by superposition and fit the initial condition with a Fourier sine series.

What it says physically

Heat flows from hot to cold, smoothing differences. Sharp features (high nn) vanish quickly; the smooth shape of the lowest mode lingers. All the heat eventually leaves through the cold ends.

Worked example

Solve ut=uxxu_t=u_{xx} on [0,π][0,\pi] with u(0,t)=u(π,t)=0u(0,t)=u(\pi,t)=0 and u(x,0)=3sin⁡x+sin⁡2xu(x,0)=3\sin x+\sin2x.

Here L=πL=\pi and k=1k=1, and the initial data is already a sum of modes. So u=3e−tsin⁡x+e−4tsin⁡2xu=3e^{-t}\sin x+e^{-4t}\sin2x. At t=0.5t=0.5 the amplitudes are 3e−0.5≈1.823e^{-0.5}\approx1.82 and e−2≈0.14e^{-2}\approx0.14: the second mode has nearly vanished.

Try it yourself

How fast does mode n=3n=3 decay compared with mode n=1n=1 for L=πL=\pi, k=1k=1?

Show the answer

Mode nn decays like e−n2te^{-n^2t}, so mode 33 decays like e−9te^{-9t} versus e−te^{-t}: nine times faster in the exponent.

Keep going with practice

Vidi's differential-equation lessons give you the ODEs that separation reduces this problem to.