Finite Difference Methods for PDEs

A partial differential equation is a statement about a continuum: it fixes, at every one of an uncountable infinity of points, a local relation between a field and its derivatives. A computer holds only finitely many numbers, so the first act of any numerical method is a surrender of the continuum — we keep the field only at the nodes of a grid and rebuild each derivative from the handful of nodal values that surround it. That rebuilding is the finite difference method: replace ∂xu\partial_x u by a slope between neighbours, replace ∂x2u\partial_x^2 u by a curvature among three, and the differential equation collapses into a large, sparse system of ordinary algebra. It is the oldest discretization of differential equations and still the one you reach for first, because every piece of it can be re-derived from a single tool — Taylor's theorem. Three questions decide whether the algebra is worth solving. Consistency asks whether each stencil actually reproduces the operator it replaces as the spacing h→0h\to 0; Taylor expansion answers it and hands over the truncation error as a bonus. Stability asks whether the errors that rounding and truncation inject at one step stay bounded as the march proceeds, or grow without limit; a one-line Fourier substitution — von Neumann's device — answers it. Convergence, the property we actually want, asks whether the numbers approach the true solution. The remarkable gift of the field, the Lax equivalence theorem, is that for a consistent scheme on a well-posed linear problem the third question reduces to the second: stability is exactly convergence. So the whole subject turns on two tractable calculations — a Taylor expansion and an amplification factor — standing in for one intractable one.

Key takeaways
  • Finite difference methods keep a field only at grid nodes and rebuild every derivative as a Taylor-derived combination of neighbours, turning a PDE into a sparse algebraic system.
  • The central second difference (ui+1−2ui+ui−1)/h2(u_{i+1}-2u_i+u_{i-1})/h^2 is second-order accurate, with leading error −h212u(4)-\tfrac{h^2}{12}u^{(4)} — symmetry buys the extra order by cancelling odd terms.
  • Explicit schemes (FTCS for the heat equation) are cheap but only conditionally stable, needing the diffusion number r=α Δt/Δx2≤12r=\alpha\,\Delta t/\Delta x^2\le \tfrac12.
  • Implicit schemes (BTCS, Crank–Nicolson) cost a linear solve each step but are unconditionally stable; Crank–Nicolson is also second order in time.
  • Von Neumann analysis reads stability off the amplification factor g(k)g(k) of a single Fourier mode: stable exactly when its size never exceeds 1.
  • The hyperbolic CFL condition ν=c Δt/Δx≤1\nu=c\,\Delta t/\Delta x\le 1 demands the numerical domain of dependence contain the physical one.
  • Key idea: Replace each derivative by a Taylor-derived difference quotient on a grid; the PDE becomes algebra. Convergence then follows from consistency (truncation error → 0) plus stability (errors not amplified), as guaranteed by the Lax equivalence theorem.

Where this lives today

Finite differences remain the backbone of large-scale scientific computing, precisely because their stencils map so naturally onto structured grids and modern hardware. In computational electromagnetics the FDTD (finite-difference time-domain) method — Yee's 1966 staggered-grid leapfrog for Maxwell's equations, governed by exactly the CFL condition derived above — designs antennas, photonic devices, and the absorption of radio waves in tissue. Exploration seismology propagates elastic waves through kilometre-scale earth models with high-order difference operators to image oil reservoirs and, in reverse, to locate earthquakes. Numerical weather prediction and climate modelling still run finite-difference (and finite-volume) dynamical cores over the sphere, the direct descendants of the 1950 ENIAC forecast, now integrated on tens of thousands of processors. Quantitative finance prices exotic options by Crank–Nicolson on the Black–Scholes convection–diffusion equation, using projected solvers for the free boundary of American options. And a whole subfield of high-performance computing is devoted to stencil optimization — the memory-bandwidth-bound art of streaming these neighbour sums through GPU caches — because for structured problems the humble five-point Laplacian, wrapped in a multigrid solver, still outruns almost everything else. The open frontiers are non-smooth: provably stable high-order schemes for shocks and steep gradients (ENO/WENO, summation-by-parts operators) and structure-preserving discretizations that conserve energy or respect a discrete maximum principle exactly.

The physical picture

Picture the unknown field sampled only on the nodes of a chessboard. A derivative is no longer a limit but a recipe that mixes a few neighbouring squares: the slope across two squares stands in for ∂u/∂x\partial u/\partial x, and the curvature among three — how far the middle square sits below the average of its flanks — stands in for ∂2u/∂x2\partial^2 u/\partial x^2. The PDE then reads, at every square, "this combination of my neighbours must equal that combination", and the collection of all those local statements is one giant simultaneous system. For a steady problem it is a single sparse linear solve; for an evolving one it is a rule that marches the whole board forward one tick at a time. The first figure shows the canonical stencil — the five-point Laplacian — that encodes "centre minus the average of four neighbours".

