Based on some exercise which explains Lagrange Interpolation itself, I got some doubts:
It introduces function $$f(x)=\frac{1}{x}$$ and given points $x_0=2$, $x_1=2.75$ and $x_2=4$
so the following: $f(x_0)=\frac{1}{2}$, $f(x_1)=\frac{4}{11}$ and $f(x_2)=\frac{1}{4}$
It asks for:
- Finding the second Lagrange polynomial.
- Approximate $f(3)=\frac{1}{3}$
So it begins:
$$L_0(x)=\frac{(x-2.75)(x-4)}{(2-2.5)(2-4)}$$ $$L_1(x)=\frac{(x-2)(x-4)}{(2.75-2)(2.75-4)}$$ $$L_2(x)=\frac{(x-2)(x-2.75)}{(4-2)(4-2.5)}$$
But I get confused, as I thought that each Lagrange polynomial was defined by: $$\sum_{k=0}^nf(x_k)L_{n,k}(x)=\prod_{i=0}^n\frac{x-x_i}{x_k-x_i}$$
So I get that $L_0$ is actually: $$\frac{(x-x_1)(x-x_2)}{(x_0-?)(x_0-x_2)}$$ Where I indicate a $?$ as I don't really know where that term came from.
I get confused then what $i$ and $k$ are for $L_0$
I think in $L_0 $x_i was set to $x_2$, why? and so $x_k$ would be $x_0$ for $L_0$, $x_1$ for $L_1$ and $x_2$ for $L_2$, am I right?