Derivation of fourth-order accurate formula for the second derivative I am trying to derive / prove the fourth order accurate formula for the second derivative:
$f''(x) = \frac{-f(x + 2h) + 16f(x + h) - 30f(x) + 16f(x - h) - f(x -2h)}{12h^2}$.
I know that in order to do this I need to take some linear combination for the Taylor expansions of $f(x + 2h)$, $f(x + h)$, $f(x - h)$, $f(x -2h)$. For example, when deriving the the centered-difference formula for the first derivative, the Taylor expansion of $f(x + h)$ minus $f(x-h)$ can be computed to give the desired result of $f'(x)$, in that case.
In what way would I have to combine these Taylor expansions above to obtain the required result?

$$
f(x+h) = 
f(x) + h f'(x) + \frac{h^2}{2} f''(x) 
+ \frac{h^3}{6} f'''(x) 
+ O(h^4)
$$
$$
f(x-h) = 
f(x) - h f'(x) + \frac{h^2}{2} f''(x) 
- \frac{h^3}{6} f'''(x) 
+ O(h^4)
$$
$$
f(x+2h) = 
f(x) + 2h f'(x) + 2 h^2 f''(x) 
+ \frac{4 h^3}{3} f'''(x) + O(h^4)
$$
$$
f(x-2h) = 
f(x) - 2h f'(x) + 2 h^2 f''(x) 
- \frac{4 h^3}{3} f'''(x) 
+ O(h^4)
$$
Calculate:
$$
-f(x + 2h) + 16f(x + h) - 30f(x) + 16f(x - h) - f(x -2h)
$$
Which is
$$
\begin{aligned}
&
- \left[
f(x) + 2h f'(x) + 2 h^2 f''(x) 
+ \frac{4 h^3}{3} f'''(x) 
\right]
\\
&
+16
\left[
f(x) + h f'(x) + \frac{h^2}{2} f''(x) 
+ \frac{h^3}{6} f'''(x) 
\right]
\\
&
-30
f(x)
\\
&
+16
\left[
f(x) - h f'(x) + \frac{h^2}{2} f''(x) 
- \frac{h^3}{6} f'''(x) 
\right]
\\
&
-
\left[
f(x) - 2h f'(x) + 2 h^2 f''(x) 
- \frac{4 h^3}{3} f'''(x) 
\right]
\\
&
+ O(h^4)
\end{aligned}
$$
Which evaluates to 
$
12 h^2
$
to give the required result.