Figure
The five-point stencil on a square grid
The discrete Laplacian: centre node minus the average of its four neighbours +1 +1 +1 +1 −4 u_{i−1,j} u_{i+1,j} u_{i,j+1} u_{i,j−1} u_{i,j} h ∇²u ≈ (u_{i+1,j} + u_{i−1,j} + u_{i,j+1} + u_{i,j−1} − 4u_{i,j}) / h²

Accuracy is bought entirely from cancellation. A one-sided (forward) difference leaves the first uncancelled Taylor term at order hh; placing the sample symmetrically kills the leading odd term and leaves order h2h^2. Recruit more neighbours with cleverly chosen weights and you annihilate more Taylor coefficients, climbing to fourth order and beyond. Stability is a different concern and it lives in time. Decompose the numerical field into Fourier ripples; each ripple is multiplied by an amplification factor g(k)g(k) every step. If every gg stays no larger than one in magnitude the errors decay or hold; if a single mode has ∣g∣>1|g|>1 it grows geometrically and eventually swamps the answer. The second figure plots exactly that factor for the explicit heat scheme and shows the knife-edge at r=12r=\tfrac12.

Figure
Von Neumann growth factor for the explicit heat scheme
The punchline: g = 1 − 4r sin²(kΔx/2) — the shortest wave decides stability stable band: growth factor between −1 and 1 1 0 −1 −3 0 π grid phase kΔx growth factor g r = 0.25 r = 0.5 (edge) r = 1: g = −3, grows 3× / step

The core equations

A finite difference method is a dictionary that translates each derivative into a weighted sum of nodal values. The three difference quotients below are the whole vocabulary for one dimension; every scheme in the article is assembled from them. The first is the cheapest and least accurate — a one-sided slope whose Taylor remainder is first order in hh.

u′(x)=u(x+h)−u(x)h−h2u′′(ξ)(1)u'(x)=\frac{u(x+h)-u(x)}{h}-\frac{h}{2}u''(\xi) \qquad (1)

where: hh — grid spacing; u′(x)u'(x) — first derivative being approximated; ξ\xi — a point in (x,x+h)(x,x+h) supplied by the Taylor remainder. The remainder is exact, not an estimate: the error is a genuine multiple of u′′u'' evaluated somewhere in the cell. Sampling symmetrically about xx makes the even-order Taylor terms cancel in the difference, lifting the accuracy to second order at no extra node count — the workhorse first-derivative stencil.

u′(x)=u(x+h)−u(x−h)2h+O(h2)(2)u'(x)=\frac{u(x+h)-u(x-h)}{2h}+\mathcal{O}(h^2) \qquad (2)

