Consider the data a Find the Lagrange interpolating polynomi
Consider the data (a) Find the Lagrange interpolating polynomial for the data. (b) Using a Table for Divided-Differences (by hand), construct the Newton interpolating polynomial for the data. (c) Using Mat lab, provide a plot of the interpolating polynomials from the previous parts (on the same graph), as well as the data points. As part of your answer, include a printout of the Mat lab code used, or write the commands and resulting output out by hand. Using either the Newton or the Lagrange interpolating polynomial, what is the value of the polynomial at x = -2?
Solution
(3,2)(-1,-2)(0,-1)(1,-3)(2,1)
f(3)=2, f(-1)=-2, f(0)=-1, f(1)=-3, f(2)=1
A) f(x)=3x44+3x33x247x21f(x)=3x44+3x33x247x21
C.) MATLAB CODE
D) x=-2
Using the Newton\'s divided difference formula
f(-2)=153
f(x) = f [x0] + (x - x0) f [x0, x1] + (x - x0) (x - x1) f [x0, x1, x2] + (x - x0) (x - x1) (x - x2)f [x0, x1, x2, x3]
+ (x - x0) (x - x1) (x - x2)(x - x3)f [x0, x1, x2, x3, x4]
F(-2)= 2+4-5+16+136
= 153
END!
