Find the polynomial p of degree10 that interpolates x on 1 1
Find the polynomial p of degree?10 that interpolates |x| on [-1, 1] at 11 equally spaced points. Print the difference |x| - p(x) at 41 equally spaced points. Then do the same with Chebyshev nodes. Compare.
Solution
This is just a simple linear regression problem. You can either manually solve the problem by creating a 11x11 matrix, or you can just use polyfit.
i.e.
We will get the same coefficient vector C. Our desired polynomial is like this
![Find the polynomial p of degree?10 that interpolates |x| on [-1, 1] at 11 equally spaced points. Print the difference |x| - p(x) at 41 equally spaced points. T Find the polynomial p of degree?10 that interpolates |x| on [-1, 1] at 11 equally spaced points. Print the difference |x| - p(x) at 41 equally spaced points. T](/WebImages/4/find-the-polynomial-p-of-degree10-that-interpolates-x-on-1-1-977751-1761501681-0.webp)