Recursive difference formulas for derivatives can be obtained by canceling the truncation error at each order of numerical approximation. This method is called Richardson extrapolation. It can be used only if the data values are equally spaced with step size h. We consider first the simplest cases in this hierarchy and then construct the general algorithm.
Denote the three-point central difference approximation as D_{1}(h). It has the truncation error of order O(h^{2}). By canceling the O(h^{2}) error, we define a new central difference:
D_{2}(h) = ( 4D_{1}(h) - D_{1}(2h)) / 3
The new approximation D_{2}(h) is in fact the five-point central difference:
D_{2}(h) = ( -I_{2} + 8 I_{1} - 8 I_{-1} + I_{-2} ) / 12 h
The five-point central difference is more accurate than the three-point difference: it has the truncation error of order O(h^{4})!
Denote the two-point forward difference approximation as D_{1}(h). It has the truncation error of order O(h). By canceling the O(h) error, we define a new forward difference:
D_{2}(h) = 2D_{1}(h) - D_{1}(2h)
The new approximation D_{2}(h) is in fact the three-point forward difference:
D_{2}(h) = ( -I_{2} + 4 I_{1} - 3 I_{0}) / 2 h
The three-point forward difference is more accurate than the two-point difference: it has the truncation error of order O(h^{2})!
Construct the following mapping from D_{k}(h) to D_{k+1}(h):
D_{k+1} = D_{k}(h) + (D_{k}(h) - D_{k}(2h)) / (4^{k} - 1)
In order to compute the central difference approximation up to the m^{th} order, one needs to compute the central difference approximations of lower order with larger step sizes: 2h, 4h, ..., up to 2^{m-1}h. These approximations can be arranged in a table of recursive derivatives (similar to the table of Newton's divided differences):
step size | three-point difference |
five-point difference |
nine-point difference |
17-point difference |
---|---|---|---|---|
h | D_{1}(h) | D_{2}(h) | D_{3}(h) | D_{4}(h) |
2h | D_{1}(2h) | D_{2}(2h) | D_{3}(2h) | |
4h | D_{1}(4h) | D_{1}(4h) | ||
8h | D_{1}(8h) |
The first row of this table gives a sequence of higher-order central difference approximations for the first derivative I'(t_{0}), where t = t_{0} is the central point surrounded by the points t = t_{0} - 2^{k-1}h and t = t_{0} + 2^{k-1}h, for k = 1,2,...,m. The approximation D_{k}(h) has the truncation error O(h^{2k}). If h is small, the truncation error rapidly decreases with larger k. However, a higher-order central difference does not lead to the most optimal approximation for the derivative due to the round-off error. There exists usually an optimal order k of the central difference approximation that gives the minimum of the total of the truncation and round-off errors.
Similar hierarchies can be constructed for central difference approximations of second-order and higher-order derivatives. The starting approximation for these hierarchies should be the central difference formula of order of O(h^{2})), e.g. for the second derivative:
D_{1}(h) = ( I_{1} - 2 I_{0} + I_{-1} ) / h^{2}
Hierarchies for forward and backward differences can be constructed from the algorithm above by replacing the numerical factor 4^{k} by 2^{k}.