I would appreciate help with how to find the polynomial $P_n(x)$ for the question below:
Interpolate $f$ at equidistant points $x_i=[-1,1]$ such that $x_i=\frac{2i}{n}-1$, $i={0,1,2,..,n}$ with a polynomial $P_n(x)$ of degree less or equal to n. Where, $$f=\frac{1}{1+25x^2}.$$
I was thinking about doing this for $P_4(x), P_8(x), P_{12}(x)$ and $P_{16}(x)$ and then construct four graphs all presenting $f$ and respective $P_n(x)$ to be able to compare these (kinda like they did here on page 63). And my guess is that one should use $P(x)=p_1x^n+p_2^{n-1}+...+p_nx+p_{n+1}$ from the Weierstrass approximation theorem to get $P_n(x)$, but still from this I don't know how to construct the interpolation polynomial.
My thought is now that one can choose a polynomial that corresponds to P as long as it is less or equal to n? But then we won't use $x_i$ in this and therefore this must then be wrong.
Does anyone want to help me clarify how one should construct the interpolation polynomial $P_n(x)$?
Edit the example in the link above also construct $P_4(x), P_8(x), P_{12}(x)$ and $P_{16}(x)$ but never show how they did these, they only present them in the graphs, and therefore that example can't help me with this problem.
Use the Lagrange interpolation formula:
You can check for yourself that this polynomial will do the trick -- at $x_i$, all terms in the sum except for the $i$th term vanish, so the evaluation is relatively straightforward.