1. Let f(x) be a function defined on the interval [−1,1], and f ∈ C4[−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 by , 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 basedon 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
integral .
(b) Use composite Simpson’s Rule and the functions values at x = 0,1,2,3,4 to approx-
imate the same integral .
3. (Programming problem) Consider the integral:
1
(a) Write a program to use the composite trapezoidal to approximate the above integralby dividing [0,π] to N equal spaces.
(b) Write a program to use the composite Simpson’s approximate the above integral bydividing [0,π] to N equal spaces.