Search

Search papers and lessons

Partial Differential Equation

Level 3 · 12 min read

A partial differential equation relates a function of several variables to its partial derivatives, stating how the function changes in time and space at once.

On this page

  • Colour = topic mix
  • Calculus
  • Discrete math
  • Sign in to see your progress

TL;DR

A partial differential equation (PDE) is a rule that links an unknown function of several variables, such as temperature at each point in a rod at each moment, to its partial derivatives. The rule says how fast the function changes in one variable while the others are held fixed, and the solution is the function that obeys the rule everywhere.

PDEs describe almost every physical process that spreads, vibrates or flows through space over time. Most of them cannot be solved with a formula, so the methods for finding solutions are as important as the equations themselves.

Where you'll see it: in the heat equation that governs how a hot pan cools, the wave equation for a guitar string, the Navier–Stokes equations for water and air, and the Black–Scholes equation for option prices.

Intuition

Change in time depends on change in space

Put a warm metal rod on a cold table. Heat flows from hot regions to cold ones, and the rate at which a point warms or cools depends on how its temperature compares with its neighbours. A point that is hotter than its surroundings loses heat. A point that is colder gains it. The rule is local: each point responds to the shape of the temperature around it.

An ordinary differential equation (ODE) captures a rule like this for one variable: the rate of change of a quantity depends on its current value. A rod is a continuum, though, so temperature depends on position xx as well as time tt. The rate of change over time now depends on how the temperature bends over space. That is a PDE: a relation between u(x,t)u(x,t) and its derivatives in both xx and tt.

The key ingredient is curvature in space. A temperature profile that is peaked, like a hill, loses heat at its top and gains it in its valleys, so the hill flattens. The second derivative in space measures that curvature, and the equation says the hill flattens at a rate proportional to it.

00.20.40.60.8100.20.40.60.81position x along the rodtemperature u
  • t = 0
  • t = 0.1
A hump of heat in a rod, with both ends held at zero, flattens as time passes. The peak drops from 1 to about 0.61 by time 0.1.

Why we study them

Most laws of nature are stated as rates: how fast mass accumulates, how fast momentum changes, how fast energy moves. When the quantity lives in space, those rates are partial derivatives, and the law becomes a PDE. Knowing the equation lets an engineer predict the temperature in a turbine blade or the sound from a drum without building either one.

The math

Definition and notation

Definition: Partial differential equation

A PDE is an equation that involves an unknown function uu of several independent variables, say u(x1,…,xn)u(x_1, \dots, x_n), together with some of its partial derivatives. The order of the PDE is the highest derivative that appears.

A few conventions help when reading PDEs. We write ut=∂u/∂tu_t = \partial u / \partial t, ux=∂u/∂xu_x = \partial u / \partial x and uxx=∂2u/∂x2u_{xx} = \partial^2 u / \partial x^2. The equation is linear if uu and its derivatives appear only to the first power and are not multiplied together; otherwise it is nonlinear. It is homogeneous if there is no term without uu in it.

The main examples, each with a single space variable xx and time tt, are:

ut=α uxx(heat equation, second order, linear)utt=c2 uxx(wave equation, second order, linear)ut+c ux=0(advection equation, first order, linear)\begin{aligned} u_t &= \alpha\, u_{xx} && \text{(heat equation, second order, linear)} \\ u_{tt} &= c^2\, u_{xx} && \text{(wave equation, second order, linear)} \\ u_t + c\, u_x &= 0 && \text{(advection equation, first order, linear)} \end{aligned}

Here α>0\alpha \gt 0 is a diffusivity, and cc is a speed. The equations hold for xx and tt in a domain, and they only determine a unique solution once we add conditions at the edges of that domain.

Boundary and initial conditions

A PDE on its own has many solutions. To pin down one, we add:

  • an initial condition, the state at time zero, such as u(x,0)=f(x)u(x,0) = f(x), and
  • boundary conditions, what happens at the ends of the domain, such as u(0,t)=u(L,t)=0u(0,t) = u(L,t) = 0 (both ends held at zero) or insulated ends where the derivative is zero.

A problem with a PDE, boundary conditions and initial conditions is well-posed when a solution exists, is unique, and depends continuously on the data. The heat equation is well-posed forward in time. Run it backwards and small errors blow up, which is why reconstructing an earlier temperature from a later one is hard.

