[Math] Lagrange interpolating polynomial with n=4

analysispolynomials

I don't know if I got that one right and I can't find on the internet the correct expression for the Lagrange interpolating polynomial when n=4, using these expressions:

enter image description here

Note I didn't use x_[0])

Note: I'm using $x_1$ instead of $x_{0}$.

Can someone write the polynomial with $n=4$, please?

Best Answer

Suppose we have $(x_1,y_1),(x_2,y_2),(x_3,y_3),(x_4,y_4)$, the Lagrange interpolating polynomial is

$$p_4(x)=y_1 \frac{(x-x_2)(x-x_3)(x-x_4)}{(x_1-x_2)(x_1-x_3)(x_1-x_4)}+y_2 \frac{(x-x_1)(x-x_3)(x-x_4)}{(x_2-x_1)(x_2-x_3)(x_2-x_4)}+y_3 \frac{(x-x_1)(x-x_2)(x-x_4)}{(x_3-x_1)(x_3-x_2)(x_3-x_4)}+y_4 \frac{(x-x_1)(x-x_2)(x-x_3)}{(x_4-x_1)(x_4-x_2)(x_4-x_3)}.$$