# Derive error term by using Taylor series expansions.

Using Taylor series expansions, derive the error term for the formula $$f''(x)\approx \frac{1}{h^{2}}\left [ f(x)-2f(x+h)+f(x+2h) \right ].$$

I've tried it on my own way. We see that \begin{align*} f(x+h)&=\sum_{k=0}^{3}\frac{h^{k}}{k!}f^{(k)}(x)+E_{n}(h)\\ &=f(x)+hf'(x)+\frac{h^{2}}{2}f''(x)+\frac{h^{3}}{6}f'''(x)+E_{3}(h) \end{align*} \begin{align*} f(x+2h)&=\sum_{k=0}^{3}\frac{(2h)^{k}}{k!}f^{(k)}(x)+E_{n}(2h)\\ &=f(x)+2hf'(x)+2h^{2}f''(x)+\frac{4h^{3}}{3}f'''(x)+E_{3}(2h) \end{align*} and $$f(x+2h)-2f(x+h)=-f(x)+h^{2}f''(x)+h^{3}f'''(x)+E_{3}(2h)-E_{3}(h)$$ then by isolating $f''(x)$ we get $$f''(x)=\frac{1}{h^{2}}\left [ f(x+2h)-2f(x+h)+f(x) \right ]-hf'''(x)-\frac{1}{h^{2}}\left [E_{3}(2h)-E_{3}(h) \right ]$$ which isn't the right way to do since the term of "$-hf'''(x)$" is added (that's not mentioned in this problem). The rest is the error term. How do I answer it correctly?

-
Maybe it is a dumb question, but why don't you just stop at the $E_2$ terms? – Ian Mateus Oct 14 '13 at 0:24
$-(1/h^2) (E_3(2h) - E_3(h))$ isn't explicitly mentioned in this problem either. – Hurkyl Oct 14 '13 at 0:45
@IanMateus Thanks for your answer. It works! – AjmalW Oct 14 '13 at 1:23
@AjmalW: Right: but it's not the error term. The error term for the approximation you're proving $$-hf'''(x) - (1/h^2)(E_3(2h) - E_3(h))$$ (actually, I think your work is missing some factors of $2$, and that should probably be $2E_3(h)$) – Hurkyl Oct 14 '13 at 2:16
I suppose the confusion is over what the phrase "error term" means. In general, if we approximate $f$ with $g$, the error term to the approximation means $g - f$. $E_3(x,h)$, for example, is the error term when approximating $f(x)$ with its third order Taylor series. The error term for the approximation you're proving is not "the terms involving $E_3$", but instead "the difference between the two sides of the approximation". – Hurkyl Oct 14 '13 at 2:22

With the purpose of not leaving this question unanswered, this answer contains what OP already knows: stopping at $E_2$ is the cleanest way to go, since we already know how to express the error term of a Taylor series in convenient ways (Lagrange form, integral form). Some algebra quickly yields the error $h^{-2}(E_2(2h)-2E_2(h))$.