Solution (source code)

= Solution

Evaluating the <Lagrange interpolation polynomial> coefficients at five, and their derivatives at one, gives
$$
\boxed{f(5)\approx f(0)-5f(2)+5f(3),\qquad
f'(1)\approx\frac{f(2)-f(0)}2.}
$$
Both rules are exact for every polynomial of degree at most two. For $f(x)=x^3$, the first gives $95$, while the true value is $125$; the second gives $4$, while the true derivative is $3$. Thus \b[the respective approximation errors, estimate minus true value, are $-30$ and $1$]. There is no contradiction: a cubic lies outside the exactness class. The first formula extrapolates beyond the interpolation nodes, so its error can be substantial.