[Math] “Symmetric” numerical computation of second derivative

derivativesnumerical methods

When numerically computing a first derivative, it is better to use

$$f'(x) \approx \frac{f(x + \Delta x / 2) – f(x – \Delta x / 2)}{\Delta x}$$

than to use

$$f'(x) \approx \frac{f(x + \Delta x) – f(x)}{\Delta x}$$

since it's more symmetric, and hence typically more accurate.

However, what is the equivalent of this phenomenon in the second derivative case?

In other words, the obvious candidate formula is

$$f''(x) \approx \frac{f'(x + \Delta x / 2) – f'(x – \Delta x / 2)}{\Delta x}$$

but is there a more accurate ("symmetric"?) approximation for the second derivative as is the case for the first derivative?

Best Answer

Just by inserting your first into the last equation you readily find the symmetric formula $$ f''(x)≈\frac{f(x+Δx)−2\,f(x)+f(x-Δx)}{Δx^2} $$ with error $O(Δx^2)$.