Let $$\:f\:∈\:C4\left[−1,\:1\right]$$ Determine an interpolation polynomial of minimum rank that satisfies the conditions: $$P\left(−1\right)\:=\:f\left(−1\right),\:P\left(0\right)\:=\:f\left(0\right),\:P\left(1\right)\:=\:f\left(1\right),\:P'\left(1\right)\:=\:f'\left(1\right)$$ and determine the expression for the remainder.
Now I know that I should be using Newton's divided differences method for determining this polynomial, but all the examples I found online are problems that are given in a different way, as in, it gives you $f(x)$ and $x$ values that you can then put into a table and follow the algorithm from there.
How do I go about solving this problem? Also, how do I determine the expression for the remainder? Any tips would come in handy.
What I tried was constructing the divided differences table $$\begin{pmatrix}x_i&f\left[x_i\right]&f\left[x_i,x_{i+1}\right]&f\left[x_i,x_{i+1},x_{i+2}\right]&f\left[x_i,x_{i+1},x_{i+2},x_{i+3}\right]\\ -1&f\left(-1\right)&&&\\ 0&f\left(0\right)&\frac{f\left(0\right)-f\left(-1\right)}{0-\left(-1\right)}&&\\ 1&f\left(1\right)&\frac{f\left(1\right)-f\left(0\right)}{1-0}&\frac{f\left(1\right)-f\left(0\right)-f\left(0\right)+f\left(-1\right)}{2}&&&&&\end{pmatrix}$$ Where $f\left[x_i\right]=y_i\:$ and $f\left[x_i,x_{i+1}\right]=\frac{f\left[x_{i+1}\right]-f\left[x_i\right]}{x_{i+1}-x_i}$ and so on...
But I don't know where $f'(1)$ goes.
The solution I get from the book is $$\begin{pmatrix}x_i&f\left[x_i\right]&f\left[x_i,x_{i+1}\right]&f\left[x_i,x_{i+1},x_{i+2}\right]&f\left[x_i,x_{i+1},x_{i+2},x_{i+3}\right]\\ -1&f\left(-1\right)&&&\\ 0&f\left(0\right)&\frac{f\left(0\right)-f\left(-1\right)}{0-\left(-1\right)}&&\\ 1&f\left(1\right)&\frac{f\left(1\right)-f\left(0\right)}{1-0}&\frac{f\left(1\right)-f\left(0\right)-f\left(0\right)+f\left(-1\right)}{2}&\\ 1&f\left(1\right)&f'\left(1\right)&\frac{f'\left(1\right)-f\left(1\right)+f\left(0\right)}{1-0}&\frac{2f'\left(1\right)-3f\left(1\right)+4f\left(0\right)-f\left(-1\right)}{4}\end{pmatrix}$$
Which is similar to what I got, but they added the $f'(1)$ in there somehow, and I don't understand why. Constructing the polynomial is easy afterwards, of course. But how did they add the derivative? I don't understand this part.
What about the remainder? I've no clue how to get that.
Alternatively, you can do the following:
Since you have $4$ conditions, then your polynomial must be of degree 3:
Let $p(x)=ax^3+bx^2+cx+d$
Using the conditions you get:
$$-a+b-c+d=f(-1)$$ $$d=f(0)$$ $$a+b+c+d=f(1)$$ $$3a+2b+c=f'(1)$$
You know the value of $d$ hence summing up the first and the third equality gives you a value for $b$. Now you can easily find $a$ and $c$ by using the fourth equality