Use the Taylor expansion

$$f(x+h) = f(x) + f'(x)h + \frac{1}{2}f''(x)h^2 + \frac{1}{6}f'''(x)h^3 + O(h^4)$$

to derive the second order difference quotient for the second derivative and show that it is a $O(h^2)$ approximation.

# Derivation of the second order difference quotient

mark

Invictus

Using that:

$$f(x+h) = f(x) + f'(x)h + \frac{1}{2}f''(x)h^2 + \frac{1}{6}f'''(x)h^3 + O(h^4)$$

we also know that:

$$f(x-h) = f(x) - f'(x)h + \frac{1}{2}f''(x)h^2 - \frac{1}{6}f'''(x)h^3 + O(h^4)$$

If we add the two together the $f'(h)$ and the $\frac{1}{6}f'''(x)h^3$ cancel leaving you with:

$$f(x+h) + f(x-h) = 2f(x) + f''(x)h^2 + O(h^4)$$

Now we just solve for $f''(x)h^2$ which gives you:

$$f''(x)h^2=f(x+h) + f(x-h) - 2f(x) + O(h^4)$$

We then divide by $h^2$ but since $$\frac{O(h^4)}{h^2} = O(\frac{h^4}{h^2})$$ we get:

$$f''(x)=\frac{f(x+h) + f(x-h) - 2f(x)}{h^2} + O(h^2)$$