where: u(x±h)u(x\pm h) — values at the two neighbouring nodes. The leading error is +h26u′′′(x)+\tfrac{h^2}{6}u'''(x): halving hh cuts it fourfold. Adding rather than subtracting the two neighbour expansions cancels the odd terms and isolates the curvature — the single most important stencil in the subject, since it is the discrete second derivative that appears in every diffusion, wave, and potential problem.

u′′(x)=u(x+h)−2u(x)+u(x−h)h2−h212u(4)(x)+⋯(3)u''(x)=\frac{u(x+h)-2u(x)+u(x-h)}{h^2}-\frac{h^2}{12}u^{(4)}(x)+\cdots \qquad (3)

where: u′′(x)u''(x) — second derivative; u(4)u^{(4)} — fourth derivative setting the leading error. In two dimensions the same construction along xx and yy gives the five-point Laplacian of the first figure. Applied to the heat equation ut=αuxxu_t=\alpha u_{xx} with a forward time difference and this central space difference, we get the FTCS (forward-time, centred-space) scheme — the prototype explicit marcher.

uin+1−uinΔt=α ui+1n−2uin+ui−1nΔx2(4)\frac{u_i^{n+1}-u_i^n}{\Delta t}=\alpha\,\frac{u_{i+1}^n-2u_i^n+u_{i-1}^n}{\Delta x^2} \qquad (4)

where: uinu_i^n — the approximation to u(xi,tn)u(x_i,t_n); α\alpha — thermal diffusivity; Δt,Δx\Delta t,\Delta x — time and space steps. Every quantity on the right is known at level nn, which is what makes it explicit. Solving (4) for the single unknown uin+1u_i^{n+1} gives an update that needs no linear solve — but, as the derivations show, it pays for that with a stability leash set by the diffusion number rr.

uin+1=uin+r (ui+1n−2uin+ui−1n),r=α ΔtΔx2(5)u_i^{n+1}=u_i^n+r\,(u_{i+1}^n-2u_i^n+u_{i-1}^n),\qquad r=\frac{\alpha\,\Delta t}{\Delta x^2} \qquad (5)

where: rr — the mesh ratio or diffusion number, the only combination of α,Δt,Δx\alpha,\Delta t,\Delta x that matters for stability. Stability demands r≤12r\le\tfrac12. Evaluating the space difference at the new time level instead couples all three unknowns in one row, giving the fully implicit BTCS scheme — a tridiagonal solve per step, but stable for any rr.

−r ui−1n+1+(1+2r) uin+1−r ui+1n+1=uin(6)-r\,u_{i-1}^{n+1}+(1+2r)\,u_i^{n+1}-r\,u_{i+1}^{n+1}=u_i^n \qquad (6)

where: r=α Δt/Δx2r=\alpha\,\Delta t/\Delta x^2, now with no upper bound. The price of unconditional stability is inverting a tridiagonal matrix, which the Thomas algorithm does in O(N)\mathcal{O}(N) work. Averaging the explicit and implicit spatial operators — the trapezoidal rule in time — gives Crank–Nicolson, which keeps unconditional stability and gains second-order time accuracy.

uin+1−r2 δx2uin+1=uin+r2 δx2uin(7)u_i^{n+1}-\tfrac{r}{2}\,\delta_x^2 u_i^{n+1}=u_i^n+\tfrac{r}{2}\,\delta_x^2 u_i^n \qquad (7)

where: δx2ui=ui+1−2ui+ui−1\delta_x^2 u_i=u_{i+1}-2u_i+u_{i-1} is the central second difference. This is the default production scheme for parabolic problems, from heat transfer to option pricing. Stability of any of these is decided by one substitution: feed in a single Fourier mode and watch its per-step growth.

uin=gneikxi ⇒ g(k)=uin+1uin,stable  ⟺  ∣g(k)∣≤1  ∀k(8)u_i^n=g^n e^{\mathrm{i}k x_i}\ \Rightarrow\ g(k)=\frac{u_i^{n+1}}{u_i^n},\qquad \text{stable}\iff |g(k)|\le 1\ \ \forall k \qquad (8)

where: g(k)g(k) — the amplification factor of the mode of wavenumber kk; xi=i Δxx_i=i\,\Delta x. The whole of von Neumann analysis is: compute gg, then read off the condition ∣g∣≤1|g|\le1. For hyperbolic problems the constraint is geometric rather than diffusive — the Courant number caps how far a signal may travel per step.

ν=c ΔtΔx≤1(9)\nu=\frac{c\,\Delta t}{\Delta x}\le 1 \qquad (9)

where: cc — the physical signal (wave) speed; ν\nu — the Courant number. The numerical stencil must be able to "reach" the physical characteristic, or it cannot possibly converge.

Derivation AFrom Taylor's theorem to the central second difference

The goal is to show, with the truncation error made fully explicit, that the three-point combination (ui+1−2ui+ui−1)/h2(u_{i+1}-2u_i+u_{i-1})/h^2 is a second-order accurate stand-in for u′′u'', and to see why the accuracy is second and not first order. We expand both neighbours to high order, add them so the odd derivatives annihilate, isolate u′′u'', and identify the first surviving error term as −h212u(4)-\tfrac{h^2}{12}u^{(4)} — the number that governs how fast the stencil converges under refinement and that quietly reappears as the leading term of every modified-equation analysis.

Step 1. Write Taylor's theorem for the two neighbours about the node xx: u(x±h)=u±hu′+h22u′′±h36u′′′+h424u(4)±⋯u(x\pm h)=u\pm h u'+\tfrac{h^2}{2}u''\pm\tfrac{h^3}{6}u'''+\tfrac{h^4}{24}u^{(4)}\pm\cdots, keeping terms through fourth order and carrying the signs symbolically. Why: everything the stencil "knows" about the function is contained in these two expansions; the art is only in how we combine them.

Step 2. Add the two expansions. Every term with an odd power of hh appears once with a ++ and once with a −- and cancels, leaving u(x+h)+u(x−h)=2u+h2u′′+h412u(4)+⋯u(x+h)+u(x-h)=2u+h^2 u''+\tfrac{h^4}{12}u^{(4)}+\cdots. Why: the cancellation of odd terms is the whole mechanism — it is what makes a symmetric stencil "see" curvature cleanly without contamination from the slope or the third derivative.

