Last modified: May 24, 2025
This article is written in: 🇺🇸
The central‐difference method is a finite‐difference scheme for estimating derivatives that combines forward and backward differences via Taylor‐series expansions. By evaluating the function at points symmetrically placed around the target, it cancels out many of the lower‐order error terms, yielding a more accurate approximation than one‐sided methods. This balanced approach is especially useful in numerical analysis and computational applications where closed‐form derivatives are unavailable or costly to compute.
The central difference approximation of the first derivative of a function $f$ at a point $x$ with step size $h$ is given by:
$$ f'(x) \approx \frac{f(x + h) - f(x - h)}{2h} $$
This formula is derived from the average of the forward and backward difference formulas.
Let's start with Taylor's formula. For some $\xi_1\in(x,x+h)$ and $\xi_2\in(x-h,x)$, Taylor’s theorem gives
$$ f(x+h) = f(x) + hf'(x) + \frac{h^2}{2}f''(x) + \frac{h^3}{6}f^{(3)}(\xi_1) $$
$$ f(x-h) = f(x) - hf'(x) + \frac{h^2}{2}f''(x) - \frac{h^3}{6}f^{(3)}(\xi_2) $$
The forward difference approximation is expressed as:
$$ \frac{f(x+h)-f(x)}{h} = \frac{\bigl[f(x)+h f'(x)+\tfrac{h^2}{2}f''(x)+\tfrac{h^3}{6}f^{(3)}(\xi_1)\bigr] - f(x)}{h} $$
$$ = f'(x) + \frac{h}{2}f''(x) + \frac{h^2}{6}f^{(3)}(\xi_1) $$
Thus
$$ \frac{f(x+h)-f(x)}{h} = f'(x) + \mathcal{O}(h) $$
Similarly, the backward difference approximation is:
$$ \frac{f(x)-f(x-h)}{h} = \frac{f(x) - \bigl[f(x)-h f'(x)+\tfrac{h^2}{2}f''(x)-\tfrac{h^3}{6}f^{(3)}(\xi_2)\bigr]}{h} $$
$$ = f'(x) - \frac{h}{2}f''(x) + \frac{h^2}{6}f^{(3)}(\xi_2) $$
Thus
$$ \frac{f(x)-f(x-h)}{h} = f'(x) + \mathcal{O}(h) $$
By taking the average of these two approximations, we eliminate the leading error terms, resulting in a more accurate estimate of the derivative. The Taylor series expansion is a representation of a function as an infinite sum of terms calculated from the function's derivatives at a single point. We use this expansion to improve our approximation of derivatives:
Expanding $f(x_0+h)$ and $f(x_0-h)$ in a Taylor series around $x_0$:
$$ f(x_0+h) = f(x_0) + hf'(x_0) + \frac{h^2}{2}f''(x_0) + \mathcal{O}(h^3) $$
$$ f(x_0-h) = f(x_0) - hf'(x_0) + \frac{h^2}{2}f''(x_0) + \mathcal{O}(h^3) $$
Add the two approximations and divide by 2:
$$ \frac12\biggl[\frac{f(x+h)-f(x)}{h} + \frac{f(x)-f(x-h)}{h}\biggr] $$
$$ = \frac12\Bigl[\bigl(f'(x) + \tfrac{h}{2}f''(x) + \tfrac{h^2}{6}f^{(3)}(\xi_1)\bigr) \quad + \bigl(f'(x) - \tfrac{h}{2}f''(x) + \tfrac{h^2}{6}f^{(3)}(\xi_2)\bigr)\Bigr] $$
$$ = f'(x) + \frac{h^2}{12}\bigl(f^{(3)}(\xi_1)+f^{(3)}(\xi_2)\bigr) $$
Notice the $\pm\tfrac{h}{2}f''(x)$ terms cancel exactly, leaving only an $\mathcal{O}(h^2)$ remainder.
Rewriting the left side,
$$ \frac{1}{2}\Bigl(\tfrac{f(x+h)-f(x)}{h} + \tfrac{f(x)-f(x-h)}{h}\Bigr) = \frac{f(x+h)-f(x-h)}{2h} $$
Hence
$$ \frac{f(x+h)-f(x-h)}{2h} = f'(x) + \underbrace{\frac{h^2}{12}\bigl(f^{(3)}(\xi_1)+f^{(3)}(\xi_2)\bigr)}_{\displaystyle\mathcal{O}(h^2)} $$
or equivalently
$$ f'(x) = \frac{f(x+h)-f(x-h)}{2h} - \mathcal{O}(h^2) $$
Dropping the explicit remainder,
$$ \boxed{ f'(x)\approx \frac{f(x+h)-f(x-h)}{2h} } $$
which is second‐order accurate (error $\propto h^2$) because the leading $h^1$ terms have cancelled.
The error in the central difference method is of the order $O(h^2)$, which implies that the error decreases quadratically as the step size $h$ approaches zero. This quadratic rate of convergence makes the central difference method significantly more accurate than the forward or backward difference methods, which typically have an error of order $O(h)$. However, while reducing $h$ can enhance accuracy, it must be balanced against potential numerical instability and the limitations of floating-point arithmetic. Extremely small values of $h$ can lead to round-off errors, thereby limiting the practical accuracy achievable with this method.
Suppose we have a function $f(x) = x^2$, and we want to approximate the derivative at the point $x = 2$ with a step size $h = 0.01$. Using the central difference method, we get:
$$ f'(2) \approx \frac{f(2 + 0.01) - f(2 - 0.01)}{2 \times 0.01} = \frac{4.0401 - 3.9601}{0.02} = 4.00 $$
The exact derivative of $f(x) = x^2$ at the point $x = 2$ is $f'(2) = 2 \times 2 = 4$, so the approximation is accurate. This example demonstrates how the central difference method can effectively approximate derivatives with high precision, especially for smooth functions. It also highlights the method's reliance on the choice of step size $h$, which must be sufficiently small to capture the function's behavior without introducing significant numerical errors.