Separation of Variables
Here is a genuinely clever trick for taming many of the classical linear PDEs. A PDE mixes several
variables together — space and time, both changing at once — which is exactly what makes it harder
than an ordinary differential equation. So make a bold guess: suppose the solution
actually splits apart into a product of separate, single-variable functions,
u(x, t) = X(x)\,T(t),
one factor that only cares about x and another that only cares about
t. It sounds almost too optimistic to work — most functions of two
variables can't be split apart like that at all. But plug this guess into a linear PDE like the
heat
equation, and something remarkable happens: the single, coupled PDE falls apart into
two separate, much easier ordinary differential equations, one for
X alone and one for T alone. That collapse
from one hard problem into two easy ones is the entire engine behind
separation of variables.
The method, as a recipe, has four moves:
- Assume a product. Look for solutions of the form u(x, t) = X(x)\,T(t) — one factor per variable.
- Substitute and separate. Plug in and rearrange algebraically until everything depending on x sits on one side and everything depending on t sits on the other.
- Introduce a separation constant. A function of x alone can equal a function of t alone, for every x and every t, only if both sides equal the same constant — call it -\lambda.
- Solve the resulting ODEs and superpose the pieces to match the given data.
Watching the split happen
It's worth seeing the algebra once, in full, so the trick stops feeling like magic. Take the
one-dimensional heat equation u_t = \alpha\,u_{xx} and substitute the
product guess u = X(x)T(t). Because X doesn't
depend on t and T doesn't depend on
x, the partial derivatives simplify to ordinary derivatives of the
single-variable factors:
X(x)\,T'(t) = \alpha\,X''(x)\,T(t).
Now divide both sides by \alpha\,X(x)\,T(t) (wherever it's nonzero) to
push every t to the left and every x to the
right:
\frac{T'(t)}{\alpha\,T(t)} = \frac{X''(x)}{X(x)}.
Look closely at what this equation is claiming: the left-hand side is a function of
t only, and the right-hand side is a function of
x only — yet they're equal for every choice of
x and t, independently. Wiggle
x while holding t fixed and the left side
can't change, so the right side can't either. The only way a purely-t
expression can equal a purely-x expression for all inputs is if both are
secretly the same constant. Call that constant -\lambda, and the single
PDE has split cleanly into two ordinary differential equations:
X'' = -\lambda X \qquad \text{and} \qquad T' = -\alpha\lambda T.
The T equation is immediately solvable — it's exponential decay (or
growth), T(t) = e^{-\alpha\lambda t}. All the remaining work goes into
the X equation, and that's where the boundary conditions finally get to
speak.
The eigenvalue problem at its heart
Suppose the rod has length L and is held at zero temperature at both
ends: u(0, t) = u(L, t) = 0 for all t. Since
u = X(x)T(t) and T(t) is (generically) never
zero, those boundary conditions force X(0) = X(L) = 0 too. So the spatial
factor must solve the boundary-value problem
X'' = -\lambda X, \qquad X(0) = X(L) = 0.
This is an eigenvalue problem — the continuous cousin of
eigenvectors and eigenvalues.
Try \lambda \le 0 and the only solution satisfying both endpoint
conditions is the useless zero function. Try \lambda > 0 instead, and the
general solution X(x) = A\sin(\sqrt{\lambda}\,x) + B\cos(\sqrt{\lambda}\,x)
meets X(0) = 0 only if B = 0, and then meets
X(L) = 0 only if \sqrt{\lambda}\,L is a whole
multiple of \pi. That single geometric requirement — fit a whole number
of half sine-waves between the two fixed ends — sieves out a discrete list of allowed values:
\lambda_n = \left(\frac{n\pi}{L}\right)^2, \qquad n = 1, 2, 3, \dots,
with matching eigenfunctions X_n(x) = \sin(n\pi x / L). Every other value
of \lambda gives nothing but the trivial zero solution — the boundary
conditions act as a strict sieve, and only these countably many "modes" survive it. Multiplying each
X_n by its matching time factor
T_n(t) = e^{-\alpha\lambda_n t} gives one basic building-block solution
u_n(x, t) = \sin(n\pi x/L)\,e^{-\alpha (n\pi/L)^2 t} for every
n. The full worked solution of this exact problem, matched to a specific
starting temperature profile, is carried out in
heat equation on an interval.
- Seek u = X(x)T(t); substitute to get \frac{X''}{X} = \frac{1}{\alpha}\frac{T'}{T} = -\lambda (heat) or similar.
- The homogeneous boundary conditions make X'' = -\lambda X an eigenvalue problem with eigenvalues \lambda_n = (n\pi/L)^2 and eigenfunctions \sin(n\pi x/L).
- Superpose the product solutions and use the initial data to fix the coefficients (a Fourier series).
The payoff: infinitely many modes, one general solution
Each allowed n hands you one valid "mode" solution
u_n(x,t) — but a single mode is a very special-looking wave: it starts as
a pure sine shape and just fades in place. Almost no real initial temperature profile looks like a
single clean sine wave. The move that rescues the method is the
superposition principle:
because the heat equation is linear, any sum (even an infinite sum) of solutions is itself a
solution. So build the general solution as a whole stack of modes, each with its own weight
b_n:
u(x, t) = \sum_{n=1}^{\infty} b_n \sin\!\left(\frac{n\pi x}{L}\right) e^{-\alpha (n\pi/L)^2 t}.
At t = 0 this collapses to
u(x, 0) = \sum_n b_n \sin(n\pi x/L) — exactly a
Fourier sine
series. Choosing the b_n to match any given initial
temperature profile is precisely the Fourier-coefficient calculation, and it is no coincidence at
all: the boundary conditions selected sines as the allowed spatial shapes, and sines are exactly
the basis Fourier series are built from. Separation of variables and Fourier series are, underneath,
the same idea wearing two different hats.
The allowed shapes
On [0, \pi] the eigenfunctions are \sin(nx).
Step n: each is zero at both ends (satisfying the Dirichlet
conditions) and packs in one more half-wave. These are the only spatial shapes separation allows
— the building blocks every solution is assembled from.
Separation of variables looks so effective that it's tempting to reach for it on every PDE you
meet. It doesn't always apply, and the failures are structural, not just "hard algebra":
-
The equation must be linear. Superposing product solutions to build the general
answer only works because sums of solutions stay solutions — which is exactly the property
linear
equations have and nonlinear ones don't. Try the same trick on a nonlinear PDE and
the substitution step simply fails to cleanly separate into an
x-only side and a t-only side — cross terms
survive that can't be pushed to either side alone.
-
The domain's geometry must match the coordinate system. The trick needs boundary
conditions that each fall on a surface where one coordinate is held constant — the two ends of an
interval, the four sides of a
rectangle,
or the rim of a
disk
in polar coordinates. An irregularly-shaped domain — an L-shaped room, a dented disk, an arbitrary
blob — generally has no coordinate system in which its boundary sits at constant coordinate
values, and the clean separation collapses.
When either condition fails, the underlying idea of building a solution from special "modes" often
survives, but finding those modes requires heavier machinery than a simple product guess.
The same "guess a product, separate the variables" move, applied about two centuries after it was
first used on heat flow, is precisely how physicists crack open the
Schrödinger equation — the central equation of quantum mechanics. Guess that the
wavefunction of an electron splits into a space part and a time part, substitute, and the equation
separates into a spatial eigenvalue problem just like the one above, except now the boundary
conditions come from an atom's geometry rather than a rod's ends.
The truly startling part is what plays the role of \lambda_n: those
separation constants turn out to be the atom's allowed energy levels. Just as only whole
numbers of half sine-waves fit between a rod's fixed ends, only certain discrete energies fit the
boundary conditions of an electron bound to a nucleus — which is the deep mathematical reason atomic
energy levels are quantized (discrete) rather than a smooth continuum. One clean algebraic trick,
first tamed on a cooling rod, turns out to underlie why atoms emit light only at very specific
colours.