The problem on a rod, stated cleanly
The previous guide derived the heat equation u_t = k u_xx from conservation of energy: temperature flows down its own gradient, and the net flow into a tiny slab heats it up. Now we stop admiring the equation and solve a concrete version of it. Picture a thin metal rod of length L, insulated along its sides so heat only moves lengthwise. Its two ends are clamped in ice at zero degrees, and at the starting moment its temperature profile is some given shape f(x). We want u(x,t): the temperature everywhere, at every later time.
Three pieces of information pin down the answer, and it helps to name them. The PDE u_t = k u_xx holds in the interior, for 0 < x < L and t > 0. The boundary conditions fix the ends: u(0,t) = 0 and u(L,t) = 0 for all t — these are homogeneous Dirichlet conditions, the ice baths. The initial condition fixes the start: u(x,0) = f(x). A PDE alone has a whole function's worth of freedom; it is exactly these boundary and initial data that select the single physical solution. This package is the heat initial-boundary-value problem.
The guess that space and time pull apart
Here is the leap of faith that names the method. We look for solutions of the special product form u(x,t) = X(x) T(t): a fixed spatial shape X(x) whose overall amplitude is dialed up or down in time by a single factor T(t). This is the product-solution ansatz. There is no guarantee the true answer looks like this — and in general it will not — but if we can find enough such pieces, superposition (the heat equation is linear) lets us add them back into the full solution. So we hunt for the building blocks first.
Substitute u = X(x) T(t) into u_t = k u_xx. The time derivative only touches T, the space derivative only touches X, so we get X(x) T'(t) = k X''(x) T(t). Now divide both sides by k X(x) T(t) and watch the magic: T'/(kT) on the left depends only on t, while X''/X on the right depends only on x. A function of t alone equals a function of x alone. The only way that can hold for every x and every t is if both sides equal the same constant. We call it the separation constant, and writing it as a negative number, -lambda, will save us a sign headache in a moment.
u(x,t) = X(x) T(t) into u_t = k u_xx
X T' = k X'' T
divide by k X T:
T' X''
---- = ----- = -lambda (a constant, same for both)
k T X
=> X'' + lambda X = 0 (space, with X(0)=X(L)=0)
T' + k lambda T = 0 (time)The spatial eigenvalue problem picks the shapes
Look at the space equation: X'' + lambda X = 0, with X(0) = 0 and X(L) = 0 inherited from the ice baths (since u(0,t) = X(0) T(t) = 0 must hold for all t, X(0) must be zero, and likewise at L). This is not an ordinary boundary problem where you plug in any lambda and get an answer. For most values of lambda the only solution satisfying both ends is the boring X = 0, which gives u = 0 — no heat at all. The interesting question is: for which special lambda does a nonzero shape survive? That is the spatial eigenvalue problem, and the surviving lambda are the eigenvalues, the shapes their eigenfunctions.
Solving X'' + lambda X = 0 case by case settles it. If lambda were zero or negative, the solutions are straight lines or growing-and-decaying exponentials, and the only way to make both ends vanish is X = 0 again — dead. Only lambda > 0 works: there the solutions oscillate, X(x) = sin(sqrt(lambda) x) (the cosine piece is killed by X(0) = 0), and X(L) = 0 forces sin(sqrt(lambda) L) = 0. That happens exactly when sqrt(lambda) L is a whole multiple of pi. So the allowed eigenvalues are lambda_n = (n pi / L)^2 for n = 1, 2, 3, ..., and the shapes are the sine modes X_n(x) = sin(n pi x / L).
These sine modes are the natural shapes of the rod, exactly the standing patterns you would expect on a clamped string — half a wave, a full wave, three half-waves, and so on, each pinned to zero at both ends. Larger n means a more wrinkled shape with more zero-crossings. Keep that in your pocket; in a moment the wrinklier modes will turn out to be the ones that die fastest.
Time supplies the decay, mode by mode
Now the easy half. Each eigenvalue lambda_n hands its value to the time equation T' + k lambda_n T = 0, a first-order linear ODE you met two rungs down. Its solution is a pure exponential, T_n(t) = e^(-k lambda_n t) = e^(-k (n pi / L)^2 t). Because lambda_n > 0, every one of these decays toward zero — heat always leaks out to the icy ends, never spontaneously piles up. Multiplying the matching pieces gives one elementary solution, a single cooling mode: u_n(x,t) = sin(n pi x / L) · e^(-k (n pi / L)^2 t).
Stare at the decay rate, k (n pi / L)^2. It grows like n^2, so the higher modes vanish dramatically faster than the low ones. The wrinkly, high-frequency wiggles — the sharp, fine detail in the initial temperature — are erased almost immediately, while the broad, gentle n = 1 hump lingers longest. This is the decay of Fourier modes, and it is the engine behind the heat equation's famous smoothing: rough features are precisely the high modes, and they are punished hardest. A whole later guide is devoted to this, but you can already see it written in the exponent.
Matching the initial data with a Fourier series
We have an infinite family of cooling modes, each one a legitimate solution that respects the equation and the ice baths. But a single mode rarely matches the given start f(x); a real initial temperature is some arbitrary hump, not a perfect sine. Superposition rescues us: any linear combination of solutions is again a solution. So we form the sum u(x,t) = sum over n of b_n · sin(n pi x / L) · e^(-k (n pi / L)^2 t), with coefficients b_n still free, and use that freedom to hit the initial condition.
Set t = 0. The exponentials all become 1, and the requirement u(x,0) = f(x) reads f(x) = sum of b_n sin(n pi x / L). That is precisely the demand that f be written as a Fourier sine series — exactly the right basis, because the sines are the shapes the boundary conditions forced on us. The coefficients come from orthogonality: distinct sine modes integrate to zero against each other over [0,L], so multiplying by sin(m pi x / L) and integrating isolates a single b_m. This is matching the initial condition, and it is the step that finally pins every dial.
- Separate. Substitute u = X(x)T(t), divide through, and read off X'' + lambda X = 0 and T' + k lambda T = 0, joined by the constant lambda.
- Solve the space problem. With X(0)=X(L)=0, only lambda_n = (n pi / L)^2 give nonzero shapes X_n = sin(n pi x / L).
- Solve the time problem. Each lambda_n gives the decay factor T_n = e^(-k (n pi / L)^2 t), so the mode is u_n = X_n T_n.
- Superpose and match. Add the modes with coefficients b_n; at t=0 demand f(x) = sum b_n sin(n pi x / L), and read off b_n = (2/L) integral over [0,L] of f(x) sin(n pi x / L) dx.
And we are done: plug those b_n back into the sum and the full solution is built. Notice the shape of the answer — a single arbitrary input f turned into infinitely many coefficients, each riding its own decaying exponential. The initial data, which was a whole function's worth of freedom, has been completely absorbed into the b_n, and time does nothing but quietly shrink each term.
What it tells you, and where it stops
This single formula already exposes the deep personality of diffusion. As t grows, every term shrinks, so u → 0 everywhere: the rod forgets its past and relaxes to the cold equilibrium. After even a tiny time the high-n terms are gone, leaving a sum of a few smooth sines — so a jagged initial profile becomes instantly smooth, the smoothing effect in action. And run time backward, toward negative t: the exponentials become e^(+positive), the high modes explode, and the tiniest error in f blows up uncontrollably. That is why the backward heat equation is ill-posed — diffusion has a direction, and you cannot un-stir it.
Be honest, though, about how special the setup had to be. Separation of variables worked because three things lined up: the geometry was a clean interval whose ends sit at constant coordinates, the boundary conditions were homogeneous and constant in time, and the equation had constant coefficients so X and T truly decoupled. Change any of these and the clean sine-mode story can fail — a wiggly domain, a moving boundary, or coefficients that depend on both x and t will refuse to separate, and you must reach for other tools.
The two most important escape routes both grow naturally from here. Swap the icy Dirichlet ends for insulated Neumann ends and the sines become cosines; replace the sine basis by whatever eigenfunctions the geometry demands, and you have stepped into the broader Sturm-Liouville theory of a later rung. And to handle the infinite rod, where there are no walls to quantize the modes into a discrete list, the sum over n becomes an integral over a continuum — that is the heat kernel, the subject of the very next guide. Separation of variables is the doorway; both of those are rooms beyond it.