This page is a shooting gallery. We list every kind of situation the linear-homogeneous heat problem can throw at you, then knock down each one with a full worked example. Keep the parent recipe handy: Solving heat equation — separation of variables .
Definition Symbols used on this page (define before use)
u ( x , t ) = temperature at position x (metres from the left end), time t (seconds).
L = rod length. x runs over 0 < x < L .
f ( x ) = u ( x , 0 ) = the initial temperature profile .
α 2 = thermal diffusivity , the single physical constant in u t = α 2 u xx . Units: length 2 / time (e.g. m 2 / s ). It sets how fast heat spreads: big α 2 ⇒ fast smoothing. We keep it as a literal symbol throughout and only plug a number in Ex 3 (α 2 = 1 ) and Ex 8.
B n = the amount of sine-hump number n present in f (a Fourier sine coefficient).
n = 1 , 2 , 3 , … = the mode number (how many half-waves fit on the rod).
Intuition Read this first
For Dirichlet ends (u = 0 at both ends) every solution has the same skeleton:
u ( x , t ) = ∑ n = 1 ∞ B n sin L nπ x e − α 2 ( nπ / L ) 2 t .
Solving a problem = finding the numbers B n from the initial shape f ( x ) , using
B n = L 2 ∫ 0 L f ( x ) sin L nπ x d x .
The exponential part is automatic once you know n . So 90% of the work is one integral. Below we see every flavour that integral comes in — plus the other boundary-condition families.
Recall A word about "every scenario" (scope, honestly stated)
This page exhausts the linear homogeneous rod: all homogeneous boundary types — Dirichlet (u = 0 ), Neumann (u x = 0 ), and a note on mixed / Robin ends — plus every input shape (single/multiple/constant/piecewise/zero) and both time limits. What we do not treat here (they need extra machinery and live on other pages): non-homogeneous BCs (ends held at nonzero or time-dependent temperatures — handled by subtracting a steady state), source terms u t = α 2 u xx + Q , and full Robin eigenvalue transcendental equations. So "every scenario" means every scenario of the homogeneous separable problem , which is what this chapter builds. The eigenfunction/eigenvalue machinery behind all BC types is Sturm-Liouville Theory .
Every worked example below is tagged with the cell it covers.
Cell
What makes it special
Example
A. Single mode
f ( x ) is already one sine — read off, no integral
Ex 1
B. Sum of modes
f ( x ) is a few sines added — read off several
Ex 2
C. Constant profile
f ( x ) = const — must integrate, only odd n survive
Ex 3
D. Triangle / tent
piecewise-linear peak — integration by parts
Ex 4
E. Degenerate input
f ( x ) ≡ 0 — the trivial (dead) rod, uniqueness
Ex 5
F. Limiting behaviour
t → ∞ and t → 0 + — convergence subtleties
Ex 6
G. Neumann + mixed twist
insulated u x = 0 (cosines) and one mixed end
Ex 7
H. Word problem
real rod, real numbers, "how long to cool?"
Ex 8
Cases A–H hit: single/multiple/constant/piecewise inputs, the zero-degenerate input, both time limits (with convergence discussed), the Neumann and mixed boundary families, and a physical estimate.
Solve the rod problem on 0 < x < L with u ( 0 , t ) = u ( L , t ) = 0 and initial shape
f ( x ) = 5 sin L 2 π x .
Forecast: Before reading on — do you think you need to compute an integral here? Guess which B n are nonzero.
Step 1 — Match to the template.
The general series at t = 0 is f ( x ) = ∑ n B n sin L nπ x .
Why this step? Because the sin L nπ x are orthogonal (each independent), a sine on the left can only match the same sine on the right. If f is already one of them, no integral is needed — we just read coefficients.
Step 2 — Read off.
Comparing 5 sin L 2 π x with the n = 2 term: B 2 = 5 , and every other B n = 0 .
Step 3 — Attach the decay.
Mode n = 2 decays like e − α 2 ( 2 π / L ) 2 t = e − 4 α 2 π 2 t / L 2 .
Why the 4? The decay rate is ∝ n 2 = 2 2 = 4 .
u ( x , t ) = 5 sin L 2 π x e − 4 α 2 π 2 t / L 2 .
Verify: At t = 0 , e 0 = 1 , so u ( x , 0 ) = 5 sin L 2 π x = f ( x ) . ✓ Ends: sin 0 = 0 and sin 2 π = 0 , so u ( 0 , t ) = u ( L , t ) = 0 . ✓
Same rod, initial shape a combination :
f ( x ) = 3 sin L π x − 2 sin L 4 π x .
Forecast: How many terms will the final sum have? Which fades faster, the 3 -term or the 2 -term?
Step 1 — Read off each piece.
Why this step? Same orthogonality reasoning as Ex 1 — a linear combination of sines maps term-by-term. B 1 = 3 , B 4 = − 2 , all others 0 .
Step 2 — Give each its own timer.
n = 1 decays at rate α 2 ( π / L ) 2 ; n = 4 decays at rate 16 α 2 ( π / L ) 2 (since 4 2 = 16 ).
u ( x , t ) = 3 sin L π x e − α 2 π 2 t / L 2 − 2 sin L 4 π x e − 16 α 2 π 2 t / L 2 .
Step 3 — Observe the split fates.
The n = 4 hump decays 16/1 = 16 times faster than the n = 1 hump. By the Superposition Principle we simply add the independently-fading pieces.
Verify: t = 0 gives back 3 sin L π x − 2 sin L 4 π x . ✓ The ratio of decay rates is 16 . ✓
L = π , α 2 = 1 m 2 / s , and the whole rod starts at u ( x , 0 ) = 100 °, ends dunked to 0 °.
Forecast: A flat line is nothing like a sine — do you expect all B n , only odd, or only even?
Step 1 — Set up the projection integral.
Why this step? A constant is not a single eigenfunction, so we must "project" it onto each sine using the coefficient formula.
B n = π 2 ∫ 0 π 100 sin ( n x ) d x .
Step 2 — Do the integral.
∫ 0 π sin ( n x ) d x = [ − n c o s n x ] 0 π = n 1 − c o s nπ = n 1 − ( − 1 ) n .
Why ( − 1 ) n ? Because cos nπ alternates: − 1 , + 1 , − 1 , … So the bracket is 0 for even n and 2 for odd n .
Step 3 — Simplify.
B n = π 200 ⋅ n 1 − ( − 1 ) n = ⎩ ⎨ ⎧ π n 400 0 n odd n even .
Why only odd survive? A flat, left–right symmetric hump has the symmetry of odd sines; even sines are antisymmetric about the midpoint and cancel.
Step 4 — Assemble.
u ( x , t ) = π 400 n odd ∑ n 1 sin ( n x ) e − n 2 t .
Verify: At t = 0 , x = π /2 : the terms are π 400 ⋅ n s i n ( nπ /2 ) . Now sin ( nπ /2 ) = + 1 , − 1 , + 1 , … for n = 1 , 3 , 5 , … , i.e. ( − 1 ) ( n − 1 ) /2 , so the sum is π 400 ( 1 − 3 1 + 5 1 − ⋯ ) . That alternating sum is the Leibniz / Gregory series for arctan 1 = π /4 (a standard Fourier/Taylor result: put x = 1 in arctan x = x − 3 x 3 + 5 x 5 − ⋯ ). Hence the total is π 400 ⋅ 4 π = 100. ✓ This is the Fourier series of the constant 100 evaluated at the midpoint — where it converges to the function value.
L = 1 . The rod starts as a symmetric tent peaking at the middle:
f ( x ) = { x 1 − x 0 ≤ x ≤ 2 1 2 1 ≤ x ≤ 1.
Find B n (with L = 1 , so sin nπ x ).
Figure s01 (alt-text/caption): the orange curve is the tent f ; the plum dashed vertical line at x = 2 1 is the axis of symmetry; the teal segment along the bottom marks the two ends pinned at 0 . The picture's message: f is symmetric about x = 2 1 , so only symmetric (odd-n ) sine humps can build it — even humps, which are antisymmetric about the midpoint, must have zero weight.
Forecast: Look at the plum dashed line. Will even modes appear?
Step 1 — Split the coefficient integral at the peak.
Why this step? f is defined by two different formulas either side of x = 2 1 , so the single integral becomes two.
B n = 2 ∫ 0 1 f ( x ) sin ( nπ x ) d x = 2 [ I 1 ∫ 0 1/2 x sin ( nπ x ) d x + I 2 ∫ 1/2 1 ( 1 − x ) sin ( nπ x ) d x ] .
(Here L 2 = 2 since L = 1 .)
Step 2 — Do the integration by parts explicitly on I 1 .
Why integration by parts? The integrand is (polynomial)× (sine); parts lowers the polynomial degree until only sines/cosines remain.
Let u = x , d v = sin ( nπ x ) d x , so d u = d x , v = − nπ cos ( nπ x ) . Then
I 1 = [ − nπ x c o s ( nπ x ) ] 0 1/2 + nπ 1 ∫ 0 1/2 cos ( nπ x ) d x .
The remaining integral is nπ 1 [ nπ sin ( nπ x ) ] 0 1/2 = ( nπ ) 2 sin ( nπ /2 ) . Evaluating the bracket at x = 2 1 (lower limit x = 0 gives 0 ):
I 1 = − nπ 2 1 c o s ( nπ /2 ) + ( nπ ) 2 s i n ( nπ /2 ) .
Step 3 — Do I 2 and watch the boundary terms cancel.
Write I 2 = ∫ 1/2 1 sin ( nπ x ) d x − ∫ 1/2 1 x sin ( nπ x ) d x . The first piece is [ − nπ c o s ( nπ x ) ] 1/2 1 = nπ cos ( nπ /2 ) − cos ( nπ ) . The second, by the same parts as Step 2,
∫ 1/2 1 x sin ( nπ x ) d x = [ − nπ x c o s ( nπ x ) ] 1/2 1 + ( nπ ) 2 s i n ( nπ x ) 1/2 1 = − nπ c o s ( nπ ) + nπ 2 1 c o s ( nπ /2 ) − ( nπ ) 2 s i n ( nπ /2 ) .
Now add I 1 + I 2 . Collect the nπ 2 1 cos ( nπ /2 ) terms: I 1 contributes − nπ 2 1 cos ( nπ /2 ) ; from I 2 the cos ( nπ /2 ) / nπ from the first piece and the − 2 1 cos ( nπ /2 ) / nπ from the subtracted second piece combine to + nπ 2 1 cos ( nπ /2 ) . These two cancel exactly — that is the "boundary terms at x = 2 1 cancel by symmetry." The cos ( nπ ) / nπ terms also cancel. What survives is only the sine terms:
I 1 + I 2 = ( nπ ) 2 s i n ( nπ /2 ) + ( nπ ) 2 s i n ( nπ /2 ) = ( nπ ) 2 2 s i n ( nπ /2 ) .
Therefore
B n = 2 ( I 1 + I 2 ) = ( nπ ) 2 4 sin 2 nπ .
Why sin 2 nπ ? It equals 0 for even n and ± 1 for odd n — the tent, being symmetric, keeps only odd modes, exactly as the figure predicted.
Step 4 — Assemble.
u ( x , t ) = ∑ n odd ( nπ ) 2 4 sin 2 nπ sin ( nπ x ) e − α 2 n 2 π 2 t .
Verify: First mode B 1 = π 2 4 sin 2 π = π 2 4 ≈ 0.4053 . Check the series recovers the peak: at x = 2 1 , f = 2 1 , and ∑ n odd ( nπ ) 2 4 sin 2 2 nπ = π 2 4 ∑ n odd n 2 1 = π 2 4 ⋅ 8 π 2 = 2 1 . ✓ (The identity ∑ n odd n 2 1 = 8 π 2 is a standard Fourier/Basel result.)
f ( x ) ≡ 0 : rod starts everywhere at 0 °, ends held at 0 °.
Forecast: Guess the temperature at t = 5 seconds, or any time at all.
Step 1 — Compute all coefficients.
B n = L 2 ∫ 0 L 0 ⋅ sin L nπ x d x = 0 for every n .
Why bother? To show the machinery is consistent even in the boring case — no hidden nonzero mode sneaks in.
Step 2 — Assemble.
u ( x , t ) = 0 for all x , t .
This is the trivial solution .
Step 3 — Why it is the only solution (uniqueness, stated properly).
Why can't some other solution exist? Two independent guarantees:
(i) Maximum principle. For the heat equation with no source, the maximum and minimum of u over [ 0 , L ] × [ 0 , T ] must occur on the "parabolic boundary" — either at t = 0 or at the two ends. Here u = 0 on all of those, so 0 ≤ u ≤ 0 everywhere: u ≡ 0 . Applied to the difference of any two solutions with identical data, it forces them equal — hence uniqueness for the whole Dirichlet problem, not just this case.
(ii) Sturm–Liouville / energy view. The eigenfunctions sin L nπ x form a complete orthogonal basis (Sturm-Liouville Theory ); a function whose every coefficient is 0 is the zero function. See also the general uniqueness under Boundary Conditions — Dirichlet vs Neumann .
Verify: u t = 0 , u xx = 0 , so u t = α 2 u xx holds (0 = 0 ). BCs and IC all satisfied. ✓
Take the tent solution from Ex 4 (L = 1 , α 2 = 1 ). Describe the profile (a) for very large t , and (b) as t → 0 + — and say honestly how the series converges in each case.
Figure s02 (alt-text/caption): orange = the sharp tent recovered as t → 0 + ; plum dash-dot = an intermediate time where the corner has already rounded; teal = the lone surviving half-sine bump at large t . Message: high modes carry the sharp corner and die first, so the profile smooths from the top down before collapsing to a single hump.
Forecast: Which single shape does every Dirichlet rod collapse to before dying?
Step 1 — Large-t limit (and why the limit is legal).
Mode n carries e − n 2 π 2 t . The ratio of the n = 3 term to the n = 1 term is e − ( 9 − 1 ) π 2 t = e − 8 π 2 t → 0 .
Convergence note: for any fixed t 0 > 0 the coefficients times e − n 2 π 2 t decay faster than any power of n , so the series and all its x - and t -derivatives converge uniformly on [ 0 , 1 ] × [ t 0 , ∞ ) (Weierstrass M -test with M n = ∣ B n ∣ e − n 2 π 2 t 0 ). Uniform convergence is exactly what licenses term-by-term limiting and differentiation — so keeping only n = 1 is rigorous:
u ( x , t ) ≈ B 1 sin ( π x ) e − π 2 t = π 2 4 sin ( π x ) e − π 2 t .
Universal shape: a single half-sine bump (teal curve), whatever the start looked like.
Step 2 — Small-t limit (the delicate end).
As t → 0 + every e − n 2 π 2 t → 1 , so formally u ( x , 0 + ) = ∑ B n sin ( nπ x ) = f ( x ) .
Convergence note: at t = 0 the smoothing exponentials are gone. Here B n ∼ 1/ n 2 , which is absolutely summable, so the tent's series still converges uniformly to the continuous tent (the tent has no jumps). Contrast the constant-100 profile of Ex 3: there B n ∼ 1/ n , the series converges only pointwise (not uniformly) inside ( 0 , π ) and at the ends the sum is 0 = 100 — the endpoints and any jump converge to the midpoint value (Gibbs behaviour). So "u ( x , 0 ) = f ( x ) " holds in the interior but must be read carefully at discontinuities and boundaries.
Step 3 — The smoothing story.
For any t > 0 the solution is infinitely smooth (the exponentials kill all roughness): high-n wiggles die first, so the tent's corner rounds off instantly, then the whole bump fades. This instant smoothing is why heat flow erases sharp features.
Verify: Amplitude ratio n = 3 vs n = 1 at t = 0.1 is B 1 B 3 e − 8 π 2 ( 0.1 ) = − 9 1 e − 0.8 π 2 ≈ − 4.15 × 1 0 − 5 , negligible — the single-mode approximation is excellent. ✓
(a) Neumann: same rod, but ends insulated : u x ( 0 , t ) = u x ( L , t ) = 0 , initial f ( x ) . Find the building blocks.
(b) Mixed: ends u ( 0 , t ) = 0 (fixed) and u x ( L , t ) = 0 (insulated). What eigenfunctions now?
Forecast: With sines forbidden in (a), what functions have zero slope at both ends? In (b), which quarter-waves fit?
Step 1 — Redo the space ODE with Neumann BCs.
Why redo it? Eigenfunctions are chosen to satisfy the BCs; different BCs ⇒ different eigenfunctions. See Boundary Conditions — Dirichlet vs Neumann .
X ′′ + λ X = 0 , X ′ ( 0 ) = 0 , X ′ ( L ) = 0.
For λ = k 2 > 0 : X = A cos k x + B sin k x , X ′ = − A k sin k x + B k cos k x .
X ′ ( 0 ) = B k = 0 ⇒ B = 0 ; X ′ ( L ) = − A k sin k L = 0 ⇒ sin k L = 0 ⇒ k L = nπ .
Why cosines now? Zero-slope ends want a curve flat at both ends — cos L nπ x has horizontal tangents there. Also λ = 0 now works (X 0 = 1 , slope zero everywhere) — a mode Dirichlet rejected!
X n ( x ) = cos L nπ x , n = 0 , 1 , 2 , …
Step 2 — Assemble the Neumann solution.
u ( x , t ) = 2 A 0 + n = 1 ∑ ∞ A n cos L nπ x e − α 2 ( nπ / L ) 2 t , A n = L 2 ∫ 0 L f ( x ) cos L nπ x d x .
This is a Fourier cosine series (Fourier Series ). The n = 0 term 2 A 0 = L 1 ∫ 0 L f d x has decay rate 0 — it never fades .
Why one mode survives forever? Insulated ends let no heat escape, so total heat is conserved; the rod settles to its average temperature, not to zero. Contrast Ex 6, where Dirichlet ends drained all heat to 0 .
Step 3 — The mixed case (one fixed, one insulated).
X ( 0 ) = 0 ⇒ A = 0 , so X = B sin k x ; then X ′ ( L ) = B k cos k L = 0 ⇒ cos k L = 0 ⇒ k L = ( n − 2 1 ) π .
X n ( x ) = sin 2 L ( 2 n − 1 ) π x , n = 1 , 2 , …
Why "quarter-waves"? sin starts at 0 (fixed end) and must reach a flat top (zero slope) at x = L — that is a quarter, three-quarters, … of a full sine wave. Eigenvalues λ n = ( 2 L ( 2 n − 1 ) π ) 2 . This still fits the Sturm-Liouville Theory framework; only the boundary equation changed.
Verify: Neumann with constant f = 100 , L = π : 2 A 0 = π 1 ∫ 0 π 100 d x = 100 , and A n = π 2 ∫ 0 π 100 cos ( n x ) d x = 0 for n ≥ 1 . Steady state = 100 (the start average). ✓ Mixed check: smallest eigenvalue k 1 = 2 L π gives cos ( k 1 L ) = cos 2 π = 0 . ✓
A metal rod L = π metres, thermal diffusivity α 2 = 1 m 2 / s , starts at the single mode u ( x , 0 ) = 80 sin x °C, ends held at 0 °C. How long until the midpoint temperature drops to 10 °C?
Forecast: Estimate — a few tenths of a second, or several seconds?
Step 1 — Write the solution.
Why this step? f = 80 sin x is a pure n = 1 mode (L = π ⇒ sin π nπ x = sin n x ), so B 1 = 80 , decay rate α 2 ( 1 ) 2 = 1 .
u ( x , t ) = 80 sin x e − t .
Step 2 — Evaluate at the midpoint x = π /2 .
sin 2 π = 1 , so u ( π /2 , t ) = 80 e − t .
Why the midpoint? sin x peaks there, so it's the hottest, longest-lasting point — the "worst case" for cooling.
Step 3 — Solve for the time.
Set 80 e − t = 10 ⇒ e − t = 8 1 ⇒ t = ln 8 ≈ 2.079 s .
Why ln ? Exponential decay is undone by the logarithm — the natural tool for "how long until it reaches value V ."
t = ln 8 ≈ 2.08 seconds .
Verify (units + value): rate α 2 ( nπ / L ) 2 = 1 ⋅ ( 1/1 ) 2 = 1 s − 1 , so exponent − t is dimensionless. ✓ Plug back: 80 e − l n 8 = 80/8 = 10 °C. ✓
Recall Quick self-test on the matrix
A single-sine f needs an integral for B n ? ::: No — read it off (Cell A).
Constant f keeps which modes? ::: Only odd n (Cell C).
As t → ∞ a Dirichlet rod approaches what shape? ::: A half-sine bump, then 0 (Cell F).
Why is keeping only n = 1 at large t rigorous? ::: For fixed t 0 > 0 the series converges uniformly (Weierstrass M -test), licensing term-by-term limits.
Insulated (Neumann) ends give which eigenfunctions? ::: Cosines, incl. a constant n = 0 mode that never fades — rod settles to its average (Cell G).
One fixed + one insulated end gives? ::: Quarter-wave sines sin 2 L ( 2 n − 1 ) π x .
The zero initial rod evolves to? ::: Stays 0 forever — trivial and unique by the maximum principle (Cell E).
Mnemonic Which tool for which input?
"Sine reads, Constant projects, Corner parts, Insulate cosines."
Single sine → read off · constant → project by integral · piecewise corner → integrate by parts · insulated ends → cosine series.
Related: Fourier Series · Sturm-Liouville Theory · Wave Equation · Laplace Equation · Superposition Principle · Boundary Conditions — Dirichlet vs Neumann