1. Let f(x) be a function defined on the interval [−1, 1], and f ∈ C
[−1, 1] .
(a) Let h(x) be the Lagrange interpolation polynomial of f(x) at the nodes x = −1, 0, 1.
Write down the expression of h(x).
(b) Write down the error term E(x) := f(x) − h(x) in terms of the derivatives of f(x).
(Recall the theorem about the error between the interpolation formula h and the
exact function f.)
(c) Compute the integral
exactly in terms of the values of f(x) at points x = −1, 0, 1.
(d) If we approximate the integral R
f(x)dx by R
h(x)dx, 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) directly based
on the result in (b).
2. A function f has the values shown as below:
x 0 1 2 3 4
f(x) 1 2 1 2 1
(a) Use Simpson’s Rule and only the function values at x = 0, 2, 4 to approximate the
(b) Use composite Simpson’s Rule and the functions values at x = 0, 1, 2, 3, 4 to approximate the same integral R
3. (Programming problem) Consider the integral:
(a) Write a program to use the composite trapezoidal to approximate the above integral
by dividing [0, π] to N equal spaces.
(b) Write a program to use the composite Simpson’s approximate the above integral by
dividing [0, π] to N equal spaces.