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}$$

1 Answers 1

4

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...

  • 0
    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)2011-05-12
  • 0
    @Sunday: In Taylor's Theorem, you may wish to go one term further.2011-05-12
  • 0
    hmm is that right2011-05-12
  • 0
    @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.2011-05-12
  • 0
    @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$.2011-07-05