Skip to main content

Derive forward, backward, central differences

Short answer

From Taylor series: forward difference (f_{i+1}−f_i)/h, truncation error O(h); backward (f_i−f_{i-1})/h, O(h); central (f_{i+1}−f_{i-1})/(2h), O(h²). Halving h halves error for first order, quarters for second order.

Using Taylor series expansion, derive the forward, backward and central difference approximations for the first derivative df/dxdf/dx and state the truncation error and order of accuracy of each.

The finite difference method (FDM) replaces derivatives by algebraic differences of function values at grid points, spaced h=Δxh=\Delta x apart. The basis is the Taylor series.

Taylor expansions about xix_i

fi+1=fi+hfi′+h22!fi′′+h33!fi′′′+⋯f_{i+1}=f_i+h f'_i+\frac{h^2}{2!}f''_i+\frac{h^3}{3!}f'''_i+\cdots fi−1=fi−hfi′+h22!fi′′−h33!fi′′′+⋯f_{i-1}=f_i-h f'_i+\frac{h^2}{2!}f''_i-\frac{h^3}{3!}f'''_i+\cdots

Forward difference

Rearrange the first series for fi′f'_i:

fi′=fi+1−fih−h2fi′′−h26fi′′′−⋯f'_i=\frac{f_{i+1}-f_i}{h}-\frac h2f''_i-\frac{h^2}{6}f'''_i-\cdots fi′≈fi+1−fih,error=−h2fi′′=O(h)\boxed{f'_i\approx\frac{f_{i+1}-f_i}{h}},\qquad \text{error}=-\frac h2f''_i=O(h)

Backward difference

Rearrange the second series:

fi′=fi−fi−1h+h2fi′′−⋯f'_i=\frac{f_i-f_{i-1}}{h}+\frac h2f''_i-\cdots fi′≈fi−fi−1h,error=+h2fi′′=O(h)\boxed{f'_i\approx\frac{f_i-f_{i-1}}{h}},\qquad \text{error}=+\frac h2f''_i=O(h)

Central difference

Subtract the second series from the first; the even-order terms cancel:

fi+1−fi−1=2hfi′+h33fi′′′+⋯f_{i+1}-f_{i-1}=2hf'_i+\frac{h^3}{3}f'''_i+\cdots fi′≈fi+1−fi−12h,error=−h26fi′′′=O(h2)\boxed{f'_i\approx\frac{f_{i+1}-f_{i-1}}{2h}},\qquad \text{error}=-\frac{h^2}{6}f'''_i=O(h^2)

Summary

SchemeFormulaTruncation errorOrder
Forward(fi+1−fi)/h(f_{i+1}-f_i)/h−h2f′′-\tfrac h2f''1st
Backward(fi−fi−1)/h(f_i-f_{i-1})/h+h2f′′+\tfrac h2f''1st
Central(fi+1−fi−1)/2h(f_{i+1}-f_{i-1})/2h−h26f′′′-\tfrac{h^2}{6}f'''2nd

Halving hh halves the error of the first-order schemes but reduces the central-difference error to one quarter. Forward and backward differences are used at boundaries and in upwind schemes, where only one side is available.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Applied Computational Fluid Dynamics chapter 3 questions →