In this problem, you can use the Matlab program posted on coursewebsite and Canvas (also given in the lecture) that computes theinterpolation polynomial. We want to see how well a given functioncan be approximated by the interpolation polynomials. Let f be afunction. We divide the the interval [−0.6,0.6] into subintervalsof the same length h = 0.02. The gridpoints are −0.6 = x1 < x2< ... < x61 = 0.6. Take N = 61 points (x1,y1),...(xN,yN) onthe graph of f.
(a) For f(x) = sinx, plot the graph of the interpolation P onthe interval [−0.6,0.6]. Plot f and all of P on the same graph (forexample, by using the command hold on). Does the interpolationpolynomial approximate well the function f on the interval [−0.6,0.6]?
(b) The same questions as in Part (a) but for f (x) = 1+x .
(c) We know that the error between f and P is estimated by
| f (x) − P (x)| ≤ max |f (n) | (∗)
n n−1 [a,b]
Let f (x) = 1 and [a, b] = [−0.6, 0.6]. Use Stirling approximationm√m! ≈ 1 (for large
1+x me m) to show that the right hand side of (∗) goes toinfinity as n → ∞.