Skip to content
Oakfield Operator Calculus Function Reference Site

Finite Differences

For grid spacing h>0h>0 and scalar field ff,

δh+f(x)=f(x+h)f(x)h,δhf(x)=f(x)f(xh)h,δh0f(x)=f(x+h)f(xh)2h\delta_h^{+} f(x) = \frac{f(x+h)-f(x)}{h},\qquad \delta_h^{-} f(x) = \frac{f(x)-f(x-h)}{h},\qquad \delta_h^{0} f(x) = \frac{f(x+h)-f(x-h)}{2h}

Finite differences apply to functions sampled on uniform grids in R\mathbb{R} (and componentwise on Rd\mathbb{R}^d). Outputs lie in the same value space as ff (scalar or vector valued).


Forward and backward differences are first-order accurate approximations of f(x)f'(x); the central difference is second-order accurate.

Finite differences are linear discrete operators and can be represented as convolution stencils on a uniform grid.


As h0h \to 0, all three differences converge to f(x)f'(x) for differentiable ff. Higher-order stencils extend the same idea using wider supports to raise the order of accuracy.


Gradient operators assemble directional differences; fractional derivatives generalize differentiation to non-integer order; convolution operators implement difference stencils via discrete kernels.


Oakfield implements finite-difference spatial derivatives as an operator:

  • spatial_derivative operator applies finite-difference stencils to real or complex fields (complex is component-wise), with configuration for spacing/method and optional accumulation.
  • Boundary behavior is controlled via policy options (periodic vs clamped-style handling) depending on operator configuration and context overrides.

Finite differences are among the earliest systematic numerical tools for approximating derivatives, forming a core bridge between continuous PDEs and discrete computation.

They remain standard for grid-based PDE discretizations due to simplicity, locality, and compatibility with conservative flux formulations.


  • LeVeque, Finite Difference Methods for Ordinary and Partial Differential Equations
  • Strikwerda, Finite Difference Schemes and Partial Differential Equations