Difference formulas from interpolating polynomials

Derivatives can be approximated by difference formulas involving more than two
or three adjacent points. Such higher-order difference approximations have
a smaller truncation error and a comparable round-off error for the same step
size *h*. There exists a general method to derive a multi-point difference
approximation for the derivative *I'(t _{0})*. The method consists
of two steps: (i) construct a Lagrange or Newton interpolating polynomial

Let us derive a three-point central difference approximation for the derivative
*I'(t _{0})* at the point (

P_{2}(t) = I_{0} + f[I_{0},I_{-1}] (t - t_{0})
+ f[I_{0},I_{-1},I_{1}] (t - t_{0}) (t - t_{-1}),

where *f[I _{0},I_{-1}]* and

P'_{2}(t_{0}) = f[I_{0},I_{-1}]
+ f[I_{0},I_{-1},I_{1}] (t_{0} - t_{-1}) =

(I_{0}-I_{-1})(t_{1} - t_{0})/(t_{0}
- t_{-1})(t_{1} - t_{-1}) +
(I_{0} - I_{1})(t_{0} - t_{-1})/(t_{0}
- t_{1})(t_{1} - t_{-1}).

If the step size is uniform, i.e. when the data values are equally spaced:
*h = t _{0} - t_{-1} = t_{1} - t_{0}*,
this general three-point formula reduces to the central difference approximation
introduced in Lecture 3.1. The truncation error of the
interpolating polynomial

The same Newton polynomial *P _{2}(t)* gives also
the three-point central difference approximation for the second derivative:

I''(t_{0}) = ( I_{1} - 2 I_{0} + I_{-1} ) / h^{2}

The central difference approximation for the second derivative is important for further applications in partial differential equations.

Let us continue the previous example and derive a three-point forward and
backward difference approximations for the derivatives *I'(t _{-1})*
and

P'_{2}(t_{-1}) = f[I_{0},I_{-1}]
+ f[I_{0},I_{-1},I_{1}] (t_{-1} - t_{0})

P'_{2}(t_{1}) = f[I_{0},I_{-1}]
+ f[I_{0},I_{-1},I_{1}] (2t_{1} -
t_{0} - t_{-1})

If the step size is uniform, i.e. when the data values are equally spaced:
*h = t _{0} - t_{-1} = t_{1} - t_{0}*,
the general three-point forward and backward difference formulas reduce to
the form:

I'(t_{-1}) = ( - 3 I_{-1} + 4 I_{0} - I_{1} ) / (2h)

I'(t_{1}) = ( 3 I_{1} - 4 I_{0} + I_{-1} ) / (2h)

The three-point forward and backward difference approximations have
also truncation errors of order *O(h ^{2})*. They are
useful to approximate the derivative at the boundary (left-end and right-end) points
at the same

Consider the Newton interpolating polynomial *I = P _{n}(t)*
through

P'_{n}(t) = f[I_{0},I_{1}] +
f[I_{0},I_{1},I_{2}] ((t - t_{0}) + (t - t_{1}))

... + f[I_{0},I_{1},...,I_{n}]
((t - t_{1}) ... (t - t_{n-1}) +
(t - t_{0}) ... (t - t_{n-1}) + ...
(t - t_{0}) ... (t - t_{n-2})).

The difference approximation for the derivative *I'(t) = P _{n}(t)*
has the truncation error of order

- MATLAB codes for computing derivative from the Newton interpolating polynomial
- The algorithm is based on a double nested multiplication for polynomial evaluation