Lagrange interpolant degree 2 Consider the function
$$f(x) = \frac{1}{\alpha (x-\beta)^2 + 1}$$
in the interval $I = [-1,1]$. Set $\beta = 0$. The Lagrange interpolating polynomial of $f(x)$ with degree $n=2$ for equally spaced nodes in $I$.
I tried several times and I want to know if I got the right interpolant for different values of $\alpha$. What I got is
$$P(x) = \frac{-x^2 + x + 4}{4\alpha + 4} - \frac{\alpha x^2 - \alpha}{\alpha + 1}$$
 A: In the following I'll use the notation of the wikipedia link provided below.
Suppose $\beta=0$. We get $\displaystyle f(x) = \frac{1}{\alpha x^2 + 1}$.
Let $x_0=-1, x_1=0$ and $x_2=1$. We get $\displaystyle f(x_0)=\frac{1}{\alpha +1}=f(x_2)$ and $\displaystyle f(x_1)=1$.
We'll interpolate at $(x_0,y_0), (x_1,y_1), (x_2,y_2)$, where $y_0=f(x_0), y_1=f(x_1)$ and $y_2=f(x_2)$, hoping that the Lagrange Polynomial we find is of the degree 2.
The Lagrange Polynomial is given by $\displaystyle L(x)=y_0l_0(x)+y_1l_1(x)+y_2l_2(x)$, where
$$l_0(x)=\frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}=\frac{(x-0)(x-1)}{(-1-0)(-1-1)}=\frac{x(x-1)}{2}$$
$$l_1(x)=\frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}=\frac{(x-(-1))(x-1)}{(0-(-1))(0-1)}=\frac{(x+1)(x-1)}{-1}=-(x^2-1)$$
$$l_2(x)=\frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)}=\frac{(x-(-1))(x-0)}{(1-(-1))(1-0)}=\frac{x(x+1)}{2}$$
So it comes $\displaystyle L(x)=f(x_0)\frac{x(x-1)}{2}-f(x_1)(x^2-1)+f(x_2)\frac{x(x+1)}{2}=\\ \displaystyle =\frac{1}{\alpha +1}\frac{x(x-1)}{2}-(x^2-1)+\frac{1}{\alpha +1}\frac{x(x+1)}{2}$
which, fortunately, is a polynomial of degree 2.