Step 3. Subtract 2u2u and divide by h2h^2 to obtain u(x+h)−2u(x)+u(x−h)h2=u′′(x)+h212u(4)(x)+⋯\dfrac{u(x+h)-2u(x)+u(x-h)}{h^2}=u''(x)+\tfrac{h^2}{12}u^{(4)}(x)+\cdots. Rearranged, the stencil equals u′′u'' with an error of exactly −h212u(4)-\tfrac{h^2}{12}u^{(4)} at leading order. Why: this is consistency made quantitative — the difference operator reproduces the differential operator as h→0h\to0, and the rate is h2h^2.

Step 4. Read the consequence. Because the error scales as h2h^2, halving the grid spacing shrinks the truncation error by a factor of four; a convergence study that plots error against hh on log axes should show a slope of 22. Why: the exponent pp in O(hp)\mathcal{O}(h^p) is the single most useful number about a scheme, and Taylor's theorem hands it to us before we run a single grid. *As a concrete check: applied to u=x4u=x^4 at x=0x=0 with h=0.1h=0.1, the stencil returns 2h2/h2=0.022h^2/h^2=0.02 against the exact u′′=0u''=0, matching the predicted error h212⋅24=2h2=0.02\tfrac{h^2}{12}\cdot24=2h^2=0.02 exactly.*

Go deeper · Derivation B · 1 minVon Neumann stability of the explicit heat scheme
Derivation BVon Neumann stability of the explicit heat scheme

The aim is to derive the famous r≤12r\le\tfrac12 ceiling on the explicit FTCS scheme by the method that dominates the whole field — insert one Fourier mode, extract its amplification factor, and demand the factor never exceed one in magnitude. This turns a question about the growth of arbitrary errors into a short trigonometric calculation, and it exposes the deep fact that the shortest representable wave, not the smoothest, is the one that dictates the time step.

Step 1. Substitute the separable grid mode uin=gneikxiu_i^n=g^n e^{\mathrm{i}kx_i} with xi=i Δxx_i=i\,\Delta x into the explicit update uin+1=uin+r δx2uinu_i^{n+1}=u_i^n+r\,\delta_x^2 u_i^n, giving gn+1eikxi=gneikxi[1+r(eikΔx−2+e−ikΔx)]g^{n+1}e^{\mathrm{i}kx_i}=g^n e^{\mathrm{i}kx_i}\big[1+r(e^{\mathrm{i}k\Delta x}-2+e^{-\mathrm{i}k\Delta x})\big]. Why: the scheme is linear and constant-coefficient, so Fourier modes are its eigenfunctions — each evolves independently by a scalar factor gg, and superposition handles any initial error.

Step 2. Cancel the common gneikxig^n e^{\mathrm{i}kx_i} and collapse the exponentials with eiθ+e−iθ=2cos⁡θe^{\mathrm{i}\theta}+e^{-\mathrm{i}\theta}=2\cos\theta, so g=1+2r(cos⁡kΔx−1)g=1+2r(\cos k\Delta x-1). Why: the whole per-step behaviour of the mode has been reduced to one real number g(k)g(k), because for this scheme gg turns out to be purely real.

Step 3. Apply the half-angle identity 1−cos⁡θ=2sin⁡2(θ/2)1-\cos\theta=2\sin^2(\theta/2) to get the clean form g=1−4rsin⁡2 ⁣(kΔx2)g=1-4r\sin^2\!\big(\tfrac{k\Delta x}{2}\big). Why: written this way the dependence on the mode is isolated in a single factor sin⁡2(kΔx/2)\sin^2(k\Delta x/2) that ranges over [0,1][0,1], so we can immediately find the worst case.

Step 4. Impose ∣g∣≤1|g|\le1, i.e. −1≤1−4rsin⁡2(⋅)≤1-1\le 1-4r\sin^2(\cdot)\le 1. The right inequality holds for every r>0r>0; the left requires 4rsin⁡2(⋅)≤24r\sin^2(\cdot)\le2 for all kk. The most dangerous mode is the shortest one, kΔx=πk\Delta x=\pi, where sin⁡2=1\sin^2=1, giving 4r≤24r\le2, hence r=α ΔtΔx2≤12r=\dfrac{\alpha\,\Delta t}{\Delta x^2}\le\dfrac12. Why: stability is a statement about the worst mode, and here the sawtooth at the grid Nyquist limit is it — the one you would least expect to care about sets the entire time step. *As a concrete illustration: at r=1r=1 the Nyquist mode has g=1−4=−3g=1-4=-3, so ∣g∣=3|g|=3; ten steps amplify it by 310=59 0493^{10}=59\,049 — the exponential blow-up that makes the instability immediately visible.*

