Suppose we know the values of a function $f$ at three points $$\left(x_{0},y_{0}\right)\qquad \left(x_{1},y_{1}\right)\qquad \left(x_{2},y_{2}\right)$$ with $$x_{1}=x_{0}+h\qquad x_{2}=x_{0}+2h\qquad 0\lt h \lt 1$$
Let's first look at an example with numbers. Then we will generalize to any three nodes.
$$ \begin{array}{|c|ccc|} \hline k & 0 & 1 & 2\\ \hline x_{k} & 1.4 & 1.5 & 1.6\\ \hline y_{k}=\ln{x_{k}} & 0.3365 & 0.4055 & 0.4700\\ \hline \end{array} $$The three points for the example will be
Let's calculate the parabola that passes through these three points using the interpolating polynomial in Newton's form
$$ P_2(x)=[y_{0}]+[y_{0},y_{1}](x-x_{0})+[y_{0},y_{1},y_{2}](x-x_{0})(x-x_{1}) $$We will calculate the coefficients using the divided differences table
If we substitute $x_0,$ $x_1,$ $x_2,$ $y_0,$ $y_1$ and $y_2$ with their values
And the interpolation polynomial is
$$ P_2(x)=c_0+c_1(x-x_{0})+c_2(x-x_{0})(x-x_{1}) $$and using the $c_i$ values from the table
$$ P_2(x)=0.3365+0.6900(x-1.4)-0.2250(x-1.4)(x-1.5) $$And this is the interpolation polynomial that passes through the three points
Now we calculate the derivative of $P_2$
$$ P'_2(x)=0.6900-0.2250[(x-1.4)+(x-1.5)] $$and its second derivative
$$ P''_2(x)=-0.2250[2]= -0.4500 $$And now we can use it to estimate the derivatives at the nodes
Differentiating again, we will have an approximation for the second derivative
$$ P''_2(x)=-0.2250(2)=-0.4500 $$Let's compare the approximations with the exact values. Taking into account that
$$ f'(x) = \frac{1}{x} \quad f''(x) = -\frac{1}{x^2} $$Although the smallest error is returned by the centered formula, all errors are of the same order of magnitude since all of them are order two formulas.
Now we generalize to any three nodes.
If we use a $2^{o}$ degree interpolation polynomial at $x_{0}$, $x_{1}$, $x_{2}$, where $y_{j}=f(x_{j})$, the polynomial interpolation in Newton's form is:
$$ p(x)=[y_{0}]+[y_{0},y_{1}](x-x_{0})+[y_{0},y_{1},y_{2}](x-x_{0})(x-x_{1}) $$We will calculate the coefficients using the divided differences table
$$ \begin{array}{cccc} x_0 & \fbox{$y_0$}^{\;\large{c_0}} & & \\ & & \fbox{$[y_0,y_1]=\dfrac{y_1-y_0}{x_1-x_0}$}^{\;\large{c_1}} & \\ x_1 & y_1 & &\fbox{$[y_0,y_1,y_2]=\dfrac{[y_1,y_2]-[y_0,y_1]}{x_2-x_0}$}^{\;\large{c_2}}\\ & & [y_1,y_2]=\dfrac{y_2-y_1}{x_2-x_1} & \\ x_2 & y_2 & & \\ \end{array} $$con
Summing up
$$ c_0=y_{0},\quad c_1=\frac{y_{1}-y_{0}}{h},\quad c_2=\frac{1}{2h^{2}}(y_{0}-2y_{1}+y_{2}). $$As
$$ p(x)=c_0+c_1(x-x_{0})+c_2(x-x_{0})(x-x_{1}) $$If we differentiate $p(x)$
$$ f'(x)\approx p'(x)=c_1+c_2((x-x_{0})+(x-x_{1})) $$It is the formula for the node $x_{0}$
$$ f'(x_{0})\approx p'(x_{0})=c_1+c_2((x_{0}-x_{0})+(x_{0}-x_{1})), $$Thus
$$ f'(x_{0})\approx\frac{y_{1}-y_{0}}{h}+\frac{1}{2h^{2}}\big(y_{0}-2y_{1}+y_{2}\big)(-h), $$And finally
$$ \fbox{$f'(x_{0})\approx\dfrac{-3y_{0}+4y_{1}-y_{2}}{2h}$} $$It is the formula for the node $x_{1}$
$$ f'(x_{1})\approx p'(x_{1})=c_1+c_2((x_{1}-x_{0})+(x_{1}-x_{1})), $$Thus
$$ f'(x_{1})\approx\frac{y_{1}-y_{0}}{h}+\frac{1}{2h^{2}}\big(y_{0}-2y_{1}+y_{2}\big)h, $$And finally
$$ \fbox{$f'(x_{1})\approx\frac{-y_{0}+y_{2}}{2h}$} $$It is the formula for the node $x_{2}$
$$ f'(x_{2})\approx p'(x_{2})=c_1+c_2((x_{2}-x_{0})+(x_{2}-x_{1})), $$Thus
$$ f'(x_{2})\approx\frac{y_{1}-y_{0}}{h}+\frac{1}{2h^{2}}\big(y_{0}-2y_{1}+y_{2}\big)(2h+h), $$And finally
$$ \fbox{$f'(x_{2})\approx\frac{y_{0}-4y_{1}+3y_{2}}{2h}$} $$If we differentiate $p'(x)$
$$ f'(x)\approx p'(x)=[y_{0},y_{1}]+[y_{0},y_{1},y_{2}]((x-x_{0})+(x-x_{1})), $$also
$$ f'(x)\approx p'(x)=c_1+c_2((x-x_{0})+(x-x_{1})), $$We have
$$ f''(x)\approx p''(x)=2c_2, $$Thus
$$ f''(x_1)\approx p''(x_1)=2c_2=\frac{1}{h^{2}}\big(y_{0}-2y_{1}+y_{2}\big), $$that is
$$ \fbox{$f''(x_1)\approx \frac{1}{h^{2}}\big(y_{0}-2y_{1}+y_{2}\big)$} $$Or, if we call $x_1=a$ then $x_0 = a-h$ and $x_2 = a+h$ and another form of this formula is $f''(a)\approx p''(a)$
$$ \fbox{$f''(a)\approx \frac{f(a-h)-2f(a)+f(a+h)}{h^{2}}$} $$Let's compare the approximate results with the exact ones
Although the smallest error is given again by the centered formula, all errors are of the same order of magnitude since all of them are order two formulas.