---
title: "Solve ∂²u/∂x² = ∂u/∂t with u = 0 at ends"
subject: "Applied Mathematics"
chapter: 3
key: "semester_4/applied_mathematics:heat-eq-dirichlet-ends"
source: https://www.bctengineer.com/q/semester_4/applied_mathematics/heat-eq-dirichlet-ends
site: BCT Engineering
---

# Solve ∂²u/∂x² = ∂u/∂t with u = 0 at ends

Applied Mathematics · Chapter 3: Partial Differential Equations

- Asked in: 2069 Bhadra
- Video: [Heat Equation | Separation of Variables Method in PDE | Example & Concepts by GP Sir](https://www.youtube.com/watch?v=NGz3Qo0rGiI) — Dr.Gajendra Purohit
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/applied_mathematics/heat-eq-dirichlet-ends
- Whole chapter: https://www.bctengineer.com/md/semester_4/applied_mathematics/chapter-3

## Question

Solve ∂²u/∂x² = ∂u/∂t given that u = 0 as t → ∞ as well as u = 0 at x = 0 and x = l.

## Short answer

Separation of variables with k=−p² gives u(x,t) = Σ_{n=1}∞ B_n sin(nπx/l) e^{−n²π²t/l²}. The constants B_n are determined by the initial condition via Fourier sine series.

## Answer

**Problem.** ∂²u/∂x² = ∂u/∂t (so c² = 1), with u = 0 as t → ∞, and u = 0 at x = 0 and x = l.

**Step 1: separate variables.** u = X(x)T(t): X″/X = T′/T = k.

**Step 2: sign of k.** The condition u → 0 as t → ∞ needs T → 0, so k = −p² < 0 (for k > 0, T = e^{kt} grows; for k = 0, the end conditions force u ≡ 0).

```text
X″ + p² X = 0     →  X = A cos px + B sin px
T′ + p² T = 0     →  T = C e^{−p²t}
```

**Step 3: end conditions.**

- u(0, t) = 0 gives A = 0.
- u(l, t) = 0 gives B sin pl = 0, so p = nπ/l.

**Step 4: general solution** by superposition:

**u(x, t) = Σ_{n=1}^{∞} Bₙ sin(nπx/l) e^{−n²π²t/l²}**

If a heat equation with diffusivity c² is intended, replace t by c²t in the exponent.

**Step 5: constants.** The initial condition is not given. If u(x, 0) = f(x), then

Bₙ = (2/l) ∫₀^l f(x) sin(nπx/l) dx

(For example, with f(x) = sin(πx/l) only B₁ = 1 survives: u = sin(πx/l) e^{−π²t/l²}.)

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why must the separation constant be negative (k = -p^2)?
   A. Because X must be exponential
   B. Because the end conditions force k < 0
   C. Because heat equation requires p to be imaginary
   D. u must tend to 0 as t tends to infinity, so T must decay
   Answer: D. For k > 0, T = e^{kt} grows; for k = 0 the end conditions force u = 0. (Key point: Sign of k)

2. What do u(0,t)=0 and u(l,t)=0 give?
   A. A = 0 and sin pl = 0, so p = n pi/l
   B. B = 0 and cos pl = 0
   C. A = 0 and p = n pi
   D. A = B = 0
   Answer: A. The cosine term must vanish at x=0 and the sine must vanish at x=l. (Key point: End conditions)

3. What is the general solution?
   A. Sum of B_n cos(n pi x/l) e^{-n^2 pi^2 t/l^2}
   B. Sum of B_n sin(n pi x/l) e^{-n^2 pi^2 t/l^2}
   C. Sum of B_n sin(n pi x/l) e^{n^2 pi^2 t/l^2}
   D. Sum of B_n sin(n pi x/l) e^{-n pi t/l}
   Answer: B. Superposition of the decaying sine modes. (Key point: General solution)

## Related in Applied Mathematics

- [Heat equation, insulated ends, u(x,0)=lx-x²](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Aheat-eq-insulated-ends-lx-x2) — Applied Mathematics, chapter 3, asked 2×
- [Heat equation, insulated ends, u(x,0)=x](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Aheat-eq-insulated-ends-u-x) — Applied Mathematics, chapter 3