Go deeper · Derivation C · 2 minThe CFL condition from the domain of dependence
Derivation CThe CFL condition from the domain of dependence

The purpose here is to explain, for the advection equation ut+c ux=0u_t+c\,u_x=0, why an explicit scheme cannot converge unless its numerical domain of dependence swallows the physical one — a purely geometric argument that yields the Courant–Friedrichs–Lewy bound ν≤1\nu\le1 without any Fourier algebra at all. The idea is due to the 1928 paper that founded the whole discipline, and it captures a necessary condition that no amount of cleverness in the stencil weights can evade.

Step 1. Recall the exact solution: u(x,t)=u0(x−ct)u(x,t)=u_0(x-ct) is constant along the characteristics x−ct=constx-ct=\text{const}, so the value at (x,t)(x,t) depends on the initial data at the single point x−ctx-ct, the foot of the characteristic through (x,t)(x,t). Why: this is the physical domain of dependence — the exact answer is determined by exactly one point of the initial line.

Step 2. Track information through an explicit three-point stencil. After nn steps a node can only have been influenced by initial nodes within ±n\pm n cells, that is within ±n Δx\pm n\,\Delta x of its position, over an elapsed time n Δtn\,\Delta t. Why: each step, the stencil reaches one cell left and right, so the numerical domain of dependence is a discrete cone widening at the fixed rate Δx/Δt\Delta x/\Delta t.

Step 3. Demand containment. The scheme can converge to the true solution only if the physical characteristic foot lies inside the numerical cone: ∣c nΔt∣≤n Δx|c\,n\Delta t|\le n\,\Delta x, which cancels to c ΔtΔx≤1\dfrac{c\,\Delta t}{\Delta x}\le1. Why: if the exact answer depends on data the scheme literally never looks at, refining the grid cannot help — the numbers converge, if at all, to the wrong thing.

Step 4. Interpret the bound. ν=c Δt/Δx≤1\nu=c\,\Delta t/\Delta x\le1 says a signal may cross at most one cell per step. Unlike the parabolic r≤12r\le\tfrac12, this scales as Δt∼Δx\Delta t\sim\Delta x, a far gentler penalty under refinement, and at ν=1\nu=1 exactly the 1D scheme becomes perfect. Why: CFL is a necessary condition for any explicit hyperbolic scheme; von Neumann analysis of a specific scheme (upwind, leapfrog) then confirms whether it is also sufficient. *For the 1D leapfrog wave scheme, ν=1\nu=1 gives zero numerical dispersion — the "magic time step" — while ν>1\nu>1 diverges, exactly as the cone argument predicts.*

Limiting cases

How the stencils and their stability constraints behave in the characteristic regimes:

CaseResultMeaning
Grid refinement h→0h\to0τtrunc=O(hp)→0\tau_{\text{trunc}}=\mathcal{O}(h^p)\to0Consistency: the truncation error vanishes at the scheme's order pp. But work grows and rounding error eventually dominates, setting a practical optimal hh — you cannot refine forever.
Explicit parabolicr=α ΔtΔx2≤12r=\dfrac{\alpha\,\Delta t}{\Delta x^2}\le\tfrac12FTCS is stable only below this ratio; halving Δx\Delta x forces a fourfold cut in Δt\Delta t — the punishing diffusion time-step penalty.
Hyperbolic CFLν=c ΔtΔx≤1\nu=\dfrac{c\,\Delta t}{\Delta x}\le1The numerical domain of dependence must contain the physical characteristic cone; the penalty scales only linearly, Δt∼Δx\Delta t\sim\Delta x.
Implicit (Crank–Nicolson)∣g(k)∣≤1  ∀ k,Δt|g(k)|\le1\ \ \forall\,k,\Delta tUnconditionally stable — no step-size cap — at the cost of a tridiagonal solve each step. Second order in both space and time.
Magic time step ν=1\nu=1zero numerical dispersion (1D)The leapfrog wave scheme reproduces d'Alembert propagation exactly; every Fourier mode travels at the right speed. A 1D-only miracle.

Worked examples

1 · The stability budget of an explicit heat solve (fully worked)

