---
title: "Solve one dimensional heat equation"
subject: "Mathematics III"
chapter: 4
key: "semester_3/mathematics_iii:solve-one-dimensional-heat-equation-three"
source: https://www.bctengineer.com/q/semester_3/mathematics_iii/solve-one-dimensional-heat-equation-three
site: BCT Engineering
---

# Solve one dimensional heat equation

Mathematics III · Chapter 4: Fourier Series

- Asked in: 2081 Chaitra (new course), 4 marks
- Video: [Solution of One Dimensional Heat Equation](https://www.youtube.com/watch?v=1WI9zeXJdNw) — Mathematics with Jaskirat Makkar
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/mathematics_iii/solve-one-dimensional-heat-equation-three
- Whole chapter: https://www.bctengineer.com/md/semester_3/mathematics_iii/chapter-4

## Question

Solve the one dimensional heat equation ∂u/∂t = ∂²u/∂x² subject to u(0, t) = u(ℓ, t) = 0 and u(x, 0) = u₀ sin(πx/ℓ).

## Short answer

Separation of variables yields u(x,t) = Σ Bₙ sin(nπx/ℓ) e^(−n²π²t/ℓ²). Applying u(x,0)=u₀ sin(πx/ℓ) gives B₁=u₀ and all other Bₙ=0, so u(x,t) = u₀ e^(−π²t/ℓ²) sin(πx/ℓ).

## Answer

Let u = X(x)T(t). From ∂u/∂t = ∂²u/∂x²: X T′ = X″T, so X″/X = T′/T = −p² (a negative constant, so that the temperature decays).

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

**Boundary conditions**

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

Hence u = Σ Bₙ sin(nπx/ℓ) e^(−n²π²t/ℓ²).

**Initial condition.** u(x, 0) = u₀ sin(πx/ℓ) = Σ Bₙ sin(nπx/ℓ). Comparing both sides, B₁ = u₀ and Bₙ = 0 for n ≥ 2.

**Answer:**

u(x, t) = u₀ e^(−π²t/ℓ²) sin(πx/ℓ)

## Check yourself

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

1. Why is the separation constant chosen as -p^2?
   A. Because boundaries are zero
   B. So the temperature decays with time instead of growing
   C. To make X linear
   D. So the solution is a polynomial
   Answer: B. A negative constant gives T = C e^(-p^2 t), a decaying exponential. (Key point: Separation constant)

2. What does u(l,t) = 0 imply after A = 0?
   A. p = n pi l
   B. B = 0
   C. cos(pl) = 0
   D. B sin(pl) = 0 so p = n pi/l
   Answer: D. For a nontrivial solution sin(pl) must vanish. (Key point: Boundary condition)

3. How are the coefficients found from u(x,0) = u0 sin(pi x/l)?
   A. Compare terms: B1 = u0 and others are zero
   B. All Bn equal u0
   C. Only B2 is nonzero
   D. Bn = u0/n
   Answer: A. The initial profile is already the n = 1 sine mode. (Key point: Initial condition)

4. What is the solution?
   A. u0 e^(-pi^2 t/l^2) cos(pi x/l)
   B. u0 e^(-pi^2 t/l^2) sin(pi x/l)
   C. u0 e^(pi^2 t/l^2) sin(pi x/l)
   D. u0 e^(-pi t/l) sin(pi x/l)
   Answer: B. n = 1 gives decay rate pi^2/l^2. (Key point: Final solution)

## Related in Mathematics III

- [Solve one dimensional heat equation](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Asolve-one-dimensional-heat-equation) — Mathematics III, chapter 4
- [Solve one dimensional heat equation](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Asolve-one-dimensional-heat-equation-two) — Mathematics III, chapter 4
- [Solve a partial differential equation](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Asolve-a-partial-differential-equation-two) — Mathematics III, chapter 4
- [Derive or solve wave equation](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Aderive-or-solve-wave-equation-two) — Mathematics III, chapter 4

## Related in other subjects

- [Derive one-dimensional heat equation](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Aheat-eq-derive) — Applied Mathematics, chapter 3, asked 5×
- [Variational approach for one-dimensional heat conduction](https://www.bctengineer.com/question.md?key=semester_8%2Ffinite_element_method%3Avariational-approach-heat-conduction) — Finite Element Method, chapter 5
- [Derive 1D heat equation and solve](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Aheat-eq-derive-and-solve) — Applied Mathematics, chapter 3, asked 4×
- [Derive one-dimensional wave equation](https://www.bctengineer.com/question.md?key=semester_4%2Fapplied_mathematics%3Awave-eq-derive) — Applied Mathematics, chapter 3, asked 2×
