Dulranga's Notes
Semester 3MathematicsDifferential EquationsPartial Differential Equations

Method of Variable Seperation

The method of separation of variables (also called the product method) is the standard technique for solving linear second-order PDEs with boundary conditions — especially the heat equation, wave equation, and Laplace equation.


The Core Idea

  1. Assume the solution is a product of functions, each depending on only one variable:
u(x,t)=X(x) T(t)u(x, t) = X(x)\,T(t)
  1. Substitute into the PDE and rearrange so that each side depends on a different variable.

  2. Since the variables are independent, both sides must equal a constant — the separation constant λ\lambda.

  3. This splits the PDE into two ordinary differential equations (ODEs), which are solved separately.

  4. Superpose the solutions and apply boundary/initial conditions using Fourier series.


Step 1: Assume a Product Solution

u(x,t)=X(x) T(t)u(x,t) = X(x)\,T(t)

Then:

∂u∂t=XdTdt,∂2u∂x2=Td2Xdx2\frac{\partial u}{\partial t} = X \frac{dT}{dt}, \qquad \frac{\partial^2 u}{\partial x^2} = T \frac{d^2 X}{dx^2}

Step 2: Separate the Variables

Example: The Heat Equation

∂u∂t=α2∂2u∂x2\frac{\partial u}{\partial t} = \alpha^2 \frac{\partial^2 u}{\partial x^2}

Substituting u=XTu = XT:

XdTdt=α2Td2Xdx2X \frac{dT}{dt} = \alpha^2 T \frac{d^2 X}{dx^2}

Divide both sides by α2XT\alpha^2 XT:

1α2TdTdt=1Xd2Xdx2\frac{1}{\alpha^2 T} \frac{dT}{dt} = \frac{1}{X} \frac{d^2 X}{dx^2}

Step 3: Set Both Sides Equal to a Constant

Important

The left side depends only on tt, the right only on xx. For them to be equal for all xx and tt, both must equal the same constant λ\lambda:

1α2TdTdt=1Xd2Xdx2=λ\frac{1}{\alpha^2 T} \frac{dT}{dt} = \frac{1}{X} \frac{d^2 X}{dx^2} = \lambda

This gives two ODEs:

T′−α2λT=0T' - \alpha^2 \lambda T = 0 X′′−λX=0X'' - \lambda X = 0

Step 4: Solve the ODEs

The choice of sign for λ\lambda is dictated by the boundary conditions.

λ\lambdaX(x)X(x) solutionType
λ=k2>0\lambda = k^2 > 0X=Aekx+Be−kxX = A e^{kx} + B e^{-kx}exponential
also, X=Acosh⁡(kx)+Bsinh⁡(kx)X = A\cosh(kx) + B\sinh(kx)
λ=0\lambda = 0X=Ax+BX = A x + Blinear
λ=−k2<0\lambda = -k^2 < 0X=Acos⁡kx+Bsin⁡kxX = A \cos kx + B \sin kxoscillatory (usually needed)

For the heat equation, boundary conditions like u(0,t)=u(L,t)=0u(0,t) = u(L,t) = 0 force λ=−k2<0\lambda = -k^2 < 0 and give:

Xn(x)=sin⁡nπxL,λn=−(nπL)2,n=1,2,3,…X_n(x) = \sin\frac{n\pi x}{L}, \qquad \lambda_n = -\left(\frac{n\pi}{L}\right)^2, \quad n = 1, 2, 3, \dots

and

Tn(t)=e−α2(nπ/L)2tT_n(t) = e^{-\alpha^2 (n\pi/L)^2 t}

Step 5: Superpose and Apply Initial Conditions

The general solution is a linear combination of the separated solutions:

u(x,t)=∑n=1∞Bn e−α2(nπ/L)2t sin⁡nπxLu(x,t) = \sum_{n=1}^{\infty} B_n \, e^{-\alpha^2 (n\pi/L)^2 t} \, \sin\frac{n\pi x}{L}

The coefficients BnB_n come from the initial condition u(x,0)=f(x)u(x,0) = f(x) via the Fourier sine series:

Bn=2L∫0Lf(x)sin⁡nπxL dxB_n = \frac{2}{L} \int_0^L f(x) \sin\frac{n\pi x}{L} \, dx

The Three Classical Second-Order PDEs