A metal bar has thermal diffusivity α=1.0×10−4 m2/s\alpha=1.0\times10^{-4}\ \mathrm{m^2/s}. You discretize ut=αuxxu_t=\alpha u_{xx} with FTCS on a grid of spacing Δx=5 mm\Delta x=5\ \mathrm{mm}. What is the largest stable time step, what happens to a hot node in one step at r=14,12,1r=\tfrac14,\tfrac12,1, and how does the budget change if you refine to Δx=2.5 mm\Delta x=2.5\ \mathrm{mm}?

Step 1. Stability requires r=α Δt/Δx2≤12r=\alpha\,\Delta t/\Delta x^2\le\tfrac12, so Δt≤Δx22α=(5×10−3)22×10−4=2.5×10−52×10−4=0.125 s\Delta t\le\dfrac{\Delta x^2}{2\alpha}=\dfrac{(5\times10^{-3})^2}{2\times10^{-4}}=\dfrac{2.5\times10^{-5}}{2\times10^{-4}}=\mathbf{0.125\ s}. Any larger step and the scheme diverges no matter how accurate the stencil.

Step 2. Take a node sitting at 100100 between two cold neighbours at 00: the update is uin+1=100+r(0−200+0)=100−200ru_i^{n+1}=100+r(0-200+0)=100-200r. At r=14r=\tfrac14 it becomes 100−50=50100-50=\mathbf{50} (a physical, smoothing half-step); at r=12r=\tfrac12 it becomes 100−100=0100-100=\mathbf{0} (the node fully empties in one step — the stability edge); at r=1r=1 it becomes 100−200=−100100-200=\mathbf{-100}, an unphysical overshoot to negative temperature that is the visible face of instability.

Step 3. Confirm with the amplification factor. At r=1r=1 the Nyquist mode (kΔx=πk\Delta x=\pi) has g=1−4(1)(1)=−3g=1-4(1)(1)=-3, so ∣g∣=3|g|=3; after ten steps a rounding-level ripple is amplified by 310=59 0493^{10}=\mathbf{59\,049}. At r=12r=\tfrac12, g=1−2=−1g=1-2=-1: the mode neither grows nor decays — marginal stability.

Step 4. Refine the space step to Δx=2.5 mm\Delta x=2.5\ \mathrm{mm}. The budget falls to Δt≤(2.5×10−3)22×10−4=0.03125 s\Delta t\le\dfrac{(2.5\times10^{-3})^2}{2\times10^{-4}}=\mathbf{0.03125\ s} — a factor of four smaller for a factor of two in Δx\Delta x. Halving the mesh quadruples the number of time steps and doubles the spatial nodes, so an explicit heat solve costs roughly 8×8\times more work per refinement level. This Δt∼Δx2\Delta t\sim\Delta x^2 penalty is exactly why implicit schemes exist.

2 · Laplace's equation on a small grid by hand

Solve ∇2u=0\nabla^2 u=0 on the unit square with the top edge held at 100100 and the other three edges at 00, using a coarse grid with a 2×22\times2 block of interior nodes. Get the exact nodal values, then watch Gauss–Seidel iteration converge to them.

Step 1. The five-point stencil at each interior node says 4ucentre=∑(4 neighbours)4u_{\text{centre}}=\sum(\text{4 neighbours}) — every interior value is the average of its four neighbours. Label the interior nodes u1,u2u_1,u_2 (top row, adjacent to the hot edge) and u3,u4u_3,u_4 (bottom row). Left–right symmetry gives u1=u2u_1=u_2 and u3=u4u_3=u_4.

Step 2. Write the two independent equations. Top node: 4u1=100+0+u2+u3=100+u1+u34u_1=100+0+u_2+u_3=100+u_1+u_3, so 3u1−u3=1003u_1-u_3=100. Bottom node: 4u3=0+0+u4+u1=u3+u14u_3=0+0+u_4+u_1=u_3+u_1, so u1=3u3u_1=3u_3. Substitute: 3(3u3)−u3=8u3=1003(3u_3)-u_3=8u_3=100, giving u3=12.5u_3=\mathbf{12.5} and u1=37.5u_1=\mathbf{37.5}. The nodes nearer the hot wall are hotter, as they must be.

Step 3. Now solve the same system iteratively, as one must for large grids where direct inversion is too costly. Gauss–Seidel sweeps the four nodes in order, each time overwriting a node with the average of its current neighbours. Starting from all zeros, the natural-order sweeps give: sweep 1 → (25, 31.25, 6.25, 9.375)(25,\ 31.25,\ 6.25,\ 9.375); sweep 2 → (34.4, 35.9, 10.9, 11.7)(34.4,\ 35.9,\ 10.9,\ 11.7); sweep 3 → (36.7, 37.1, 12.1, 12.3)(36.7,\ 37.1,\ 12.1,\ 12.3); sweep 4 → (37.3, 37.4, 12.4, 12.5)(37.3,\ 37.4,\ 12.4,\ 12.5).