Solving the heat equation by separation of variables

Look for solutions that factor: u(x,t)=X(x) T(t)u(x,t) = X(x)\,T(t). Substituting into ut=αuxxu_t = \alpha u_{xx} gives X T′=α X′′ TX\,T' = \alpha\, X''\,T. Divide by αXT\alpha X T:

T′αT=X′′X.\frac{T'}{\alpha T} = \frac{X''}{X}.

The left side depends only on tt and the right only on xx, so both must equal a constant −λ-\lambda. This gives two ordinary differential equations: X′′=−λXX'' = -\lambda X with the boundary conditions, and T′=−αλTT' = -\alpha\lambda T.

With X(0)=X(L)=0X(0) = X(L) = 0, the first problem has nonzero solutions only for λn=(nπ/L)2\lambda_n = (n\pi/L)^2 with n=1,2,3,…n = 1, 2, 3, \dots, and then Xn(x)=sin⁡(nπx/L)X_n(x) = \sin(n\pi x/L). The time part is Tn(t)=e−αλntT_n(t) = e^{-\alpha \lambda_n t}. Each mode un(x,t)=e−α(nπ/L)2tsin⁡(nπx/L)u_n(x,t) = e^{-\alpha(n\pi/L)^2 t}\sin(n\pi x/L) solves the PDE and the boundary conditions.

The heat equation is linear, so sums of solutions are solutions. For a general initial profile ff, we write

u(x,t)=∑n=1∞bn e−α(nπ/L)2t sin⁡ ⁣(nπxL),bn=2L∫0Lf(x) sin⁡ ⁣(nπxL) dx.u(x,t) = \sum_{n=1}^{\infty} b_n\, e^{-\alpha (n\pi/L)^2 t}\, \sin\!\left(\frac{n\pi x}{L}\right), \qquad b_n = \frac{2}{L}\int_0^L f(x)\,\sin\!\left(\frac{n\pi x}{L}\right)\,dx.

The coefficients bnb_n are chosen so that the sum at t=0t = 0 equals ff. High-frequency modes (large nn) decay fastest, which is why sharp features in a temperature profile smooth out first.

The advection equation has a transport solution

For ut+c ux=0u_t + c\,u_x = 0, the solution is a shape moving at speed cc: u(x,t)=f(x−ct)u(x,t) = f(x - ct). To check, compute ut=−cf′(x−ct)u_t = -c f'(x-ct) and ux=f′(x−ct)u_x = f'(x-ct). Then ut+cux=−cf′+cf′=0u_t + c u_x = -c f' + c f' = 0.

The wave equation

The wave equation utt=c2uxxu_{tt} = c^2 u_{xx} has d'Alembert's solution u(x,t)=F(x−ct)+G(x+ct)u(x,t) = F(x - ct) + G(x + ct): two shapes moving in opposite directions at speed cc. The second derivative in time plays the role that acceleration plays in Newton's law, and the second derivative in space plays the role of the restoring force from a stretched string.

Algorithm
Solving a linear PDE on an interval
  1. Write down the PDE, the boundary conditions and the initial condition.
  2. Check whether the problem is linear and whether the boundary conditions are homogeneous (zero on the ends).
  3. Try separation of variables u=X(x)T(t)u = X(x)T(t) to get ordinary differential equations.
  4. Solve the spatial eigenvalue problem, which gives the allowed modes.
  5. Superpose the modes and fit their coefficients to the initial condition.

Worked examples

Example
Moving a pulse with advection

Let ut+2ux=0u_t + 2u_x = 0 with initial condition u(x,0)=e−x2u(x,0) = e^{-x^2}. The wave speed is c=2c = 2, so u(x,t)=e−(x−2t)2u(x,t) = e^{-(x - 2t)^2}.

  1. At t=0t = 0 the peak is at x=0x = 0, where u=e0=1u = e^0 = 1.
  2. At t=1t = 1 the pulse has moved to x=2x = 2, where u(2,1)=e−(2−2)2=1u(2,1) = e^{-(2-2)^2} = 1.
  3. At t=1t = 1 the point x=0x = 0 has u(0,1)=e−(0−2)2=e−4≈0.0183u(0,1) = e^{-(0-2)^2} = e^{-4} \approx 0.0183. The pulse has left that point, so its value is almost zero.
  4. Check: ut=4(x−2t)e−(x−2t)2u_t = 4(x-2t)e^{-(x-2t)^2} and 2ux=−4(x−2t)e−(x−2t)22u_x = -4(x-2t)e^{-(x-2t)^2}, so ut+2ux=0u_t + 2u_x = 0.

Interpretation: the shape keeps its form and simply translates at speed cc. No part of it spreads or decays.

Example
Cooling a rod, one mode at a time

Take a rod of length L=1L = 1 with ends held at zero, diffusivity α=0.5\alpha = 0.5, and initial profile u(x,0)=sin⁡(πx)u(x,0) = \sin(\pi x). This is a single mode, so the sum has just one term with b1=1b_1 = 1 and n=1n = 1.

  1. The solution is u(x,t)=e−0.5 π2tsin⁡(πx)u(x,t) = e^{-0.5\,\pi^2 t}\sin(\pi x).
  2. The decay rate is 0.5 π2≈0.5×9.8696=4.93480.5\,\pi^2 \approx 0.5 \times 9.8696 = 4.9348 per unit time.
  3. At t=0.1t = 0.1, the factor is e−0.49348≈0.6105e^{-0.49348} \approx 0.6105. At the middle of the rod, u(0.5,0.1)=0.6105×sin⁡(π/2)=0.6105u(0.5, 0.1) = 0.6105 \times \sin(\pi/2) = 0.6105.
  4. The half-life of the profile is ln⁡2/4.9348≈0.14\ln 2 / 4.9348 \approx 0.14. After about 0.14 time units, the middle of the rod is at half its starting temperature.

Interpretation: the shape stays a sine wave, but its height shrinks exponentially. Every mode does the same, with higher modes decaying faster.

Example
Stability of a numerical scheme

PDEs with no closed-form solution are solved on a grid. For the heat equation, the simplest explicit scheme updates each grid point from its neighbours, with spatial step Δx\Delta x and time step Δt\Delta t. It is stable only when the number r=α Δt/Δx2r = \alpha\,\Delta t / \Delta x^2 is at most 1/21/2.

  1. Take α=1\alpha = 1 and Δx=0.1\Delta x = 0.1. Then Δx2=0.01\Delta x^2 = 0.01.
  2. With Δt=0.005\Delta t = 0.005, we get r=1×0.005/0.01=0.5r = 1 \times 0.005 / 0.01 = 0.5. This is on the boundary of stability, and the scheme works.
  3. With Δt=0.01\Delta t = 0.01, we get r=1r = 1. The scheme is unstable: small errors grow with each step, and the numerical "temperature" oscillates and explodes.
  4. Halving Δx\Delta x quarters the allowed Δt\Delta t, because Δt\Delta t must scale with Δx2\Delta x^2.

Interpretation: the step restriction comes from the diffusion itself, not from the accuracy you want. Doubling the resolution makes the explicit scheme four times as expensive in time steps.

Tradeoffs and failure modes

PDEs look uniform, but their behaviour depends strongly on the type. The table below gives the usual starting points.

SituationProblemBetter choice
Simple geometry, linear equationClosed form may existSeparation of variables or a transform such as the [[fourier-transform
Irregular geometryNo separable solutionFinite element or finite volume method
Explicit time stepping for diffusionStep size limited by Δx2\Delta x^2Implicit schemes, which are stable for any step size but need a linear solve each step
Shocks or sharp fronts in a transport problemSmooth numerical methods smear or oscillateUpwind schemes or methods designed for conservation laws
Nonlinear fluid flow (Navier–Stokes)No general closed-form solution, and smooth solutions are not guaranteed for all timeNumerical simulation with careful resolution checks
Data-rich problem with a known PDESolving the PDE accurately is expensivePhysics-informed or learned surrogates, validated against numerical solutions

Some practical warnings:

  • Boundary conditions are part of the problem. Changing the condition at one end can change the whole solution. A wrong boundary condition gives a stable, plausible, and wrong answer.
  • Linearity is a powerful assumption. Superposition holds only for linear equations. Two solutions of a nonlinear PDE generally do not add to a solution.
  • Stability is not accuracy. A scheme can be stable and still converge slowly or give a smeared answer. Check with a finer grid.
  • The wave equation does not smooth. A sharp pluck on a string stays sharp as it travels, while heat smooths sharp features immediately. Choosing the wrong model for the physics gives the wrong qualitative picture.

History

Jean le Rond d'Alembert published his solution of the wave equation for a vibrating string in 1747, working on the problem of a string plucked into a shape. Leonhard Euler and Daniel Bernoulli worked on the same problem and disagreed about which functions were allowed as solutions, a dispute that helped push mathematics toward a clearer idea of a function.

The heat equation came from Joseph Fourier, who in 1822 published Théorie analytique de la chaleur (The analytic theory of heat). He solved it by expanding temperature in sine and cosine series, the method now called separation of variables with Fourier series. The idea was controversial at first, because it asserted that an arbitrary function could be written as such a sum. That claim drove much of nineteenth-century analysis.

The Navier–Stokes equations for viscous fluids were written down in stages, by Claude-Louis Navier in 1822 and by George Gabriel Stokes in the 1840s. They remain one of the central unsolved problems in mathematics: whether smooth solutions in three dimensions always exist for all time.

PDEs caught on because they turned local physical laws into equations that could be solved and tested. Engineering, physics and, later, finance all adopted the same tools, and modern numerical methods built on them make PDEs the standard language of simulation.

Check yourself

QuestionFor the equation ut=3uxxu_t = 3u_{xx}, is it linear, and what is its order? Does the equation ut+u ux=0u_t + u\,u_x = 0 have the same properties?Show answer

ut=3uxxu_t = 3u_{xx} is linear, because uu and its derivatives appear only to the first power and are not multiplied together. Its highest derivative is second order in xx and first order in tt, so the order is 2. The equation ut+u ux=0u_t + u\,u_x = 0 is first order but nonlinear, because the term u uxu\,u_x multiplies uu by its own derivative. This is the inviscid Burgers equation, and it can form shocks even from smooth initial data.

QuestionUsing the advection solution u(x,t)=f(x−ct)u(x,t) = f(x - ct) with c=3c = 3 and f(x)=sin⁡xf(x) = \sin x, what is u(π/2,0.5)u(\pi/2, 0.5)?Show answer

Substitute into the formula: u(π/2,0.5)=sin⁡(π/2−3×0.5)=sin⁡(π/2−1.5)u(\pi/2, 0.5) = \sin(\pi/2 - 3 \times 0.5) = \sin(\pi/2 - 1.5). Since π/2≈1.5708\pi/2 \approx 1.5708, the argument is about 0.07080.0708, and sin⁡(0.0708)≈0.0708\sin(0.0708) \approx 0.0708. The pattern has moved right by 1.5 units, so the value at π/2\pi/2 is the value the initial profile had at π/2−1.5\pi/2 - 1.5.

QuestionIn the heat rod example, why does a sharp feature in the initial temperature disappear faster than a broad hump?Show answer

A sharp feature contains high-frequency modes, with large nn. Each mode decays as e−α(nπ/L)2te^{-\alpha(n\pi/L)^2 t}, so the decay rate grows with the square of the frequency. A broad hump is mostly made of low modes, which decay slowly. The sharp feature loses its high-frequency content quickly and becomes smooth, while the broad hump keeps its shape for longer.

QuestionA student uses an explicit scheme for the heat equation with α=2\alpha = 2, Δx=0.05\Delta x = 0.05 and Δt=0.0005\Delta t = 0.0005. Is it stable, and what is the largest stable Δt\Delta t for this grid?Show answer

The number is r=α Δt/Δx2=2×0.0005/0.0025=0.4r = \alpha\,\Delta t / \Delta x^2 = 2 \times 0.0005 / 0.0025 = 0.4. This is at most 1/21/2, so the scheme is stable. The largest stable step satisfies r=1/2r = 1/2, giving Δt=r Δx2/α=0.5×0.0025/2=0.000625\Delta t = r\,\Delta x^2 / \alpha = 0.5 \times 0.0025 / 2 = 0.000625.

Sources