Given a set of n+1 points
,
we
want to estimate the derivative dy/dx at these points.
For example, when n=2, we have
Now the numerical derivative can be found by differentiating Pn(x). For
example,
Specially when the xi's are equally spaced, i.e.
xi-1-xi=h, the
estimated derivative at x=x0 can be found to be
We can also get backward estimation of f'(x0) using (x0, y0), (x-1, y-1), (x-2, y-2):
The average of the forward and backward estimations can be used as the final estimation of f'(x0).
To overcome possible noise, better estimation may be obtained by using more points, such as 4 or 5 points.
The four-point forward estimation:
The five-point forward estimation:
This method is based on the assumption that the function y=f(x) is continuous and noise-free. If this is not the case, the estimation error could be large.