Separation of Variables for the Heat Equation
How does heat spread through a metal rod whose ends are held at fixed temperatures? This is the concrete question that separation of variables answers. It is the first place a student sees a partial differential equation dissolve into infinitely many ordinary ones. The idea matters because it converts an unfamiliar object into something manageable. That object is a function of two variables solving a PDE. It becomes an infinite superposition of simple, computable building blocks: exponentially decaying spatial modes. The big picture is this: the heat equation, subject to homogeneous boundary conditions, admits a natural set of "resonant shapes." These are the eigenfunctions of a boundary value problem. Any admissible initial temperature profile can be assembled out of them. This technique is the prototype for an entire method. It recurs across mathematical physics: guess a product form, plug it in, split the PDE into two ODEs coupled only by a separation constant. Then solve each ODE subject to its own side conditions, and superpose. The rod problem is deliberately simple enough to carry out every step by hand. Yet it is rich enough to expose the essential machinery — eigenvalues, eigenfunctions, orthogonality, and the completeness that lets a Fourier series match arbitrary initial data. This article works through the classical Dirichlet problem for the heat equation on a finite interval in complete detail. The PDE is stated, and the separation ansatz is justified. The resulting eigenvalue problem is solved exhaustively, ruling out non-positive eigenvalues rigorously, not by assertion. The pieces are then reassembled into a series solution. Along the way we verify convergence issues honestly rather than hand-waving them. We also flag exactly where a hypothesis — homogeneity of the boundary conditions — is essential. By the end, the reader should be able to reproduce the entire argument from scratch. This means setting up the eigenvalue ODE, solving it, and forming the Fourier sine series of the initial data. Then the reader should assemble the solution. At the same time, the reader should understand precisely why each step is forced. They should also see where the method would break if a hypothesis were dropped.
- Separation of variables seeks solutions of the form for the heat equation .
- Substituting the product form splits the PDE into two ODEs linked by one constant : one in , one in .
- Homogeneous boundary conditions turn the -equation into a Sturm–Liouville eigenvalue problem with a discrete spectrum.
- Only positive eigenvalues give nontrivial solutions on with Dirichlet conditions.
- Superposing all product solutions and matching data reduces the problem to computing a Fourier sine series.
- Key idea: homogeneous boundary conditions convert a PDE into an eigenvalue problem whose eigenfunctions are the only shapes that decay purely exponentially in time, and the initial data is expanded in exactly these shapes.
Where this lives today
Separation of variables for the heat equation is the entry point into an enormous range of applications. In engineering, it models transient conduction in rods, slabs, and simple 2-D/3-D geometries (with separable domains), giving explicit design formulas for quenching, annealing, and thermal insulation problems. In probability and statistics, the same eigenfunction expansion underlies the transition density of Brownian motion killed at the boundary of an interval, connecting heat conduction to first-passage-time problems and to the spectral theory of Markov diffusions. In quantum mechanics, an almost identical calculation — separating the time-dependent Schrödinger equation into a spatial eigenvalue problem (an infinite square well, formally the same Dirichlet eigenproblem here) and an oscillatory time factor — reproduces the same eigenfunctions with replacing the decaying exponential. In numerical analysis and scientific computing, spectral and pseudo-spectral methods generalize this idea to more complex domains and operators, while finite-difference and finite-element solvers are validated against these closed-form series solutions. In signal processing and image compression, the discrete cousin of this eigenbasis (the discrete sine/cosine transform) is used precisely because it diagonalizes the same kind of second-difference operator that appears here, making it efficient for representing smooth, boundary-constrained signals.
:::quiz[In the Dirichlet problem on , what happens if we allow in the eigenvalue problem?]
- It gives the eigenfunction
- Only the trivial solution satisfies both and ✓
- It gives infinitely many eigenfunctions
- It gives the eigenfunction
Ask the tutor: How does this same method change if the boundary conditions are Neumann or mixed (Robin) instead of Dirichlet?
Consider the initial-boundary value problem for the temperature in a rod of length with thermal diffusivity :
subject to homogeneous Dirichlet boundary conditions
and initial condition
where is a given piecewise continuous function on .
Separation of variables is the ansatz that a nontrivial solution can be sought in product form
with and . Substituting into the PDE and dividing by (valid wherever it is nonzero) yields
Since the left side depends only on and the right side only on , and they are equal on the domain, both sides must equal a common constant, called the separation constant, written . This produces the decoupled pair
The boundary conditions and must hold for all ; since we seek , this forces the boundary eigenvalue problem
The method then consists of: (i) finding all for which this eigenvalue problem has a nontrivial solution (the eigenvalues and eigenfunctions ); (ii) solving the corresponding ; (iii) superposing ; and (iv) choosing the coefficients so that , using orthogonality of the eigenfunctions.
Intuition
Picture the rod as a one-dimensional strip held at zero temperature at both ends, with some initial heat distribution in between. Ordinary intuition says the heat should diffuse until everything reaches the boundary temperature, zero, and indeed that is what the theorem below proves. But how it decays is the interesting content: the temperature profile does not shrink uniformly — it decays as a sum of standing spatial waves , each shrinking at its own exponential rate . High-frequency wiggles (large ) die out fastest, because the factor in the exponent grows like . This is why an initially jagged temperature profile smooths out almost immediately, while the coarse, overall shape (dominated by ) persists longest. The eigenfunctions are exactly the shapes for which a solution can be pure exponential decay in time with no change of spatial shape — plug back in and you see the profile just rescales uniformly, never redistributing between different sine shapes. Because these sine functions form a complete orthogonal system on (a fact from Fourier analysis foreshadowed here and made rigorous under Sturm-Liouville Theory), any reasonable initial data can be written as an infinite combination of them, and then each piece evolves independently and exponentially. Separation of variables is therefore really a change of basis: rewrite in the eigenbasis where the dynamics become diagonal (uncoupled, exponential decay mode by mode).
:::svg[The first three Dirichlet eigenfunctions on , : , , ]
Let and . Let be piecewise continuous. Consider
Step 1 (eigenvalue problem). The boundary value problem
has a nontrivial solution if and only if
in which case every nontrivial solution is a scalar multiple of
Step 2 (time factor). For each such , the ODE has general solution
Step 3 (superposition and matching data). The formal series
satisfies the PDE and both boundary conditions termwise for every choice of constants . It satisfies the initial condition if the are the Fourier sine coefficients of ,
With this choice, for the series converges absolutely and uniformly on for every , and defines a function solving the PDE classically; moreover as at every point of continuity of .
We prove each step in turn. The technique throughout is direct construction and verification, together with a uniqueness/rule-out argument for the eigenvalues (a standard energy-type argument for the sign of , and direct ODE solving otherwise).
Step 1: solving the eigenvalue problem. We must find all (a priori could be any real or even complex number, but we show it must be real and positive) for which , has a nontrivial solution. Case . Write with . The general solution of is
The condition gives . The condition then gives . Since and , , so . Hence : no nontrivial solution for . Case . The general solution of is . Then and forces (as ). Again only the trivial solution. Case . Write , . The general solution of is
. So , and . For a nontrivial solution we need , hence , i.e. for some positive integer (negative or zero give no new solutions, since is odd and , already forces ). Thus and
Since the equation is linear and homogeneous, every solution for is a scalar multiple of . This proves Step 1 completely: we have exhibited every eigenvalue and shown no others exist, by exhausting all three sign cases for (a case analysis argument, using in the negative and positive cases that vanishes only at and only at integer multiples of , elementary facts about these functions). An alternative, coordinate-free reason the eigenvalues must be positive, worth recording since it generalizes far beyond this example: if with and , multiply by and integrate by parts:
using to kill the boundary term. The eigenvalue equation gives , so
Since is continuous, ; the right side is . Hence . If then so is constant, and forces , a contradiction; hence strictly. This is the same conclusion as the direct case analysis, obtained instead by an energy (Rayleigh quotient) argument, and it is the technique that generalizes to Sturm-Liouville Theory.
Step 2: the time equation. For fixed , the ODE is first-order linear with constant coefficient; its general solution, obtained by separating variables in (an ODE technique, unrelated to the PDE separation ansatz) and integrating , is
for an arbitrary constant . Direct differentiation confirms , verifying this is indeed a solution, and uniqueness of solutions to linear first-order ODEs (Picard–Lindelöf, or direct integrating-factor argument) shows these are all solutions. Each product therefore solves the PDE (by construction, since the separation step is reversible: if solve their respective ODEs then ), and it satisfies for all since .
Step 3: superposition and the initial condition. By linearity of the PDE and of the boundary conditions (both are homogeneous linear conditions in ), any finite linear combination again solves the PDE and boundary conditions. We extend this to the infinite series
and must justify termwise differentiation and convergence, since infinite superposition is not automatically valid. Boundedness of coefficients. Since is piecewise continuous on the compact interval , it is bounded, say . The Fourier sine coefficients satisfy the elementary bound
so is a bounded sequence, say for all . Uniform convergence for . Fix . For and any ,
Since grows like , the comparison series converges (ratio test: the ratio of consecutive terms ). By the Weierstrass M-test, the series for converges absolutely and uniformly on for every . The same argument, after differentiating termwise any fixed number of times in or (each differentiation multiplies the -th term by a factor polynomial in , which is dominated by the same super-exponentially decaying exponential for ), shows all termwise-differentiated series converge uniformly on as well. A standard theorem of analysis (uniform convergence of a sequence of differentiable functions together with uniform convergence of their derivatives implies the limit is differentiable with that derivative, applied repeatedly) then justifies termwise differentiation, so on and solves the PDE classically there, being a locally uniform limit of functions each solving it, with all derivatives converging locally uniformly. Boundary conditions. Each term vanishes at and , and the (locally uniform) limit of functions vanishing there also vanishes there; hence for . Initial condition. Choosing
makes the Fourier sine series of on . The classical pointwise convergence theorem for Fourier series (a result belonging to the theory foreshadowed by Fourier Series Solutions of Boundary Value Problems, proved independently of the present theorem and not relying on it) states: if is piecewise continuous and piecewise smooth on , its Fourier sine series converges at each to , which equals at points of continuity. We invoke this as an external, previously established fact rather than re-deriving it, to conclude
at every point of continuity of in . (The passage of the limit inside the sum at a fixed follows because, for fixed, increasingly as for each fixed , and dominated-convergence-type estimates using together with Abel summation control the tail uniformly in ; this is the standard Abel-limit argument for power-series-like sums and we omit the routine -tail bookkeeping.) This completes the proof: Step 1 found all admissible eigenpairs, Step 2 solved the associated time ODE, and Step 3 assembled and rigorously justified the superposition, matching the prescribed initial data via Fourier sine coefficients.
∎Worked examples
Example 1 — an asymmetric sawtooth-type initial profile. Solve
i.e. , , and a genuinely asymmetric cubic profile (not symmetric about the midpoint, unlike a "tent" function). By the theorem, with ,
We compute by expanding and integrating termwise using
via repeated integration by parts. Let . Standard antiderivative bookkeeping (integrate by parts twice for , three times for ) gives, after evaluating at and using , :
With : , , so
Now So
One further integration by parts gives So
Now assemble :
Collect the terms: Collect the terms: So with , i.e. , giving
So for even, and for odd. As a check, , and ; both positive, consistent with on . Therefore
The dominant long-time behavior ( large) is governed by :
so the profile becomes a pure half-sine hump decaying at rate regardless of the asymmetry present in — a good illustration that fine initial detail (odd/even coefficient differences) washes out exponentially fast.
Example 2 — nonzero but constant boundary data, reduced to the homogeneous case. Solve
Here , , but the boundary data is inhomogeneous, so the theorem does not apply directly to . The standard device is to subtract off the (unique) steady-state solution satisfying , , : this gives , a straight line interpolating the two boundary values. Let . Since and ,
so solves the same heat equation. Its boundary values are and : homogeneous Dirichlet conditions, exactly the hypotheses of the theorem. Its initial data is
Now apply the theorem with : eigenfunctions , eigenvalues , and
By orthogonality of on (i.e. ), the two explicit sine terms contribute directly: the term contributes and for ; the term contributes and otherwise. It remains to expand the linear term in a sine series on :
A standard computation (integrate by parts once) gives (using ), so this term contributes
Combining,
Explicitly: ; ; ; and in general for . Finally,
with as above. As , every term in the sum decays to , so : the rod approaches the steady linear temperature profile fixed by the boundary values, exactly as physical intuition demands.
The theorem requires — homogeneous boundary data — because that is exactly what forces in the separation step. Suppose instead we try to separate variables directly on
without first subtracting a steady state. Attempting gives, as before,
but now the boundary conditions read and for all . The second equation still forces (assuming ), but the first forces for every — impossible unless is constant, which contradicts solving a nontrivial decaying ODE (a nonconstant exponential is not compatible with being the constant for all , unless and , collapse to trivial cases that cannot also satisfy with simultaneously for a nontrivial linear ). Concretely, if , , , so ; requiring for all with constant (since ) does give a single product solution matching the boundary data only if , but a constant-in-time cannot also be used to build a superposition that further matches an arbitrary initial profile via the usual sine series, since none of the homogeneous eigenfunctions satisfy . The method breaks down precisely because the product ansatz assumes the entire boundary condition is a statement purely about (with arbitrary), which is only possible when the boundary values are . The fix — illustrated in Example 2 — is to first subtract a steady-state (or otherwise a particular) solution matching the inhomogeneous boundary values, reducing to a genuinely homogeneous problem before separating. This shows homogeneity of the boundary conditions is not a cosmetic simplification but a load-bearing hypothesis of the theorem.
Scope, edge cases & common traps
| Situation | What happens | Fix / remark |
|---|---|---|
| Homogeneous Dirichlet, as stated | Theorem applies directly | Eigenfunctions |
| Homogeneous Neumann () | Same method, different eigenvalue problem | Eigenfunctions , , including constant mode |
| Inhomogeneous (nonzero) boundary data | Cannot separate directly | Subtract steady-state / particular solution first (Example 2) |
| merely piecewise continuous, not continuous | Series still converges pointwise a.e. | At jump points, converges to the average of one-sided limits, not itself |
| exactly, at a jump of | Series may not equal there | Convergence is to , a classical Fourier-series subtlety |
| Negative diffusivity (nonphysical) | Time factor grows instead of decaying | Problem is ill-posed; theorem assumes |
The mathematician behind it
Origins · 1 minJean-Baptiste Joseph Fourier and how this was discovered
Fourier introduced the heat equation and the method of trigonometric series expansion in his 1807 memoir on heat propagation, later expanded into the Théorie analytique de la chaleur (1822). His central claim — that an "arbitrary" function could be represented by an infinite sum of sines and cosines — was controversial among contemporaries such as Lagrange and Laplace, who doubted its generality, but the idea became the seed of modern Fourier analysis, spectral theory, and the entire separation-of-variables toolkit used across mathematical physics.
Why does the separation ansatz not lose any solutions?
Strictly, the ansatz by itself only searches for product-form solutions, so a priori it could miss non-product solutions. The resolution is that the heat equation, together with homogeneous linear boundary conditions, is linear, so any finite or (suitably convergent) infinite sum of product solutions is again a solution. The completeness of the sine eigenfunctions (a Fourier-analysis fact, not part of the separation argument itself) guarantees that every admissible initial condition can be matched by such a superposition. Combined with a uniqueness theorem for the heat equation (typically proved via an energy/maximum-principle argument, independent of separation of variables), this shows the series we construct is the solution, not merely a solution built from a possibly incomplete family.
What if the rod has insulated (Neumann) ends instead of fixed-temperature ends?
The same separation ansatz applies, but the boundary conditions become , translating to . Repeating the sign analysis on shows is now allowed (with eigenfunction , constant), alongside with eigenfunctions for . The mode does not decay in time (its time factor is constant), reflecting physically that with insulated ends the rod's average temperature is conserved and the solution converges to that average as rather than to zero.
Does separation of variables work if the diffusivity depends on ?
Not in the simple form presented here. If , the PDE becomes or similar, and substituting still separates the time dependence, but the resulting spatial ODE is a more general Sturm–Liouville problem with variable coefficients, e.g. . The eigenvalue theory still applies in much the same qualitative way (positive, ordered eigenvalues and orthogonal eigenfunctions), but the eigenfunctions are generally no longer simple sines; that is precisely the generalization studied under Sturm-Liouville Theory.
Is the series solution exact, or only an approximation?
It is an exact solution, not merely an approximation, provided the coefficients are the true Fourier sine coefficients of and the series is understood as an infinite sum (evaluated in the limit). For the series converges absolutely and uniformly, so partial sums are approximations that converge to the exact solution as more terms are added; truncating the series after finitely many terms, as is done in practice, introduces an approximation error that itself decays exponentially in the truncation index for any fixed , because of the same exponential time factors used in the proof.
How does this connect to the Fourier series topic that follows?
The coefficient formula is nothing but the definition of the Fourier sine coefficients of on . Separation of variables reduces the PDE problem entirely to the question of expanding in this orthogonal system and justifying convergence, which is exactly the content developed rigorously under Fourier Series Solutions of Boundary Value Problems. This article intentionally treats that convergence theorem as an imported, previously-established fact rather than re-deriving it, so as to keep the PDE argument self-contained.
What goes wrong numerically if you truncate the series at small ?
For close to , the exponential decay factors are close to even for large , so the series converges much more slowly and many terms are needed to approximate accurately, especially near jump discontinuities of (where Gibbs-phenomenon-like oscillations appear in partial sums). This is consistent with the proof: the Weierstrass M-test bound used to establish uniform convergence depends on , and the bound deteriorates as , which is exactly why the initial condition is recovered only in a limiting sense rather than via uniform convergence down to .