Derivative by Interpolation

The derivative of a given function $f(t)$ can be approximated by that of its polynomial interpolation based on a set of $n+1$ points $y_i=f(x_i),\;(i=0,\cdots,n)$, such as the Lagrange polynomial interpolation considered previously:

$\displaystyle f(x)\approx L_n(x)=\sum_{i=0}^n y_i l_i(x)$ (8)

where $l_i(x)$ is the ith basis polynomial:

$\displaystyle l_i(x)=\prod_{j=0,\;j\ne i}^n \frac{x-x_j}{x_i-x_j}
=\frac{l(x)}{(x-x_i) l'(x)},\;\;\;\;\;(i=0,\cdots,n)$ (9)

and $l(x)=\prod_{i=0}^n(x-x_i)$. The truncation error is:

$\displaystyle R_n(x)=\frac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{i=0}^n(x-x_i)
=\frac{f^{(n+1)}(\xi(x))}{(n+1)!}\,l(x)$ (10)

Taking derivative of $f(x)$ above we get:

$\displaystyle D[f]=f'(x)\approx L'_n(x)=\sum_{i=0}^n y_i l'_i(x)
=\sum_{i=0}^n y_i d_i(x)$ (11)

where

$\displaystyle d_i(x)=\frac{d}{dx}l_i(x)
=\frac{d}{dx} \left(\prod_{j=0,\;j\ne i}^n \frac{x-x_j}{x_i-x_j}\right)$ (12)

The error is
$\displaystyle E_n(x)=R'_n(x)$ $\displaystyle =$ $\displaystyle \frac{1}{(n+1)!}\frac{d}{dx}\left((f^{(n+1)}(\xi(x))\,l(x)\right)$  
  $\displaystyle =$ $\displaystyle \frac{1}{(n+1)!}\left[l'(x)f^{(n+1)}(\xi(x))
+l(x)\frac{d}{dx}f^{(n+1)}(\xi(x))\right]$  

This error is unknown in general as the function $\xi(x)\in[x_0,\,x_n]$ is not known explicitly. However, at each node $x_i$ where $w(x_i)=0$, we have

$\displaystyle E_n(x)=R'_n(x)=l'(x)\frac{f^{(n+1)}(\xi(x))}{(n+1)!}$ (13)

Consider the following two special cases: