Derivation

Often, one can not choose the step size [Maple Math] arbitrarily small. The function value may only be known as a table so that the smallest step size is determined by the tabulated values. Or, the values are calculated values, part of a bigger numerical scheme. Therefore, formulae that yield a more accurate estimate with larger values of [Maple Math] are worthwhile pursuing.

Here, we will construct a number of three point formulae: formulae that use three data points instead of two. Take the result of Theorem 10 with the quadratic Lagrange Polynomial:

[Maple Math] .

Again, we can take the derivative of both sides to obtain a formula for [Maple Math] . First, consider the Lagrange Polynomial:

> restart;

> P2:=xx->((xx-x[1])*(xx-x[2])/((x[0]-x[1])*(x[0]-x[2])))*f(x[0])+((xx-x[0])*(xx-x[2])/((x[1]-x[0])*(x[1]-x[2])))*f(x[1])+((xx-x[0])*(xx-x[1])/((x[2]-x[0])*(x[2]-x[1])))*f(x[2]);

[Maple Math]

> dP2:=diff(P2(xx),xx);

[Maple Math]
[Maple Math]

or, with equidistant points such that

> x[1]:=x[0]+h;x[2]:=x[0]+2*h;

[Maple Math]

[Maple Math]

> dP2;

[Maple Math]
[Maple Math]

The error term can also be dealt with:

> err:=(D@@3)(f)(xi(xx))/(3!)*(xx-x[0])*(xx-x[1])*(xx-x[2]);

[Maple Math]

> derr:=diff(err,xx);

[Maple Math]
[Maple Math]

This error term is difficult to manipulate, but can be simplified by evaluating the expression at any of the data points

> dfx:=dP2+derr;

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> dfx0:=simplify(subs(xx=x[0],dfx));

[Maple Math]

> dfx1:=simplify(subs(xx=x[1],dfx));

[Maple Math]

> dfx2:=simplify(subs(xx=x[2],dfx));

[Maple Math]

The first and third formulae can be written in the same format if we allow [Maple Math] :

[Maple Math] .

This represents the formula to be used when the data points are all on one side of the point at which you want to evaluate the derivative.

When a data point is located at either side of the point at which the derivative needs to be evaluated, the formula becomes

[Maple Math] .

Notice that the error here is about half the error of the previous formula. Therefore, this centered difference is usually preferred.