Heat Flow in a Rod and Fourier Series

krunyx · HyperTeX examples

November 2026

Keywords
  • heat equation
  • diffusion
  • Fourier series
  • separation of variables

Abstract

A metal rod is hot in the middle and cold at both ends. The heat equation says how the temperature evens out, and Fourier's idea of writing any profile as a sum of sine waves solves it: each wave fades on its own, the short ones fastest. Slide time forward to watch the profile relax, or change the number of terms to see how a sum of smooth waves builds a sharp edge.

1 The heat equation

Let u(x,t)u(x, t) be the temperature of a thin rod of length LL whose ends are held at zero. Heat flows from hot to cold at a rate proportional to the temperature gradient (Fourier's law), and energy is conserved, which together give

where α\alpha is the thermal diffusivity of the material [1]. Figure 1 shows the answer before we derive it: a hot block in the middle spreads into a smooth hump that sinks towards zero.

Figure 1: Temperature along the rod as time passes (animation, six seconds per loop). The dashed curve is the starting profile.

2 Separation of variables

  1. Look for solutions of the form u=X(x)T(t)u = X(x)\,T(t). Then (1) becomes T′αT=X″X\dfrac{T'}{\alpha T} = \dfrac{X''}{X}, and both sides must equal one constant, −k2-k^2.

  2. X″=−k2XX'' = -k^2 X with X(0)=X(L)=0X(0) = X(L) = 0 allows only k=nπ/Lk = n\pi/L, n=1,2,…n = 1, 2, \ldots, so Xn=sin⁡(nπx/L)X_n = \sin(n\pi x/L).

  3. T′=−αk2TT' = -\alpha k^2 T gives Tn=e−α(nπ/L)2tT_n = e^{-\alpha (n\pi/L)^2 t}.

  4. Add up the modes:

The coefficients come from the starting profile. For a rod with L=1L = 1 that is at temperature 1 between x=0.3x = 0.3 and x=0.7x = 0.7 and 0 elsewhere,

Proposition 1 (Short waves die first). Mode nn decays with time constant τn=L2/(αn2π2)=τ1/n2\tau_n = L^2/(\alpha n^2\pi^2) = \tau_1/n^2. After a time of order τ1\tau_1 only the first mode is left.

Proof

The factor in (2) is e−t/τne^{-t/\tau_n} with τn\tau_n as stated. The ratio of mode nn to mode 1 is (bn/b1)e−(n2−1)t/τ1(b_n/b_1)\,e^{-(n^2 - 1)t/\tau_1}, which tends to zero for every n≥2n \ge 2.

∎

3 Watching it relax

Figure 2 sums the first 15 terms of (2) with α=1\alpha = 1 at the time set by the slider, t=t =0.005. At t=0t = 0 the sharp block appears; by t≈0.05t \approx 0.05 the curve is almost a single sine arch, as proposition 1 predicts.

00.20.40.60.8100.51
position xx
temperature uu
Figure 2: Temperature profile at time tt (slider), from 15 terms of the series.

4 How sine waves make a corner

At t=0t = 0 the series must reproduce a profile with jumps. Figure 3 adds up the first N=N =5 terms. More terms sharpen the edges, but an overshoot of about 9% of the jump stays next to each one however many terms are used: the Gibbs phenomenon [2].

00.20.40.60.8100.51
position xx
partial sum
Figure 3: Partial sums of the Fourier sine series of the starting profile. The dashed line is the profile itself.

5 Real materials

The first time constant τ1=L2/(απ2)\tau_1 = L^2/(\alpha\pi^2) tells how long a rod takes to cool. Table 1 uses room-temperature diffusivities [3] for a rod of length L=0.5L = 0.5 m.

Table 1: Slowest cooling time τ1\tau_1 for a 0.5 m rod.
Materialα\alpha (m2^2/s)τ1\tau_1
Copper1.11×10−41.11\times10^{-4}3.8 min
Aluminium9.7×10−59.7\times10^{-5}4.4 min
Stainless steel4.2×10−64.2\times10^{-6}1.7 h
Window glass3.4×10−73.4\times10^{-7}21 h

Each Fourier mode behaves like an overdamped oscillator that only decays; compare the three regimes in the oscillator example. Diffusion with a source term is also the continuum version of the spreading in the SIR example.

References

  1. [1] J. Fourier, Théorie analytique de la chaleur, Firmin Didot, Paris (1822).
  2. [2] W. A. Strauss, Partial Differential Equations: An Introduction, 2nd ed., Wiley (2008), chapter 5.
  3. [3] Wikipedia, Thermal diffusivity, table of values.