Lagrange interpolation $x_j$

54 Views Asked by At

Since $\psi(x)=\prod_{i=0}^n(x-x_i)$ wouldn't $\psi(x_j)=\prod_{i=0}^n(x_j-x_i)=0$? I am confused on this... I feel like I am misunderstanding the notation.

1

There are 1 best solutions below

3
On BEST ANSWER

The Lagrange basis element $\psi_i$ is supposed to be a polynomial which is $0$ at all the $x_j$ except for $x_i$ where it is $1$. It does this by first building a monic polynomial which vanishes at the desired points, namely

$$f_i(x)=\prod_{j=1,j \neq i}^n (x-x_j)$$

then it normalizes that, taking $\psi_i(x)=\frac{f_i(x)}{f_i(x_i)}$, so that $\psi_i(x_i)=1$.

Where you seem to be confused is in forgetting about that "$j \neq i$" part. For example, if $x_i=i,n=4$, then $f_2(x)=(x-1)(x-3)(x-4)$ so it does not vanish at $2$.