### 8.2 Finite differences through interpolation

FD approximations of the -th derivative of a function at a point are local linear
combinations of function values at node points,
where the nodes do not need to include (that is, the grid can be staggered). In the FD case, the
number of nodes is usually kept fixed as resolution is changed, resulting in a fixed convergence
order . This is in contrast to discrete spectral collocation methods, discussed in Section 9,
which can be seen as approximation through global polynomial interpolation at special nodal
points.
A way of systematically constructing FD operators with an arbitrary distribution of nodes, any
desired convergence order, and which are centered, one-sided or partially off-centered in any way
is through interpolation. A local polynomial interpolant is used to approximate the function
, and the FD approximation is defined as the exact derivative of the interpolant. That is,

and, for instance, for a first derivative,
Notice that the expression (8.8) does have the form of Eq. (8.6), where are the nodal points of the
interpolant and
The truncation error for the FD approximation (8.8) to the first derivative can be estimated by
differentiating the error formula for the interpolant, Eq. (8.5),

The derivative of the first term in Eq. (8.10) is more complicated to estimate than the second one without
analyzing the details of the dependence of on . But if we restrict to be a nodal point ,
then and the previous equation simplifies to
Notice that Eq. (8.11) implies that the resulting FD approximation has design convergence order
. For the usual case of equally spaced nodes, for instance, where , we obtain
and the error is proportional to . If the nodes are not equally spaced, the error can be bounded by
a constant proportional to , where in this case is the maximal distance between neighboring
nodal points.
Example 47. A first-order one-sided FD approximation for .

We construct a first-degree interpolant using two nodal points ,

with
Then
If we evaluate at or we obtain the standard first-order forward and backward FD
approximations and , respectively [cf. Eqs. (7.70)]. From Eq. (8.12) we recover the known
first-order convergence for these approximations, , which can also be obtained directly through a
Taylor expansion in of Eq. (8.15).
Example 48. A second-order centered finite-difference approximation for .

Now we construct a second-degree interpolant using three nodal points ,

with
If we assume the points to be equally spaced, , and evaluate the derivative at the
center one, , we obtain
the standard second-order centered FD operator [cf. Eq. (7.32)].
One can proceed in this way to systematically construct any FD approximation to any derivative with
any desired convergence order and distribution of nodal points. The result for centered-difference
approximations to with even accuracy order at equally spaced nodes can be written in terms of
as follows [228],

with
Example 49. The fourth, sixth, eighth and tenth-order centered FD approximations to are: