Show that H(xi) = f(xi) and H0(xi) = f0(xi), for all 0 ≤ i ≤ n. (You do not need to prove the uniqueness of H.)
1
4. Let f(x) be a function defined on the interval [x0−h,x0 +h], and f ∈ C3[x0−h,x0 +h] .
(a) Let P(x) be the Lagrange interpolation polynomial of f(x) at the nodes x = x0 − h,x0,x0 + h. Write down the expression of P(x).
(b) Write down the error term E(x) := f(x) − P(x) in terms of the derivatives of f(x).
(c) Using the fact that f(x) = P(x)+E(x), calculate the derivatives of f, f0(x) at x = x0.
(d) If we approximate the derivative f0(x0) by P0(x0), is it true that the above approximation is exact if f is a polynomial of degree less than or equal to 2 ? Why ?
(e) Write down an error bound of this approximation rule suggested in (d) for a generalfunction f(x) based on the result in (b).
5. (Programming problem)
Let a number of points (xi,f(xi)) be given, 0 ≤ i ≤ n. Let P(x) be its Lagrange interpolation polynomial interpolating the points (xi,f(xi)), 0 ≤ i ≤ n.
Write a program which allow inputs {(xi,f(xi))} and a value a, and calculate the value of P(a).