I need to find interpolation polynomials and their remainder expressions satisfying the conditions $P\left(x_{i}\right)=f\left(x_{i}\right)(i=0,1,2) $ and $P^{\prime}\left(x_{1}\right)=f^{\prime}\left(x_{1}\right)$.
I wonder why I need to set the remainder expression to $R(x)=f(x)-P(x)=k(x)\left(x-x_{0}\right)\left(x-x_{1}\right)^{2}\left(x-x_{2}\right)$?
Why does the double node $x_{1}$ appear in the final remainder expression $R(x)=\frac{1}{4 !} f^{(4)}(\xi)\left(x-x_{0}\right)\left(x-x_{1}\right)^{2}\left(x-x_{2}\right)$?
D[k[x] (x - x0) (x - x1)^2 (x - x2), x] /. x -> x0
D[k[x] (x - x0) (x - x1)^2 (x - x2), x] /. x -> x1
The calculation result of the above code only shows that the derivative value of the remainder expression at x = x1 is 0, I want to know what causes the remainder expression to be in this form?
This is because $R(x)=f(x)-P(x)$ and $P^{\prime}\left(x_{1}\right)=f^{\prime}\left(x_{1}\right)$, then $R^{\prime}\left(x_{1}\right)=P^{\prime}\left(x_{1}\right)-f^{\prime}\left(x_{1}\right)=0$, so $R(x)$ must have a double root at
x = 1.And the results of the following code confirm this, so we can set $R(x)$ to $k(x)\left(x-x_{0}\right)\left(x-x_{1}\right)^{2}\left(x-x_{2}\right)$.
Other deeper explanations will be updated later.