EquationProduct formResulting ODEsTypical eigenfunctions
Heat: ∂u∂t=α2∂2u∂x2\dfrac{\partial u}{\partial t} = \alpha^2 \dfrac{\partial^2 u}{\partial x^2}X(x)T(t)X(x)T(t)T′+α2k2T=0T' + \alpha^2 k^2 T = 0, X′′+k2X=0X'' + k^2 X = 0sin⁡(nπx/L)\sin(n\pi x/L)
Wave: ∂2u∂t2=c2∂2u∂x2\dfrac{\partial^2 u}{\partial t^2} = c^2 \dfrac{\partial^2 u}{\partial x^2}X(x)T(t)X(x)T(t)T′′+c2k2T=0T'' + c^2 k^2 T = 0, X′′+k2X=0X'' + k^2 X = 0sin⁡(nπx/L)\sin(n\pi x/L)
Laplace: ∂2u∂x2+∂2u∂y2=0\dfrac{\partial^2 u}{\partial x^2} + \dfrac{\partial^2 u}{\partial y^2} = 0X(x)Y(y)X(x)Y(y)X′′−k2X=0X'' - k^2 X = 0, Y′′+k2Y=0Y'' + k^2 Y = 0sin⁡(nπy/b)\sin(n\pi y/b)

Worked Example: Wave Equation on a String

Solve:

∂2u∂t2=c2∂2u∂x2,0<x<L, t>0\frac{\partial^2 u}{\partial t^2} = c^2 \frac{\partial^2 u}{\partial x^2}, \qquad 0 < x < L, \ t > 0

with u(0,t)=u(L,t)=0u(0,t) = u(L,t) = 0, u(x,0)=f(x)u(x,0) = f(x), ∂u∂t(x,0)=0\dfrac{\partial u}{\partial t}(x,0) = 0.

  1. Separate: u=X(x)T(t)u = X(x)T(t) gives
T′′c2T=X′′X=−k2\frac{T''}{c^2 T} = \frac{X''}{X} = -k^2
  1. Spatial ODE: X′′+k2X=0X'' + k^2 X = 0 with X(0)=X(L)=0X(0)=X(L)=0 gives

Xn=sin⁡nπxL,kn=nπLX_n = \sin\frac{n\pi x}{L}, \quad k_n = \frac{n\pi}{L}
  1. Time ODE: T′′+c2k2T=0T'' + c^2 k^2 T = 0 gives
Tn=Ancos⁡nπctL+Bnsin⁡nπctLT_n = A_n \cos\frac{n\pi c t}{L} + B_n \sin\frac{n\pi c t}{L}
  1. Superpose:
u(x,t)=∑n=1∞(Ancos⁡nπctL+Bnsin⁡nπctL)sin⁡nπxLu(x,t) = \sum_{n=1}^{\infty} \left( A_n \cos\frac{n\pi c t}{L} + B_n \sin\frac{n\pi c t}{L} \right) \sin\frac{n\pi x}{L}
  1. Initial conditions: from ∂u∂t(x,0)=0\dfrac{\partial u}{\partial t}(x,0)=0 we get Bn=0B_n = 0; from u(x,0)=f(x)u(x,0)=f(x) we get
An=2L∫0Lf(x)sin⁡nπxL dxA_n = \frac{2}{L} \int_0^L f(x) \sin\frac{n\pi x}{L} \, dx

Choosing the Separation Constant

The sign of λ\lambda is not arbitrary — it is forced by the boundary conditions.

  • u(0,t)=u(L,t)=0u(0,t)=u(L,t)=0 → trigonometric (sine) solutions → λ<0\lambda < 0.
  • ux(0,t)=ux(L,t)=0u_x(0,t)=u_x(L,t)=0 (insulated ends) → cosine solutions → still λ<0\lambda < 0, with λ0=0\lambda_0 = 0 allowed.
  • Unbounded / exponential decay → exponential solutions → λ>0\lambda > 0.
Practical recipe

Always solve the spatial equation first (it carries the boundary conditions and determines the eigenvalues). Then solve the time equation with those eigenvalues.


When the Method Works

Separation of variables requires:

  1. The PDE is linear and homogeneous.
  2. The boundary conditions are homogeneous (at least on the separated variables).
  3. The domain is rectangular / simple (interval, rectangle, disc, etc.).

For non-homogeneous problems, split the solution into steady + transient parts, or use eigenfunction expansion.


Summary of Steps

  1. Assume u=X(x)T(t)u = X(x)T(t) (or X(x)Y(y)X(x)Y(y)).
  2. Substitute and separate variables.
  3. Set both sides equal to a separation constant.
  4. Solve the spatial ODE → eigenvalues + eigenfunctions.
  5. Solve the time ODE.
  6. Superpose (sum) all solutions.
  7. Apply initial conditions → Fourier coefficients.

On this page