Step 4. The iterates march steadily toward the exact (37.5, 37.5, 12.5, 12.5)(37.5,\ 37.5,\ 12.5,\ 12.5), gaining roughly one correct digit every few sweeps. On a real grid this same relaxation — accelerated by successive over-relaxation (SOR) or wrapped in a multigrid cycle — is how sparse Laplace and Poisson systems with millions of unknowns are actually solved. Exact: top nodes 37.5, bottom nodes 12.5; Gauss–Seidel reaches them from zero without ever forming the matrix.

Physics of the portrait

Finite differences are as old as the calculus, but the method became a science — with a theory of when it may be trusted — in the middle of the twentieth century, driven by the twin engines of the Manhattan Project and the first electronic computers. No one embodies that transformation more completely than the mathematician whose name is now attached to the stability test at the heart of this article.

Origins · 1 minJohn von Neumann and how this was discovered
JV
John von Neumann
1903–1957 · numerical stability analysis and the birth of scientific computing

Von Neumann was the rarest kind of mathematician — one who reshaped pure fields (set theory, operator algebras, the axioms of quantum mechanics, game theory) and then turned the same intellect on the most concrete engineering problems of his age. During the Second World War, computing shock waves and implosion hydrodynamics for the atomic-bomb project at Los Alamos, he confronted the practical menace that a finite difference scheme could dissolve into meaningless oscillation for no visible reason. His response was the Fourier-mode stability analysis this article uses throughout: decompose the numerical error into grid waves, track the amplification factor of each, and demand that none grow. The method was so effective and so simple that it spread by word of mouth before it was ever properly published — it appears in the 1951 paper of O'Brien, Hyman and Kaplan and is credited to him throughout. Von Neumann was simultaneously midwifing the stored-program computer (the "von Neumann architecture") and, with Charney and Fjørtoft, ran the first numerical weather forecast on ENIAC in 1950 — a finite difference integration of the atmosphere that took nearly 24 hours of computing to predict 24 hours of weather. He did not live to see how completely his stability criterion would come to govern the numerical solution of every evolution equation; he died of cancer in 1957 at fifty-three. The theory was completed by others — Peter Lax and Robert Richtmyer proved in 1956 that consistency and stability are together equivalent to convergence — but the working tool, the one an engineer reaches for to check a new scheme, is still von Neumann's single Fourier mode.

History
1928
— Courant, Friedrichs and Lewy publish the founding paper on partial difference equations and the CFL condition
1947
— Crank and Nicolson introduce their unconditionally stable, second-order implicit scheme
1950
— Charney, Fjørtoft and von Neumann run the first numerical weather forecast on ENIAC
1951
— O'Brien, Hyman and Kaplan publish von Neumann's Fourier stability analysis
1956
— Lax and Richtmyer prove that consistency plus stability is equivalent to convergence

Going further

Texts. G. D. Smith, Numerical Solution of Partial Differential Equations: Finite Difference Methods, 3rd ed. (the classic student text on stability and consistency) · R. D. Richtmyer & K. W. Morton, Difference Methods for Initial-Value Problems (the rigorous reference for Lax equivalence and von Neumann analysis) · J. C. Strikwerda, Finite Difference Schemes and Partial Differential Equations · R. J. LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations · Stone & Goldbart, Mathematics for Physics, and Arfken & Weber, Mathematical Methods for Physicists (the numerical-PDE chapters set in a physics context). Every difference stencil and its truncation order follows directly from Taylor's theorem. The key amplification factors are: g=1−4rsin⁡2(kΔx/2)g=1-4r\sin^2(k\Delta x/2) for FTCS with worst case r≤12r\le\tfrac12; g=(1−2rs)/(1+2rs)g=(1-2rs)/(1+2rs) with ∣g∣≤1|g|\le1 always for Crank–Nicolson; and the domain-of-dependence bound ν≤1\nu\le1 for the explicit advection stencil. The Laplace worked example yields exact nodal values 37.537.5 and 12.512.5, approached by the Gauss–Seidel iterates shown above.

Prerequisites. Taylor's theorem with remainder · Order Symbols and Gauge Functions · Linear algebra of sparse systems · Fourier series and modes. Leads to. Asymptotic Series and Poincaré Expansions · Finite Element Methods · Spectral methods.

