[Math] Derivation of fourth-order accurate formula for the second derivative

calculusfinite differencesnumerical methods

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?

Best Answer

Exactly as Gammatester says, Taylor expand the terms upto order $4$ and verify. \begin{eqnarray*} -f(x+2h) &=& -f(x) &-& 2h f'(x) &-& 2h^2 f''(x) &-& \frac{4}{3} h^3 f'''(x) &-& \frac{2}{3} h^4 f''''(x) &+& O(h^5) \\ 16f(x+h) &=& 16 f(x)&+& 16h f'(x) &+& 8h^2 f''(x) &+& \frac{8}{3} h^3 f'''(x) &+& \frac{2}{3} h^4 f''''(x) &+& O(h^5) \\ -30f(x) &=& -30f(x) & & & & & & & & & & \\ 16f(x-h) &=& 16 f(x)&-& 16h f'(x) &+& 8h^2 f''(x) &-& \frac{8}{3} h^3 f'''(x) &+& \frac{2}{3} h^4 f''''(x) &+& O(h^5) \\ -f(x-2h) &=& -f(x) &+& 2h f'(x) &-& 2h^2 f''(x) &+& \frac{4}{3} h^3 f'''(x) &-& \frac{2}{3} h^4 f''''(x) &+& O(h^5) \\ \end{eqnarray*}