Cooling a Rod: Separation of Variables in Practice
The problem
A metal rod of length \(L\) starts at a uniform 100 °C. At \(t = 0\) both ends are clamped to 0 °C. Find \(T(x,t)\), and answer the practical question the series raises: how many terms do you actually need?
Step 1: separate
Try \(T = X(x)\tau(t)\). Substituting and dividing by \(X\tau\):
The left side depends only on \(t\), the right only on \(x\), so both must equal a constant. That is the entire separation argument — and it is also where the method's limits live: it works because the domain is a rectangle in \((x,t)\) and the boundary conditions are homogeneous on lines of constant \(x\).
Step 2: solve the spatial eigenvalue problem
This is a Sturm–Liouville eigenproblem, and it is exactly the finite-dimensional problem of the normal modes lab taken to the continuum. Non-trivial solutions exist only for
The boundary conditions quantise \(\lambda\) — the same mechanism that quantises energy levels in a box, and it is worth noticing that nothing quantum is involved. Then \(\tau_n \propto e^{-\alpha\lambda_nt}\).
Step 3: match the initial condition with a Fourier series
At \(t=0\) this must equal the constant \(T_0\), so the \(b_n\) are the Fourier sine coefficients of a constant. Using the orthogonality \(\int_0^L\sin\frac{n\pi x}{L}\sin\frac{m\pi x}{L}dx = \frac{L}{2}\delta_{nm}\):
Even harmonics vanish because a constant is symmetric about the midpoint and even sine modes are antisymmetric — their overlap integral is zero. Symmetry doing work, as usual.
Step 4: how many terms?
Take \(L = 1\) m, \(\alpha = 10^{-2}\) m²/s, \(T_0 = 100\) °C, and watch the centre:
| \(t\) (s) | full series | one term only |
|---|---|---|
| 0 | 99.94 | 127.32 |
| 1 | 99.92 | 115.36 |
| 5 | 77.23 | 77.73 |
| 10 | 47.45 | 47.455 |
| 25 | 10.798 | 10.798 |
Two things stand out.
At \(t = 1\) the one-term approximation gives 115 °C — hotter than the rod ever was. That is not a bug: a single sine cannot represent a flat-topped profile, and truncating a Fourier series near a discontinuity overshoots. It is the Gibbs phenomenon, and at early times you need many terms.
By \(t = 10\) the one-term answer is right to four figures. The \(n\)-th mode decays as \(e^{-n^2\pi^2\alpha t/L^2}\) — quadratically in \(n\) in the exponent — so the third harmonic dies \(e^{-8\pi^2\alpha t/L^2}\) times faster than the first. After one time constant
everything but the fundamental has been annihilated.
This is the general lesson about diffusion: it is a low-pass filter of extraordinary severity. Fine structure is erased almost instantly, and the long-time behaviour of any initial condition is the slowest-decaying eigenmode with whatever amplitude it happened to start with. Which is why you can predict the late-time state of a diffusive system without knowing much about how it began.
Common mistakes
- Expecting even harmonics. They vanish by symmetry here. Change the initial condition to something asymmetric and they return.
- Truncating at one term at early times. See the 115 °C above.
- Forgetting that separation needs homogeneous boundary conditions. With ends held at 20 °C and 80 °C you must first subtract the steady linear profile, then expand the remainder.
- Using the wrong orthogonality weight. For this problem it is 1; for cylindrical or spherical geometry it is not, and the special functions carry their own weights.
Related
Partial differential equations · Fourier series · Eigenvalues & eigenvectors · Inner product spaces — orthogonality is a projection · Special functions · Fourier series builder — watch the Gibbs overshoot