Computing derivative as accurately as possible by finite difference formula

extrapolationfinite differencesnumerical methods

The central difference formula is $D_h(x)=\frac{f(x+h)-f(x-h)}{2h}$.

In the form $(x,f(x))$ am given the data points $(0.40, 2.3987), (0.44, 2.4182), (0.48, 2.4377), (0.52, 2.4571), (0.56, 2.4764)$. Using the central difference formula, I am asked to compute $f'(0.48)$ as accurately as possible from this, assuming that the function values $f(x)$ are evaluated with error at most $±1\times10^{-3}$ and assuming that $|f^{'''}(x)|\leq1$ for all $x$.

My first guess was to use Richardson extrapolation $D_h(x)=\frac{4D_{h/2}(x) – D_h(x)}{3}$ with $h=0.08$ since we have the data needed for this formula, and this is 4th order accurate, which is an improvement on the 2nd order accurate central difference formula. But surely my solution must make use of the fact that $|f^{'''}(x)|\leq1$ and that the function values are evaluated with error at most $±1\times10^{-3}$, and I don't know how to make use of these.

Best Answer

The error of the central difference, with the given data about the value accuracy and third derivative, is about $$ \frac{\max|f_{\rm eval}(x)-f(x)|}{h}+\frac{h^2}6|f'''|=\frac{10^{-3}}h+\frac{h^2}6 $$ This is minimal for $h\approx \sqrt[3]{3\cdot 10^{-3}}\approx 0.1442249$. Both step sizes $0.04$ and $0.08$ are smaller than that, which means that in computing the derivative the evaluation error dominates. This means that the larger step size will give the more stable result, $h=0.04$ gives the error bound $0.025$ and $h=0.08$ the better error bound $0.014$.

Assuming that also the higher derivatives have a size about $1$, the error of the Richardson extrapolation formula $$ D_4(h)=\frac{4D_2(h/2,x)-D_2(h,x)}{3}=\frac{-f(x+h)+8f(x+h/2)-8f(x-h/2)+f(x-h)}{6h} $$ is $$ \frac{(1+8+8+1)\max|f_{\rm eval}(x)-f(x)|}{6h}+\frac{h^4}{3\cdot 5!}\left|\frac{4}{2^5}-1\right||f^{(5)}|=\frac{3\cdot 10^{-3}}{h}+\frac{7h^4}{2880} $$ so that the best step size is about $\sqrt[5]{0.309}\approx0.790$ so that $h=0.08$ is far away from the useful step sizes, with the evaluation error dominating to get a bound of $0.03750$.

In summary, the simple central difference with the larger step size is barely acceptable and gives 2 digits after the dot, all other variants are expected to give worse results.

Related Question