Interpolate f(x) on the interval [-5,5] with Lagrange polynomials of degree n, Pn(x), which agree with f at n+1 equally spaced points on the interval. Do this for n=5, 10, 15, 20. Explain what method you are using to compute the polynomials. You may use matlab commands polyval and polyfit.
Plot P5(x), P10(x), and P15(x) separately, but with each f(x). (When displaying a graph, plot the points xi,yi where xi-xi-1 = 0.01)
Compute the error at the point q=1+(10) for each of the approximations. What would you expect to happen as n gets larger? What is actually happening?