Second order approximation of first derivative gives odd results Assume I want to find the second order approximation of the first derivative in 0 of a function $f(x)$ (not defined for $x&lt;0$). I will use the formulation for the forward derivative:

$f'(0)\approx \frac{-3f(0)+4f(h)-f(2h)}{2h}$

where $h$ is the step in the regular grid I am using. Now assume that the values of the function are:
$f(0)=0$, $f(h)=5$, $f(2h)=25$.
The function is clearly monotonically increasing and the first derivative in 0 is expected to be positive but, from the formula above, I get a negative value.

What am I missing? Does the issue all lie in the error (that I neglected)?
A difference quotient with three terms should be exact for quadratics. You can even use this fact to derive difference quotients. So, let's fit a quadratic to the points $\{(0,0),(h,5),(2h,25)\}$; we find that
$$
f(x) = \frac{15 x^2}{2 h^2}-\frac{5 x}{2 h}.
$$
It's easy enough to check that this quadratic passes through the desired points. It's also easy to check that
$$
f'(0)=\frac{4 f(h)-f(2 h)-3 f(0)}{2 h}=-\frac{5}{2 h}
$$
and, in particular, that the derivative is negative when $h&gt;0$. In fact, it grows in absolute value as $h\searrow0$.
Try 
    $$ f'(0)\approx \frac{(2-h)f(2h)-(4-4h)f(h) +(2-3h)f(0)}{2h^2}.$$