Centered Differences

Definition

A centered difference approximates the derivative of at using a symmetric interval , which is more accurate than a one-sided difference.

Intuition

By using points on both sides of , the odd-order error terms cancel in the Taylor expansion, giving second-order accuracy instead of the accuracy of a forward or backward difference.

Formal Description

First derivative (centered difference):

Second derivative: Applying the centered difference formula for with step and differencing again:

Finite-step approximations:

The centered difference for has error, compared to for the forward difference .

Applications

  • Numerical differentiation when only discrete function evaluations are available.
  • Finite-difference methods for solving ODEs and PDEs on a grid.
  • Gradient checking in machine learning to verify analytic gradients.

Trade-offs

  • Requires two function evaluations per point (vs. one for forward difference), which may matter when evaluations are expensive.
  • Accuracy degrades for very small due to floating-point cancellation errors; an optimal (where is machine epsilon) balances truncation and round-off error.
  • Not applicable at boundary points of a domain where one-sided values are unavailable.