Forward – backward differencing = central differencing

derivativesnumerical methodsnumerical-calculustaylor expansiontruncation error

From Taylor series, we can derive:

Forward Differencing Formula:

$$ f'(x_{i}) = \frac{f(x_{i+1}) – f(x_{i})}{h} – \frac{f''(x_{i})h}{2!} $$
$$\tag 1 f'(x) \approx \dfrac{f(x+h)-f(x)}{h}$$ (1)

Backward Differencing Formula:

$$ f'(x_{i}) = \frac{f(x_{i}) – f(x_{i-1})}{h} + \frac{f''(x_{i})h}{2!} $$
$$\tag 1 f'(x) \approx \dfrac{f(x)-f(x-h)}{h}$$ (2)

I know that in order to calculate the central differencing formula, we subtract (2) from (1). However, I am unable to do the subtraction properly. I must obtain an error term consisting of 1/6 after the subtraction, along with the central differencing formula. However, I just get 2f(x+h)…. which is wrong.

A step by step subtraction would be really helpful.

Best Answer

First we must assume that $f$ is three times continuously differentiable, $f\in C^3$, then we can calculate the Taylor series of $f$ around $x_i$, $$ f(x_i + h) = f(x_i) + h f'(x_i) + \frac{h^2}{2} f''(x_i) + \frac{h^3}{6} f'''(\xi_+) \tag{I} \label{1} $$ with $\xi_+ \in [x_i, x_i+h]$. In addition we approximate in the other direction $$ f(x_i - h) = f(x_i) - h f'(x_i) + \frac{h^2}{2} f''(x_i) - \frac{h^3}{6} f'''(\xi_-) \tag{II}\label{2} $$ with $\xi_- \in [x_i, x_i - h]$. Now we subtract \eqref{2} from \eqref{1} $$ f(x_i + h) - f(x_i - h) = 2 h f'(x_i) + \frac{h^3}{6} f'''(\xi_+) + \frac{h^3}{6} f'''(\xi_-) $$ which we can rewrite to $$ f'(x_i) = \frac{f(x_i + h) - f(x_i - h)}{2h} - \frac{h^2}{12} f'''(\xi_+) - \frac{h^2}{12} f'''(\xi_-) \tag{III} \label{3} $$ Now here comest the kicker. As the function $f'''(x)$ is continuous, we can use the Intermediate Value Theorem to conclude that $f'''(x)$ must attain all values between $f'''(\xi_-)$ and $f'''(\xi_+)$. Specifically it must attain the mean of these values. Mathematically put, there must exists $\xi \in [x_i - h, x_i + h]$ such that $$ f'''(\xi) = \frac{f'''(\xi_-) + f'''(\xi_+)}{2} $$ which means we can rewrite \eqref{3} as $$ f'(x_i) = \frac{f(x_i + h) - f(x_i - h)}{2h} - \frac{h^2}{6} f'''(\xi) $$ for $\xi \in [x_i - h, x_i + h]$.