The finite-difference method is a family of techniques in numerical analysis for approximating derivatives and solving differential equations. It replaces continuous differential operators with weighted differences between values at discrete points, usually arranged on a computational grid. The resulting equations determine numerical approximations to the unknown function at those points. Finite differences are used for both ordinary and partial differential equations, including problems involving diffusion, transport, waves, and equilibrium fields. (damtp.cam.ac.uk)
Basic construction
Let be a sufficiently smooth function sampled on a uniform grid,
where is the grid spacing. Write for either the exact sample or, when solving an equation, its numerical approximation. The simplest approximations to the first derivative are
Forward and backward differences have first-order truncation error, ; the central difference has second-order error, . Here big-O notation describes how the error scales as tends to zero, under suitable smoothness assumptions. (damtp.cam.ac.uk)
These formulas follow from Taylor expansions. For example,
Subtracting the expansions cancels the even-power terms and yields the central first difference. Adding them gives the standard second-derivative approximation,
Thus, symmetry can eliminate leading error terms without requiring additional function evaluations. (tsapps.nist.gov)
The set of points and coefficients used in a difference formula is called a stencil. More general formulas take the form
where the weights depend on the derivative order, evaluation point, and node locations. Formulas need not use equally spaced nodes. Bengt Fornberg’s 1988 algorithm provides recursive procedures for generating weights for arbitrary one-dimensional node distributions and derivative orders. (ams.org)
Discretizing boundary-value problems
For a boundary-value problem, finite differences replace the differential equation at interior grid points, while separate equations impose the boundary data. Consider
with prescribed endpoint values. On a uniform grid, the interior equations become
After incorporating the endpoint values into the right-hand side, these equations form a linear system . Each row couples only neighboring unknowns, so is a tridiagonal sparse matrix. (ocw.mit.edu)
In two dimensions, the standard approximation to the Laplacian on a square grid is
This five-point stencil is second-order accurate for smooth functions. Applied to Poisson’s equation, , it produces a sparse system whose coefficients reflect the grid connectivity and boundary conditions. (dlmf.nist.gov)
Boundary treatment is part of the numerical method, not merely an implementation detail. Dirichlet conditions prescribe function values; Neumann conditions prescribe normal derivatives; and Robin conditions prescribe combinations of the two. One-sided differences or auxiliary points outside the physical domain, called ghost points, can supply equations near boundaries. Curved boundaries and interfaces may require modified stencils or extensions of the solution; these constructions must preserve the intended accuracy and stability. (arxiv.org)
Time-dependent equations
A time-dependent problem can be discretized in space and time simultaneously, or first in space alone. The latter approach, known as the method of lines, turns a partial differential equation into a system of ordinary differential equations, to which a time-integration method is applied. (damtp.cam.ac.uk)
For the one-dimensional heat equation,
let approximate , with , and define
A forward time difference and centered spatial difference give
This explicit scheme computes the next time level directly from known values. For the standard uniform-grid problem, it is stable when . Its truncation error is . Consequently, refining the spatial grid requires a time step proportional to or smaller. (damtp.cam.ac.uk)
A backward time difference instead produces the implicit scheme
It requires solving a coupled system at each time step. For this linear diffusion problem, backward Euler is unconditionally stable: stability does not impose an upper bound on . Accuracy still restricts useful time-step sizes. (damtp.cam.ac.uk)
The Crank–Nicolson method averages the spatial operator at the old and new time levels:
For smooth solutions, it is second-order accurate in both time and space and unconditionally stable for the standard linear heat equation. Nevertheless, stability does not ensure strong damping: its amplification factor approaches for sufficiently stiff spatial modes, so large time steps can produce slowly damped, alternating numerical components. (math.mit.edu)
Consistency, stability, and convergence
Three properties organize the analysis of a difference scheme:
- Consistency: substituting a smooth exact solution into the discrete equations leaves a residual that tends to zero under refinement.
- Stability: perturbations in the discrete data or intermediate computation remain controlled, with bounds uniform over the relevant refinements.
- Convergence: the numerical solution approaches the exact solution, in a specified norm, as the discretization is refined.
The Lax–Richtmyer equivalence theorem connects these properties: for a consistent linear approximation to a well-posed linear initial-value problem, stability is equivalent to convergence, under the theorem’s assumptions. It is not a blanket guarantee for nonlinear equations or arbitrary boundary treatments. (epubs.siam.org)
Von Neumann analysis studies how a scheme amplifies individual Fourier modes. For the explicit heat scheme, substitution of
gives
Requiring for every frequency yields . This analysis is especially useful for constant-coefficient problems on infinite or periodic grids; physical boundaries require additional attention. (math.mit.edu)
For propagation problems, the Courant–Friedrichs–Lewy condition relates the numerical domain of dependence to that of the differential equation. For example, the standard centered scheme for has the stability restriction
A CFL restriction is scheme-dependent, and satisfying a domain-of-dependence condition alone does not establish every other requirement for stability or convergence. (damtp.cam.ac.uk)
Accuracy and numerical limitations
The formal order of a stencil concerns smooth functions and local approximation error. The observed error in a computed solution also depends on boundary discretization, regularity, time integration, and the accuracy of the algebraic solver. A high-order interior stencil therefore does not, by itself, establish high-order convergence of the complete method. (epubs.siam.org)
Refinement also encounters limits from floating-point arithmetic. Numerical differentiation subtracts nearby function values and divides by a small spacing, which can magnify cancellation and evaluation errors. For a first-derivative formula of order , a simplified error model is
where represents a floating-point error scale. The model explains why decreasing indefinitely need not improve the derivative estimate. (tsapps.nist.gov)
Transport equations introduce additional difficulties. Upwind differences incorporate the direction of propagation but can introduce artificial diffusion; other schemes can introduce phase errors or oscillations. When solutions contain shocks or steep fronts, smooth-solution error estimates are insufficient, and specialized flux formulations, limiters, or nonlinear reconstructions may be required. (damtp.cam.ac.uk)
Applications and relation to other methods
Finite differences are used to approximate equations describing diffusion, wave propagation, fluid flow, and electromagnetic fields. Their local stencils are particularly convenient on structured grids. In image processing, differences approximate image gradients, while discrete Poisson equations reconstruct images from prescribed or modified gradient fields. (math.mit.edu)
Finite differences are distinguished from the finite-element method, which typically approximates a weak or variational formulation using functions defined over mesh elements, and the finite-volume method, which balances fluxes over control volumes. These distinctions concern the derivation and interpretation of the discretization: on simple grids, different approaches can produce identical or closely related algebraic equations. Finite-volume formulations make local conservation explicit, whereas a finite-difference scheme must be constructed appropriately to retain that property. (math.mit.edu)
Historical development
A major foundation of finite-difference theory was the 1928 paper by Richard Courant, Kurt Friedrichs, and Hans Lewy on partial difference equations in mathematical physics. It investigated discrete approximations to differential equations and established the domain-of-dependence principle associated with the CFL condition. Later developments linked consistency, stability, and convergence through the Lax–Richtmyer framework and extended difference formulas to higher orders and nonuniform grids; Fornberg’s 1988 work provided a systematic algorithm for generating differentiation weights. (web.stanford.edu)
References
- Course 18.336: Numerical Methods for Partial Differential Equationsmath.mit.edu
- DLMF: §3.4 Differentiationdlmf.nist.gov
- Numerical Differentiationtsapps.nist.gov
- Generation of Finite Difference Formulas on Arbitrarily Spaced Gridsams.org
- Finite Differences and Fast Poisson Solversocw.mit.edu
- A Finite Difference Ghost-Cell Multigrid Approach for Poisson Equation with Mixed Boundary Conditions in Arbitrary Domainarxiv.org
- High-Order Finite-Difference Discretization for Elliptic Problems on Complex Domainsmath.mit.edu
- The Heat Equation and Convection-Diffusionmath.mit.edu