Finite difference methods
- CSIR NET · advanced
- UP Assistant Professor
4 minute read · Updated 2026-11-15
Picking up from
In Runge-Kutta for first-order ODEs, we saw that Runge–Kutta advances time by combining slopes within each step. How can we replace spatial derivatives when only grid values are known?
In one line
Finite differences replace derivatives with weighted neighboring values on a grid, turning differential equations into algebra.
The idea, explained
A grid samples a function at discrete points separated by a chosen spacing. Taylor expansions around a point show how neighboring values approximate derivatives. A stencil is the pattern of grid points used in one approximation. Substituting stencils into a differential equation produces equations for unknown grid values. Boundary conditions supply the missing endpoint information. Reducing grid spacing reduces truncation error only while roundoff and stability remain controlled. For time-dependent problems, the time step and spatial spacing must often obey a joint stability restriction.
The stencil coefficients follow by expanding each neighboring value about the central point and combining the expansions. Symmetric neighbors cancel certain Taylor terms, explaining the improved error order of centered formulas. Substitution into a boundary-value equation couples neighboring unknowns into a linear system. In a time-dependent equation, an explicit update computes the new time level from old values, while an implicit update requires solving equations containing new values. The stated heat-equation stability bound belongs to one explicit scheme and one spatial dimension; it is not a universal restriction for every discretization.
Core ideas
- Forward and backward first differences are first-order accurate for smooth functions.
- A centered first difference cancels the leading odd asymmetry and is second-order accurate.
- The standard three-point second derivative is also second-order accurate on a uniform grid.
- Boundary values are part of the discrete problem; interior stencils alone do not specify a unique solution.
- Consistency means the discrete equation approaches the differential equation; stability still needs checking.
- Making the spacing extremely small can amplify roundoff because derivative stencils subtract nearby numbers and divide by a small spacing. Accuracy depends on balancing truncation and numerical precision.
- For a second-order spatial equation with fixed endpoint values, apply the interior stencil only at interior nodes and move known endpoint contributions into the right-hand side of the resulting equations.
Key formulas
Centered first- and second-derivative stencils
On a uniform grid, is the spacing and ; both centered approximations have second-order truncation error for smooth f.
Stability bound for the one-dimensional explicit heat scheme
This stability condition is specific to the one-dimensional forward-time centered-space heat scheme with positive diffusivity .
Label nodes and time levels clearly before replacing derivatives. Check each power of spacing against the derivative order, then insert the boundary or initial data. For an explicit heat update, evaluate every new interior value from the old time level before replacing any old entries. Otherwise an unintended mixture of time levels produces a different numerical scheme.
Quick worked example
For , take and . The three samples are , and . The centered second derivative is , exact for this quadratic.
Where this leads
This completes the subject’s study sequence. Return to the subject index to revisit a method before applying it.
Related: Partial differential equations (Laplace, wave and heat in 2D and 3D) — spatial modes and boundary conditions.
Related: Runge-Kutta for first-order ODEs — discrete time stepping and stability.
Related: Integration by trapezoid and Simpson's rule — both methods track errors as the grid spacing changes.
Practice this topic
Practice this topic13 questions in Assistant Professor · Physics · Physics. Sign in and practice access may be required.