11—Numerical Analysis 321
As usual, the geometric approach doesn’t indicate the size of the error, so it’s back to Taylor’s series.
Given data at pointsx= 0,±h,± 2 h,.... I want the derivativef′(0).
f(h) =f(0) +hf′(0) +
1
2
h^2 f′′(0) +
1
6
h^3 f′′′(0) +···
f(−h) =f(0)−hf′(0) +
1
2
h^2 f′′(0)−
1
6
h^3 f′′′(0) +···
In order to isolate the term inf′(0), it’s necessary to eliminate the larger termf(0), so subtract:
f(h)−f(−h) = 2hf′(0) +
1
3
h^3 f′′′(0) +···,
giving f′(0)≈
1
2 h
[
f(h)−f(−h)
]
−
{ 1
6
h^2 f′′′(0)
} (8)
and the last term, in braces, estimates the error in the straight line approximation.
The most obvious point about this error term is that it varies ash^2 , and so indicates by how much the
error should decrease as you decrease the size of the interval. (How to estimate the factorf′′′(0)I’ll come to
presently.) This method evaluates the derivative at one of the data points; you can make it more accurate if you
evaluate it between the points, so that the distance from where the derivative is being taken to where the data
is available is smaller. As before, leth= 2k, then
1
2 k
[
f(k)−f(−k)
]
=f′(0) +
1
6
k^2 f′′′(0) +···,
or, in terms ofhwith a shifted origin,
1
h
[
f(h)−f(0)
]
≈f′(h/2) +
1
24
h^2 f′′′
(h
2
)
, (9)
and the error is only 1/4 as big.
As with interpolation methods, you can gain accuracy by going to higher order in the Taylor series,
f(h)−f(−h) = 2hf′(0) +
1
3
h^3 f′′′(0) +
1
60
h^5 fv(0) +···
f(2h)−f(− 2 h) = 4hf′(0) +
8
3
h^3 f′′′(0) +
32
60
h^5 fv(0) +···.