Deriving formula for derivative I have a formula in my book for differentiating numerically. 
$$f'(x_0)=\frac{1}{12h}[-25f(x_0)+48f(x_0+h)-36f(x_0+2h)+16f(x_0+3h)-3f(x_0+4h)]+\frac{4}{5}f^{(5)}(\xi)$$
I was wondering if anyone could explain how we know the formula is true?  (By the way the term with $\xi$ is the estimate for the error which appears in the Taylor Series and $h$ is step size) I think I have to take the Taylor Series of $f(x_0 +h)$ and $f(x_0-h)$ and $f(x_0+2h)$ and $f(x_0-2h)$ etc... and then some sort of linear combination of those Taylor Series makes the formula, but how do we know which linear combination of the Taylor Series we are supposed to do?
Or perhaps there is an easier way to derive the formula?
Thanks for any insights!
 A: Hint:
The Taylor Series is a polynomial in $h$, let
$$a+bh+ch^2+dh^3+eh^4+fh^5\cdots$$
Evaluating it for the first multiples of the step gives
$0:a\\
h:a+bh+ch^2+dh^3+eh^4+fh^5+\cdots\\
2h:a+2bh+4ch^2+8dh^3+16eh^4+32fh^5+\cdots\\
3h:a+3bh+9ch^2+27dh^3+81eh^4+243fh^5+\cdots\\
4h:a+4bh+16ch^2+64dh^3+256eh^4+1024fh^5+\cdots\\
5h:a+5bh+25cv+125dh^3+625eh^4+3125fh^5+\cdots\\
\cdots$
The trick is to form a linear combination such that the of all powers coefficients are $0$, except that of $h$. To get a fifth order formula, we need to solve the following linear system:
$a:\alpha+\beta+\gamma+\delta+\epsilon=0\\
bh:\beta+2\gamma+3\delta+4\epsilon=1\\
ch^2:\beta+4\gamma+9\delta+16\epsilon=0\\
dh^3:\beta+8\gamma+27\delta+64\epsilon=0\\
eh^4:\beta+16\gamma+81\delta+256\epsilon=0.$
The solution is precisely
$$\alpha=-\frac{25}{12},\beta=\frac{48}{12},\gamma=-\frac{36}{12},\delta=\frac{16}{12},\epsilon=-\frac{3}{12}.$$
A: Try finding:
$$4f(x+h)-3f(x+2h)+\frac43f(x+3h)-\frac14f(x+4h)$$
Which comes out to be:
$$\small 4f(x+h)-3f(x+2h)+\frac43f(x+3h)-\frac14f(x+4h)=\frac{25}{12}f(x)+hf'(x)-\frac15h^5f^{(5)}(x)+O(h^6)$$
So $f'(x)$ is:
$$f'(x)=\frac1h[-\frac{25}{12}f(x)+4f(x+h)-3f(x+2h)+\frac43f(x+3h)-\frac14f(x+4h)+\frac15h^5f^{(5)}(x)+O(h^6)]$$

How did I found the coefficients?:
By taylor' theorem:
$$f(x+kh)=f(x)+kf'(x)h+\frac12k^2h^2f''(x)+...+\frac1{n!}k^nh^nf^{(n)}(x)+R_{n+1}$$
So you needed to solve:
$$ 
\left\{\begin{array}{c}
a+2b+3c+4d=1\\
a+4b+9c+16d=0\\
a+8b+27c+64d=0\\
a+16b+81c+256d=0
\end{array}\right\}
$$
which is easily solvable as last three equations are easy to manipulate and give:
$$a=4,b=-3,c=4/3,d=-1/4$$
