I am preparing for my exam in the course Introduction to numerical calculation, problems similar to the following one appear often:
Find the polynomial p, that matches function $f(x) = 1/x^2$ three times (namely, in the value, first and second derivative) in points 1 and 2. Show that f and p do not absolutely differ by more than 1 8 on the interval [1,2].
I know how to find the polynomial using divided differences but I don't know how to find the difference between the p and f. Using basic analysis I can just look at function $f(x)-p(x)$ and find it's first derivative and look at maximum and minimum but I doubt that it's the method I am supposed to use.
If the values of the second derivative were not involved this would be Hermite Interpolation. The interpolating polynomial is searched in the form $$ p(x)=\sum_{k=0}^n (U_k(x) y_k + V_k(x) y'_k), $$
where $U_k(x), V_k(x)$ are polynomials to be determined. As it turns out,
$$ p(x)= \sum_{k=0}^n\left[(1-2L'_k(x_k)(x-x_k))L^2_k(x) y_k + (x-x_k)L^2_k(x) y'_k \right], $$
with interpolating error given by
$$ f(x)-p(x) = \dfrac{f^{(2n+2)}(\xi_x)}{(2n+2)!}\prod_{k=0}^n (x-x_k)^2. $$
So, the general way to answer your question would be to search for a polynomial of the form $$ p(x) = \sum_{k=0}^n(U_k(x) y_k + V_k(x) y'_k + W_k(x) y''_k)), $$
compute the polynomials $U,V,W$ using the interpolation conditions, deduce an error formula and use it in this particular case.
However, as it was pointed out, given the most likely scope of the question (limited to the particular example), the best way is to make a direct study of the error.