5

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

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 \begin{equation} f(x+2h)-2f(x+h)=-f(x)+h^{2}f''(x)+h^{3}f'''(x)+E_{3}(2h)-E_{3}(h) \end{equation} then by isolating $f''(x)$ we get \begin{equation} 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 ] \end{equation} 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?

UnknownW
  • 2,008
  • 2
    Maybe it is a dumb question, but why don't you just stop at the $E_2$ terms? – Ian Mateus Oct 14 '13 at 00:24
  • $-(1/h^2) (E_3(2h) - E_3(h))$ isn't explicitly mentioned in this problem either. –  Oct 14 '13 at 00:45
  • @IanMateus Thanks for your answer. It works! – UnknownW Oct 14 '13 at 01:23
  • @Hurkyl Yes true, but it's the error term, which "$-hf''(x)$" isn't a part of it. – UnknownW Oct 14 '13 at 01:24
  • @AjmalW: No, it's not the error term: your work shows it's only part of the error term, and $-hf'''(x)$ is the other part. –  Oct 14 '13 at 02:02
  • (aside: although your method only works if $f$ is three times differentiable) –  Oct 14 '13 at 02:02
  • @Hurkyl: I meant that $-(1/h^{2})(E_{3}(2h)-E_{2}(h))$ is the error term while the $-hf'''(x)$ isn't (and yes it's the other part, I agree). I'm sorry I didn't express properly. But thanks for your answer :). – UnknownW Oct 14 '13 at 02:13
  • 1
    @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)$) –  Oct 14 '13 at 02:16
  • 1
    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". –  Oct 14 '13 at 02:22

2 Answers2

1

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

Ian Mateus
  • 7,431
0

As a central difference quotient for the position $x+h$, the Taylor expansion of the expression starts as $$ \frac1{h^{2}}[f(x)-2f(x+h)+f(x+2h)]=f''(x+h)+\frac{h^2}{12}f^{(4)}(x+h)+O(h^4). \tag{*}\label{eq:1} $$

By Taylor expansion of the second derivative $g(x)=f''(x)$ one gets that the deviation from $x$ to $x+h$ expands as \begin{align} f''(x+h)=g(x+h)&=g(x)+g'(x)h+\frac{h^2}2g''(x)+O(h^3) \\ &=f''(x)+hf'''(x)+\frac{h^2}2f^{(4)}(x)+O(h^2). \tag{**}\label{eq:2} \end{align}

Inserting \eqref{eq:2} into \eqref{eq:1} gives in total $$ \frac1{h^{2}}[f(x)-2f(x+h)+f(x+2h)]=f''(x)+hf'''(x)+\frac{7h^2}{12}f^{(4)}(x)+O(h^3), $$ so that the error term from the question should be $$ -hf'''(x)-\frac{7h^2}{12}f^{(4)}(x)+O(h^3). $$ Obviously the linear error term is the dominant one. So up to the missing $2$ in front of $E_3(h)=h^4R_3(h)$ as mentioned in the comments, the calculation is correct.

Lutz Lehmann
  • 126,666