Differential Equations › Section I · Partial differential equations › Topic I.5
Solving the heat equation
Separation of variables gives building blocks; superposition and Fourier series assemble them into a solution that matches any reasonable starting temperature. This topic completes the method for a bar with cold ends, a bar with insulated ends and a thin ring.
Three steps to a full solution
The previous topic turned \(u_t = k\,u_{xx}\) into two ODEs, \(X'' + \lambda X = 0\) and \(T' = -k\lambda T\), with the boundary conditions moved onto \(X\). Finishing the job takes three steps. First, solve the eigenvalue problem for \(X\), which picks out the allowed values of \(\lambda\). Second, solve the time equation for each one and multiply, giving a family of product solutions. Third, add infinitely many of them, by superposition, and choose the coefficients so the sum matches the initial temperature \(u(x, 0) = f(x)\). That last step is exactly a Fourier series.
Cold ends: the product solutions
Take \(u(0, t) = u(L, t) = 0\), a bar whose ends sit in ice water, with temperatures measured in degrees Celsius. The space problem is \(X'' + \lambda X = 0\), \(X(0) = X(L) = 0\). As found in Eigenvalues and eigenfunctions, \(\lambda \le 0\) gives only \(X = 0\), and the eigenvalues and eigenfunctions are
For each \(n\) the time equation gives \(T_n = e^{-k\lambda_n t}\). So each product \(X_n(x)\,e^{-k\lambda_n t}\) solves the PDE and both boundary conditions. Each is a sine-shaped temperature profile that keeps its shape while shrinking exponentially.
Superposition and the initial condition
The PDE and the boundary conditions are linear and homogeneous, so any sum of products is also a solution:
At \(t = 0\) every exponential equals 1, so the initial condition requires \(f(x) = \sum b_n \sin(n\pi x/L)\). That is the Fourier sine series of \(f\) on \(0 \le x \le L\), and the topic Fourier sine series gives its coefficients:
Every piecewise smooth starting temperature can be handled this way, which was Fourier's original purpose for the series.
Worked example: a starting profile made of sines
Solve the cold-ends problem when
1. The initial profile is already a sine series, so no integrals are needed: match terms. 2. The \(n = 2\) term has \(b_2 = 30\), the \(n = 5\) term has \(b_5 = 5\), and every other \(b_n = 0\). 3. Attach each term's exponential:
4. Check: at \(t = 0\) this is \(f(x)\), and both sines vanish at \(x = 0\) and \(x = L\). The second term decays \(25/4 = 6.25\) times faster than the first.
Worked example: a bar at a uniform temperature
A bar of length 1.0 m with \(k = 1.0 \times 10^{-4}\) m²/s starts at 40 °C throughout, and at \(t = 0\) both ends are plunged into ice water. 1. Coefficients:
2. So \(b_n = \frac{160}{n\pi}\) for odd \(n\) and 0 for even \(n\). 3. Solution:
4. Midpoint after 1000 s: \(k\pi^2 t \approx 0.987\), so the first term is \(\frac{160}{\pi}e^{-0.987}\), about 19.0 °C, and the \(n = 3\) term is about −0.002 °C. 5. Check: the bar is cooling towards 0 °C from 40 °C, so a midpoint of 19 °C is sensible.
How the solution behaves
Mode \(n\) decays like \(e^{-k(n\pi/L)^2 t}\), so its decay rate grows as \(n^2\): the third mode dies 9 times faster than the first, the tenth 100 times faster. Fine detail in the initial profile, which lives in the high modes, vanishes almost at once, and soon the first mode alone describes the bar. Its time scale, \(L^2/(k\pi^2)\), is about 1000 s in the last example; doubling the length makes it four times longer. Even a jump in \(f\), like the 40 °C bar meeting 0 °C ends, is smoothed instantly, because every exponential factor shrinks the high modes for any \(t > 0\).
Insulated ends
Now take \(u_x(0, t) = u_x(L, t) = 0\), so no heat escapes. The space problem becomes \(X'' + \lambda X = 0\), \(X'(0) = X'(L) = 0\). This time \(\lambda = 0\) is an eigenvalue, with \(X_0 = 1\), a constant, and the others are \(\lambda_n = (n\pi/L)^2\) with \(X_n = \cos(n\pi x/L)\). For \(\lambda_0 = 0\) the time equation gives \(T' = 0\), a constant. Superposition gives
Matching \(u(x, 0) = f(x)\) is the Fourier cosine series of \(f\), so one formula gives every coefficient:
The constant term \(\frac{a_0}{2}\) is the average of \(f\). Some books call it \(A_0\); the series is the same.
Worked example: an insulated bar evening out
An insulated bar of length 2 m starts with \(f(x) = 20 + 15x\) °C, from 20 °C at one end to 50 °C at the other. 1. Constant: with \(\frac{2}{L} = 1\), \(a_0\) is the integral of \(20 + 15x\) from 0 to 2, which is 70, so \(\frac{a_0}{2} = 35\), the average. 2. Cosine coefficients:
3. So \(a_n = -\frac{120}{n^2\pi^2}\) for odd \(n\) and 0 for even \(n\). 4. As \(t \to \infty\), every cosine term decays and \(u \to 35\) °C. 5. Check: with no heat lost, the total heat energy is fixed, so the final uniform temperature must be the initial average, 35 °C.
A thin ring
Bend a thin insulated wire into a ring and measure position by arc length along \(-L \le x \le L\), so \(x = -L\) and \(x = L\) are the same point. The conditions are periodic: \(u(-L, t) = u(L, t)\) and \(u_x(-L, t) = u_x(L, t)\). The eigenvalues are again \(\lambda_n = (n\pi/L)^2\) for \(n = 0, 1, 2, \ldots\), but now both \(\cos(n\pi x/L)\) and \(\sin(n\pi x/L)\) are eigenfunctions for each \(n \ge 1\). So
and the coefficients are those of the full Fourier series of \(f\) on \(-L \le x \le L\). Again \(u\) tends to the average temperature.
Common mistakes to avoid
First, using a sine series for insulated ends; zero flux needs cosines and the constant term. Second, dropping the constant term, or using \(a_0\) where \(\frac{a_0}{2}\) belongs, which doubles it; the constant term is the plain average, \(\frac{1}{L}\int_0^L f\,dx\). Third, giving every mode the same decay rate; mode \(n\) decays with \(k(n\pi/L)^2\). Fourth, losing the factor \((1 - (-1)^n)\), which makes the even coefficients zero for a uniform start. Fifth, predicting that a bar with cold ends settles at its average temperature; it settles at the end temperature, 0 °C, while only an insulated bar keeps its average.
Key takeaways
Solve the eigenvalue problem, attach the time factor \(e^{-k\lambda_n t}\) to each eigenfunction, add by superposition, and match \(u(x, 0) = f(x)\) with a Fourier series. Cold ends give a sine series in \(x\) with sine coefficients \(b_n\), each term decaying like \(e^{-k(n\pi/L)^2 t}\). Insulated ends add the eigenvalue 0 and use cosines; \(u\) tends to the average \(\frac{a_0}{2}\). A ring uses the full Fourier series on \(-L \le x \le L\). Higher modes decay as \(n^2\), so solutions smooth quickly and soon look like their slowest mode.
Flashcards
Flashcard
Eigenvalue problem, product solutions, superposition matched to f(x)
Test your understanding
Question 1 of 5
A bar with ends held at 0 °C has initial temperature f(x) = 10 sin(πx/L) + 4 sin(3πx/L). What is u(x, t)?
Question 2 of 5
A bar with ends held at 0 °C starts at 100 °C throughout. What is b₁ in its sine series solution?
Question 3 of 5
A perfectly insulated bar of length 4 m starts with f(x) = 10 + 5x °C. What temperature does it approach as t → ∞?
Question 4 of 5
In a cold-ends heat solution, how much faster does mode n = 4 decay than mode n = 1?
Question 5 of 5
Which eigenfunctions belong in the solution for a bar with both ends perfectly insulated?