Ask the tutor: Ask me to von-Neumann-analyse any scheme you like — hand me its update rule and I'll extract the amplification factor and tell you exactly when it blows up.

Is a finite difference scheme just "replacing derivatives by slopes"?

That is the right first picture, but the substance is which slopes and at what cost. Replacing u′′u'' by (ui+1−2ui+ui−1)/h2(u_{i+1}-2u_i+u_{i-1})/h^2 is the easy half; the hard half is that the discrete problem has its own personality. It has a truncation error you must control (consistency), it can amplify tiny errors into garbage (stability), and only when both are handled does it approximate the true solution (convergence). The Lax equivalence theorem is what ties these together. So "replace derivatives by slopes" is the recipe, but "consistency plus stability equals convergence" is the theory that tells you when the recipe is safe to eat.

Why does refining the grid sometimes make the answer worse?

Because refinement helps only if the scheme is stable. Truncation error does fall as you shrink hh — that is consistency — but an unstable scheme amplifies errors geometrically each step, and refining a time-marching scheme usually forces more steps, giving instability more chances to act. The explicit heat equation is the classic trap: if you halve Δx\Delta x but keep Δt\Delta t fixed, the diffusion number r=α Δt/Δx2r=\alpha\,\Delta t/\Delta x^2 quadruples, and once it crosses 12\tfrac12 the grid-scale mode blows up. The fix is to respect the stability limit (shrink Δt\Delta t as Δx2\Delta x^2) or switch to an unconditionally stable implicit scheme like Crank–Nicolson.

What is the difference between explicit and implicit schemes, really?

An explicit scheme computes each new value from values already known, so one update is a cheap arithmetic formula with no system to solve — but stability leashes the time step (the r≤12r\le\tfrac12 or CFL limits). An implicit scheme couples the unknowns at the new time level, so each step is a linear solve — for 1D problems a tridiagonal one, cheap by the Thomas algorithm — but in exchange you often win unconditional stability and can take much larger steps. The trade is per-step cost against step-size freedom. For stiff problems (small diffusion length, fine grids) implicit wins decisively; for wave problems where you want small steps anyway, explicit schemes like leapfrog and FDTD are usually preferred.

How does von Neumann analysis actually prove stability?

It exploits that a linear, constant-coefficient scheme treats Fourier modes as independent eigenfunctions. You insert a single mode uin=gneikxiu_i^n=g^n e^{\mathrm{i}kx_i}, and the update collapses to a scalar relation un+1=g(k) unu^{n+1}=g(k)\,u^n, where g(k)g(k) — the amplification factor — is pure trigonometry in kΔxk\Delta x. Any initial error is a superposition of such modes, each multiplied by its own gg every step, so the error stays bounded exactly when ∣g(k)∣≤1|g(k)|\le1 for every kk. The method is a necessary and sufficient stability test for these problems and reduces to finding the worst-case mode — often the grid-Nyquist sawtooth kΔx=πk\Delta x=\pi. Its main limitation is that it assumes constant coefficients and periodic (or infinite) domains; boundaries and variable coefficients need more care.

Why is Crank–Nicolson usually preferred over the fully implicit BTCS scheme?

Both are unconditionally stable, so stability is not the discriminator — accuracy is. BTCS evaluates the spatial operator entirely at the new time level and is only first order in time, so its errors scale as Δt\Delta t. Crank–Nicolson averages the spatial operator over the old and new levels (the trapezoidal rule in time), which centres the time derivative and makes the scheme second order in both time and space, with errors scaling as Δt2\Delta t^2. Since the per-step cost is identical — a tridiagonal solve either way — Crank–Nicolson gives far more accuracy for the same work, or equal accuracy at much larger steps. The one caveat: BTCS damps grid-scale oscillations more aggressively, so for very rough initial data Crank–Nicolson can ring, which is sometimes cured by a few damped BTCS start-up steps (Rannacher smoothing).

Do finite differences still matter now that finite elements and spectral methods exist?

Very much so. Finite elements shine on complicated geometries and unstructured meshes; spectral methods give exponential accuracy for smooth solutions on simple domains. But finite differences own the middle: structured grids, simple domains, and problems where raw throughput matters. Their stencils map perfectly onto the regular memory access patterns that GPUs and vector units love, so FDTD electromagnetics, seismic imaging, and weather cores remain finite-difference for performance reasons. They are also the easiest schemes to reason about — the entire consistency-and-stability theory in this article is elementary — which makes them the natural teaching vehicle and the first thing to try. The methods are complements, not competitors, and most large simulation codes mix them.

Before this

Where this leads