Lagrange Polynomial Approximation

Theorem
Let $f\colon D\to\R$ be $n+1$ times differentiable in an interval $I\subset\R$, and $x_0,\dotsc,x_n\in I$ be pairwise distinct points. Let $P$ be the polynomial of degree at most $n$ such that $P(x_i)=f(x_i)$ for all $i=0,\dotsc,n$, and let $R(x) = f(x) - P(x)$. Then, for every $x\in I$, there exists $\xi$ in the interval spanned by $x$ and $x_i$, $i=0,\dotsc,n$, such that
 * $\displaystyle R(x) = \frac{(x-x_0)(x-x_1)\dotsm (x-x_n)f^{(n+1)}(\xi)}{(n+1)!}.$

This theorem gives an estimate for the error of the Lagrange polynomial approximation and is similar to the Mean Value Theorem and the Taylor's Theorem with the remainder in Lagrange form.

Proof
This proof is similar to the proof of the Taylor's theorem with the remainder in the Lagrange form, and is also based on the Rolle's Theorem.

Observe that $R(x_i) = 0$ for $i=0,\dotsc,n$, and that $R^{(n+1)} = f^{(n+1)}$.

Without loss of generality, assume that $x$ is different from all $x_i$, $i=0,\dotsc,n$. Let the function $g$ be defined by:
 * $\displaystyle g(t) = R(t) - \frac{(t-x_0)(t-x_1)\dotsm (t-x_n)R(x)}{(x-x_0)(x-x_1)\dotsm (x-x_n)}.$

Then $g(x_i) = 0$ for $i = 0,\dotsc,n$, and $g(x) = 0$.

Denote by $J$ the interval spanned by $x$ and $x_i$, $i=0,\dotsc,n$. Thus $g$ has at least $n+2$ zeros in $J$.

By applying Rolle's theorem successively to $g$, to $g'$, and so until $g^{(n)}$, one obtains that $g'$ has at least $n+1$ distinct zeros in $J$, $g''$ has at least $n$ distinct zeros in $J$, and so on until $g^{(n+1)}$, which thus has at least one zero $\xi$ in $J$. Then
 * $\displaystyle 0 = g^{(n+1)}(\xi) = f^{(n+1)}(\xi) - \frac{(n+1)!R(x)}{(x-x_0)(x-x_1)\dotsm (x-x_n)},$

and the formula for $R(x)$ follows.