Question: Let f ( x ) = 1 + x 2 1 Interpolate f(x) on the interval [-5,5] with Lagrange polynomials of degree n, P n
Let f(x)=1+x21
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?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
