Every numerical derivative is an approximation. The gap between the numerical result and the true derivative is the truncation error, arising because the limiting process h→0 is replaced by a finite step. By deriving the difference formulas from Taylor or Lagrange series, we can find an explicit expression for this error and compute a bound on its magnitude.
Error Orders
The three difference formulas have different error characteristics:
Method
Error Order
Leading Error Term
Effect of dividing h by 10
Forward Difference
O(h)
2f′′(ξ)h
Error is divided by 10
Backward Difference
O(h)
2f′′(ξ)h
Error is divided by 10
Central Difference
O(h2)
6f′′′(ξ)h2
Error is divided by 100
For central difference, because the error scales as h2, it shrinks much faster as h decreases. Dividing h by 10 divides the central difference error by 100, whereas the forward and backward errors only halve proportionally with h.
Proof: Forward Difference Truncation Error
We derive the forward difference formula and its error term using Lagrange interpolation over two nodes: x0 and x1=x0+h.
Setting up the interpolant. Any function f(x) can be written as a first-degree Lagrange polynomial plus an error term:
This confirms two things: the forward difference formula is an exact rearrangement of this identity, and the truncation error is the term −2f′′(ξ)h, which is proportional to h. Making h smaller reduces this error linearly.
Proof: Backward Difference Truncation Error
We can derive the backward difference formula and its error term using Lagrange interpolation over two nodes: x0 and x−1=x0−h.
Setting up the interpolant. Just like the forward difference, f(x) can be written as a first-degree Lagrange polynomial plus an error term:
The truncation error is proportional to h, confirming that backward difference is also an O(h) approximation.
Further Reading: Proof of Central Difference Truncation Error
Proof: Central Difference Truncation Error
For the central difference formula, using Taylor series expansions is usually the clearest approach because it naturally reveals how the symmetric terms cancel out.
Setting up the Taylor series. We expand f(x) around x0 to the third degree, evaluating at x0+h and x0−h:
Notice how the f(x0) and 2h2f′′(x0) terms completely cancel out.
Consolidating the error term. This step relies on the Intermediate Value Theorem. Think of it like taking an average: 2f′′′(ξ1)+f′′′(ξ2). Because we assume f′′′(x) is a continuous function, it must pass through this exact average value at some specific point ξ somewhere between our two outer nodes (x0−h and x0+h).
Mathematically, this means 2f′′′(ξ1)+f′′′(ξ2)=f′′′(ξ), which rearranges to f′′′(ξ1)+f′′′(ξ2)=2f′′′(ξ). This allows us to combine the two separate error evaluations into one:
Because the h2 terms in the Taylor series perfectly cancelled each other out, the leading error term contains h2. This proves that the central difference method provides an O(h2) approximation.
Worked Example: Comparing Error Orders
Problem: Approximate the derivative of f(x)=ln(x) at x=2 using the forward, backward, and central difference formulas with step sizes h=0.1,0.01,0.001. Compare the errors with the exact derivative.
Its error decreases by approximately a factor of 100 whenever h is divided by 10.
Worked Example: Upper Bound on Truncation Error
Problem: For f(x)=2sin(x)+(3/2)cos(2x) with step size h=0.1 over the interval (0.4,1.2), compute the upper bound on the central difference truncation error.
The central difference truncation error bound is:
6h2⋅f′′′(x)
To find the upper bound, we need to maximise ∣f′′′(x)∣ over (0.4,1.2), then multiply by h2/6.
Step 1 — Compute f′′′(x)
Starting from:
f(x)=2sin(x)+23cos(2x)
f′(x)=2cos(x)−3sin(2x)
f′′(x)=−2sin(x)−6cos(2x)
f′′′(x)=−2cos(x)+12sin(2x)
Step 2 — Bound ∣f′′′(x)∣ using the triangle inequality