4.7.9Partial Differential Equations

Solving heat equation — separation of variables

1,885 words9 min readdifficulty · medium6 backlinks

WHAT are we solving?


HOW: the derivation from scratch

Step 1 — The separation guess. Assume u(x,t)=X(x)T(t)u(x,t)=X(x)\,T(t) (space-part times time-part). Why this step? If it works, derivatives split nicely; we lose nothing by trying — if no solution of this form exists, we'll find out.

Then ut=XTu_t = X T' and uxx=XTu_{xx}=X'' T. Substitute: XT=α2XT.X T' = \alpha^2 X'' T.

Step 2 — Separate the variables. Divide by α2XT\alpha^2 X T: Tα2T=XX.\frac{T'}{\alpha^2 T} = \frac{X''}{X}. Why this step? Now the left side depends only on tt, the right side only on xx. The only way a function of tt equals a function of xx for all x,tx,t is if both equal the same constant. Call it λ-\lambda. Why the minus sign? Foresight: we want decaying-in-time solutions, which needs λ-\lambda with λ>0\lambda>0. We'll verify the other sign cases fail.

XX=λ,Tα2T=λ.\frac{X''}{X} = -\lambda,\qquad \frac{T'}{\alpha^2 T}=-\lambda.

Step 3 — Solve the space ODE (an eigenvalue problem). X+λX=0,X(0)=0, X(L)=0.X'' + \lambda X = 0,\qquad X(0)=0,\ X(L)=0. Why these BCs? Since u(0,t)=X(0)T(t)=0u(0,t)=X(0)T(t)=0 for all tt, and T≢0T\not\equiv0 (else trivial), we need X(0)=0X(0)=0. Same at LL.

Test the sign of λ\lambda (Forecast-then-Verify):

  • λ<0\lambda<0, say λ=μ2\lambda=-\mu^2: X=Aeμx+BeμxX=A e^{\mu x}+Be^{-\mu x}. BCs force A=B=0A=B=0. Only trivial. ✗
  • λ=0\lambda=0: X=A+BxX=A+Bx. X(0)=0A=0X(0)=0\Rightarrow A=0; X(L)=0B=0X(L)=0\Rightarrow B=0. Trivial. ✗
  • λ>0\lambda>0, say λ=k2\lambda=k^2: X=Acoskx+BsinkxX=A\cos kx + B\sin kx. X(0)=0A=0X(0)=0\Rightarrow A=0, so X=BsinkxX=B\sin kx. X(L)=0sinkL=0kL=nπX(L)=0\Rightarrow \sin kL=0\Rightarrow kL=n\pi.

So the eigenvalues and eigenfunctions are λn=(nπL)2,Xn(x)=sinnπxL,n=1,2,3,\lambda_n=\left(\frac{n\pi}{L}\right)^2,\qquad X_n(x)=\sin\frac{n\pi x}{L},\quad n=1,2,3,\dots

Step 4 — Solve the time ODE. T=λα2T  Tn(t)=eλnα2t=eα2(nπ/L)2t.T' = -\lambda\alpha^2 T \ \Rightarrow\ T_n(t)=e^{-\lambda_n \alpha^2 t}=e^{-\alpha^2 (n\pi/L)^2 t}. Why this step? This is first-order linear; its solution is a pure exponential decay — exactly the "fading knob."

Step 5 — Build product solutions and superpose. Each un=sinnπxLeα2(nπ/L)2tu_n=\sin\frac{n\pi x}{L}\,e^{-\alpha^2(n\pi/L)^2 t} solves the PDE + BCs. The equation is linear and homogeneous, so sums of solutions are solutions: u(x,t)=n=1BnsinnπxL  eα2(nπ/L)2t\boxed{\,u(x,t)=\sum_{n=1}^{\infty} B_n \sin\frac{n\pi x}{L}\;e^{-\alpha^2 (n\pi/L)^2 t}\,}

Step 6 — Fit the initial condition with Fourier coefficients. At t=0t=0 the exponentials are 11: f(x)=n=1BnsinnπxL.f(x)=\sum_{n=1}^\infty B_n \sin\frac{n\pi x}{L}. This is a Fourier sine series. Multiply by sinmπxL\sin\frac{m\pi x}{L}, integrate 00 to LL, use orthogonality 0LsinnπxLsinmπxLdx=L2δnm\int_0^L \sin\frac{n\pi x}{L}\sin\frac{m\pi x}{L}\,dx=\frac{L}{2}\delta_{nm}: Bn=2L0Lf(x)sinnπxLdx\boxed{\,B_n=\frac{2}{L}\int_0^L f(x)\sin\frac{n\pi x}{L}\,dx\,}

Figure — Solving heat equation — separation of variables

Worked examples


Common mistakes


Recall Feynman: explain to a 12-year-old

Imagine a metal stick that's hot in the middle and cold at the ends, which you keep dunked in ice so the ends stay at 00°. Heat always crawls from hot spots to cold spots, so the hot middle slowly cools and spreads out. We pretend the temperature pattern is made of simple "wave shapes" (humps). Each hump fades on its own timer — skinny humps (lots of wiggles) fade super fast, fat humps fade slowly. To predict the future you just let every hump fade by its own timer and add them back up. After a long time only the biggest fattest hump is left, and then it disappears too. Cold stick. Done.


Flashcards

What guess starts separation of variables for ut=α2uxxu_t=\alpha^2u_{xx}?
u(x,t)=X(x)T(t)u(x,t)=X(x)T(t), a product of a space function and a time function.
After substituting u=XTu=XT, what justifies setting both sides to a constant?
One side depends only on tt, the other only on xx; equal for all x,tx,t ⇒ both equal a constant λ-\lambda.
Why is the separation constant taken as λ-\lambda with λ>0\lambda>0?
To get decaying time solutions eλα2te^{-\lambda\alpha^2 t} and nontrivial sine eigenfunctions satisfying zero BCs.
What are the eigenvalues and eigenfunctions for X+λX=0X''+\lambda X=0, X(0)=X(L)=0X(0)=X(L)=0?
λn=(nπ/L)2\lambda_n=(n\pi/L)^2, Xn=sin(nπx/L)X_n=\sin(n\pi x/L), n=1,2,n=1,2,\dots
What is the time factor for mode nn?
eα2(nπ/L)2te^{-\alpha^2(n\pi/L)^2 t}.
Full solution of the Dirichlet heat problem?
u=nBnsin(nπx/L)eα2(nπ/L)2tu=\sum_n B_n\sin(n\pi x/L)e^{-\alpha^2(n\pi/L)^2 t}.
Formula for the coefficients BnB_n?
Bn=2L0Lf(x)sin(nπx/L)dxB_n=\frac{2}{L}\int_0^L f(x)\sin(n\pi x/L)\,dx.
Which mode decays fastest and why?
High nn (wiggly modes); decay rate n2\propto n^2.
What does the rod's profile look like after a long time?
A single half-sine bump sin(πx/L)\sin(\pi x/L) (the n=1n=1 mode) shrinking to zero.
Why sines and not cosines here?
Zero (Dirichlet) end conditions; cosines are nonzero at x=0x=0, violating u(0,t)=0u(0,t)=0.
What orthogonality relation gives BnB_n?
0LsinnπxLsinmπxLdx=L2δnm\int_0^L\sin\frac{n\pi x}{L}\sin\frac{m\pi x}{L}dx=\frac L2\delta_{nm}.

Connections

  • Fourier Series — coefficients BnB_n are exactly Fourier sine coefficients.
  • Sturm-Liouville TheoryX+λX=0X''+\lambda X=0 is a Sturm–Liouville eigenvalue problem; orthogonality is guaranteed.
  • Wave Equation — same separation method, but time ODE is oscillatory (T=λc2TT''=-\lambda c^2 T) not decaying.
  • Laplace Equation — steady-state heat (ut=0u_t=0) gives uxx=0u_{xx}=0.
  • Boundary Conditions — Dirichlet vs Neumann — Neumann (insulated) ends give cosine series instead.
  • Superposition Principle — why summing product solutions is legal (linear homogeneous PDE).

Concept Map

models

has

has

guess

substitute and divide

gives

gives

force

only lambda greater than 0 works

eigenfunctions

solve

product

product

linear superposition

Fourier coefficients

Heat equation u_t = a^2 u_xx

Curvature drives heating

BCs u=0 at ends

Initial temp f of x

Assume u = X x times T t

Both sides equal constant -lambda

Space ODE X'' + lambda X = 0

Time ODE T' = -lambda a^2 T

Eigenvalues n pi over L squared

X_n = sin n pi x over L

T_n = exp -a^2 lambda_n t decay

u_n solutions

u = sum B_n u_n

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, heat equation ut=α2uxxu_t=\alpha^2 u_{xx} ka simple matlab hai: kisi point pe temperature kitni tezi se badlegi, ye us point pe profile ki "curvature" (uxxu_{xx}) pe depend karti hai. Hot bump cool hoti hai, cold dip warm hoti hai — heat hamesha garam se thande ki taraf behti hai aur sab smooth ho jaata hai.

Separation of variables ek smart guess hai: maan lo solution do hisson mein toot jaata hai — u=X(x)T(t)u=X(x)T(t), yaani ek "shape" jo waisa hi rehta hai aur ek "time knob" jo sirf fade hota hai. Substitute karke divide karne ke baad ek side sirf xx ka, doosri sirf tt ka function ban jaati hai. Dono equal tabhi ho sakte hain jab dono ek constant λ-\lambda ke barabar ho. Bas yahin hard PDE do easy ODE mein convert ho gaya.

Zero boundary conditions (ends 00° pe) ki wajah se solution sines deti hai: Xn=sin(nπx/L)X_n=\sin(n\pi x/L) aur λn=(nπ/L)2\lambda_n=(n\pi/L)^2. Time part exponential decay deta hai: eα2(nπ/L)2te^{-\alpha^2(n\pi/L)^2 t}. Important baat — jitna bada nn (jitni zyada wiggles), utni fast decay, kyunki rate n2n^2 ke proportional hai. Isliye initial ka koi bhi shape, kuch time baad sirf ek single half-sine hump ban ke reh jaata hai, phir wo bhi zero ho jaata hai.

Coefficients Bn=2L0Lf(x)sin(nπx/L)dxB_n=\frac{2}{L}\int_0^L f(x)\sin(n\pi x/L)dx — ye exactly Fourier sine series hai. Yaad rakho: 2L\frac{2}{L} factor orthogonality se aata hai (sine ka squared integral =L/2=L/2). Exam mein bahut common hai, aur 80/20 funda yahi hai: BC se eigenfunction decide hoti hai, decay rate n2n^2, aur long-time pe first mode dominate karta hai.

Go deeper — visual, from zero

Test yourself — Partial Differential Equations

Connections