3
$\begingroup$

How can we use Taylor series to derive the truncation error of the approximation

$$f^\prime(x)\approx\frac{f(x+h)-f(x-h)}{2h}$$

$\endgroup$
4
$\begingroup$

Hint: Start by taking the Taylor polynomial of degree 2 for $f(x+h)$ (as a function of $h$), and then substitute $-h$ for $h$ in this...

$\endgroup$
  • $\begingroup$ I thought i could do it like this .... f(x+h) = f(x) + h*f'(x) + 0*(h^2)/2! (taylor series) then truncation error = (f'(x+h) - f'(x)) / h = (f(x)+hf'(x) - f'(x) )/h (by sub in the taylor series above) $\endgroup$ – Sunday May 12 '11 at 6:15
  • $\begingroup$ @Sunday: In Taylor's Theorem, you may wish to go one term further. $\endgroup$ – André Nicolas May 12 '11 at 6:27
  • $\begingroup$ hmm is that right $\endgroup$ – Sunday May 12 '11 at 6:41
  • $\begingroup$ @Sunday: Yes, try $f(x+h)=f(x)+hf'(x)+ (h^2/2)f''(x) + \text{error term}$. You need $f(x)$ to be reasonably well-behaved. $\endgroup$ – André Nicolas May 12 '11 at 6:47
  • $\begingroup$ @Sunday: You lose some accuracy, if you don't take advantage of the $h\leftrightarrow-h$ symmetry of the R.H.S. As a toy example compute both $(f(x+h)-f(x-h))/2h$ and $(f(x+h)-f(x))/h$ at the local minimum of $f(x)=x^2$. $\endgroup$ – Jyrki Lahtonen Jul 5 '11 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.