Suppose you want to approximate the derivative of a function f(x) at a point x0. Given a small value of h, then if we can evaluate the function to find the three points (x0 - h, f(x0 - h)), (x0, f(x0)), and (x0 + h, f(x0 + h)), then we can find the interpolating polynomial passing through these points. For example, Figure 1 shows a function at which we would like to approximate the derivative at x0 = 2.4.
Figure 1. A function f(x).
If we let h = 0.2, then we can calculate the three points shown in Figure 2 and find the interpolating quadratic polynomial.
Figure 2. The line tangent to the point (xa, f(xa)).
Figure 3 shows this interpolating quadratic polynomial and the slope at the point x = 2.4. This is easily calculated, as the quadratic is of the form ax2 + bx + c and thus, the slope at x = 2.4 is 2a⋅2.4 + b.
Figure 3. The slope of the interpolating quadratic polynomial at x = 2.4.
If we compare the approximation of the slope found using the interpolating quadratic polynomial and the actual slope at x = 2.4, we see that in Figure 4 that they are close, but not exactly the same.
Figure 4. A comparison of the two slopes.
Derivation
Because we are considering points on either side of x0, this method is termed centred divided difference. In the next topic, we will see how we can evaluate the derivative using only previous points (points to the left of x0).
We will look at two formulae, one interpolating three points, the next interpolating five points. Beyond this, the instability of the interpolating polynomials reduces the benefit of finding higher and higher order formulae.
Second-Order Centred Divided-Difference Formula
Interpolating the three points (x0 - h, f(x0 - h)), (x0, f(x0)), (x0 + h, f(x0 + h)), differentiating and evaluating at x0 yields the familiar formula
Fourth-Order Centred Divided-Difference Formula
Interpolating the five points (x0 - 2h, f(x0 - 2h)), (x0 - h, f(x0 - h)), (x0, f(x0)), (x0 + h, f(x0 + h)), and (x0 + 2h, f(x0 + 2h)), differentiating and evaluating at x0 yields the formula
You may note that the emphasis in the 4th-order centred divided-difference formula is on 8 f(x0 + h) − 8 f(x0 − h), which is similar to the numerator of the 2nd-order centred divided-difference formula.
If you wish to see the derivation of these formulae, please look at this Maple worksheet.
Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.