More Numerical Differentiation
Last time we looked at two- and three- point formulas. This time we want to go beyond those, to three and five point formulas.
This suggests that we might mix and match to create one of the following
then we might hope that these errors will essentially cancel, and we end up with
Notice the exciting development: we went from an method to an method, dependent on the fifth derivative of f.
Notice also that, although this is called a five-point method, only four points actually figure into the derivative calculations.
This can be obtained using Taylor series and by carefully selecting the coefficients of the , so as to get cancellation up to the fifth derivative terms. Then again, assuming continuity of the fifth derivative we can use the Intermediate Value Theorem to arrive at the error term.
We need a linear combination of these things that gives us
Each is an exercise in linear algebra, actually, and not so terribly complicated. Here it is in lisp:
comes right of the Taylor series for
and
Again, here it is in lisp: the same procedure, with a few options:
One interesting observation is that if an error term is dependent on the derivative term , then the approximation will be exact for polynomial functions of degree n-1. So, if you knew that a certain phenomenon would theoretically be modelled by a cubic function, then we can get the derivatives exactly right using position data and the appropriate form of the approximation to the derivatives (e.g. a five-point scheme).