2
$\begingroup$

The "standard" second-derivative centered finite-difference approximation is given by LeVeque as \begin{equation} u''(x)\approx\frac{u(x+h)+u(x-h)-2u(x)}{h^2}\,. \end{equation} So if I insert \begin{equation} u(x+h)=u(x)+h u'(x)+\frac{1}{2} h^2 u''(x)+\frac{1}{6} h^3 u^{(3)}(x)+\frac{1}{24} h^4 u^{(4)}(x)+\mathcal{O}\left(h^5\right) \end{equation} and \begin{equation} u(x-h)=u(x)-h u'(x)+\frac{1}{2} h^2 u''(x)-\frac{1}{6} h^3 u^{(3)}(x)+\frac{1}{24} h^4 u^{(4)}(x)+\mathcal{O}\left(h^5\right) \end{equation} into the first equation, the $u(x)$, $u'(x)$, and $u'''(x)$ terms cancel, and the rest are divided by $h^2$ to give \begin{equation} u''(x)+\frac{1}{12} h^2 u^{(4)}(x)+\mathcal{O}\left(h^3\right)\,. \end{equation} Here I am assuming that \begin{equation} \frac{\mathcal{O}(h^5)}{h^2}=\mathcal{O}(h^3)\,. \end{equation} But LeVeque says the result should be \begin{equation} u''(x)+\frac{1}{12} h^2 u^{(4)}(x)+\mathcal{O}\left(h^4\right)\,. \end{equation} Where have I gone wrong?

$\endgroup$
1
  • 5
    $\begingroup$ All of the odd degree terms cancel, provided enough regularity for them to even exist. $\endgroup$
    – Ian
    Commented Jan 7, 2018 at 19:44

1 Answer 1

1
$\begingroup$

If you can't get the answer from the comment, write one more term. \begin{equation} \begin{aligned} u(x+h)&=u(x)+hu'(x)+\frac{1}{2} h^2 u''(x)+\frac{1}{6} h^3 u^{(3)}(x)+\frac{1}{24} h^4 u^{(4)}(x)+\frac{1}{120} h^5 u^{(5)}(x)+\operatorname{O}\left(h^6\right) \\ u(x-h)&=u(x)-hu'(x)+\frac{1}{2} h^2 u''(x)-\frac{1}{6} h^3 u^{(3)}(x)+\frac{1}{24} h^4 u^{(4)}(x)-\frac{1}{120} h^5 u^{(5)}(x)+\operatorname{O}\left(h^6\right) \end{aligned} \end{equation} Add these two equations and observe that the odd degree terms cancel out. \begin{equation} u(x+h)+u(x-h)=2u(x)+h^2\left(u''(x)+\frac{1}{12} h^2 u^{(4)}(x)+\operatorname{O}\left(h^4\right)\right) \end{equation} This shows the desired error of the centered finite-difference approximation of the second derivative. $$\frac{u(x+h)+u(x-h)-2u(x)}{h^2}=u''(x)+\frac{1}{12} h^2 u^{(4)}(x)+\operatorname{O}\left(h^4\right)$$

$\endgroup$
1
  • 1
    $\begingroup$ Note that this almost entirely follows by symmetry considerations: $\frac{f(x+h)+f(x-h)-2f(x)}{h^2}$ is invariant under $h \mapsto -h$. $\endgroup$
    – Ian
    Commented Jan 9, 2018 at 17:37

You must log in to answer this question.