1

From a proof of Simpson's rule using Taylor polynomial where $f\in[x_{0},x_{2}]$ and, for $$x_{1}=x_{0}+h$$ where $$h=\frac{x_{2}-x_{0}}{2}$$, it got: $$\int_{x_{0}}^{x_{2}}f(x)dx\cong2hf(x_{1})+h^{3}\frac{f''(x_{1})}{3}+h^{5}\frac{f^{(4)}(\xi)}{60}$$ and then, it changed $f''(x_{1})$ by $$\frac{f(x_{0})-2f(x_{1})+f(x_{2})}{h^{2}}$$ And I don't know from where it came.

mvfs314
  • 2,017
  • 15
  • 19
  • 4
    That's the central difference quotient for $f''$ – Simply Beautiful Art Dec 17 '19 at 22:37
  • One way to approximate the second derivative is through finite difference methods. The second-order central finite difference is

    $$f''(x) = \frac{f(x-h) - 2 f(x) + f(x+h)}{h^{2}}+\mathcal{O}(h^2)$$

    where at $x=x_1$

    $$f''(x_1) \approx \frac{f(x_0) - 2 f(x_1) + f(x_2)}{h^{2}}$$

    Do you have any other questions about the proof?

    – Axion004 Dec 18 '19 at 03:27

1 Answers1

1

The author of the proof replaces $f''(x_1)$ with its second-order central finite difference formula. Given a small $h>0$ which represents the difference between grid points $x_j$ and $x_{j-1}$, the formula can be derived by adding the two Taylor expansions

$$f(x-h)=f(x)-hf'(x)+\frac{h^2f''(x)}{2!}-\frac{h^3f'''(x)}{3!}+\mathcal{O}(h^4)$$ and $$f(x+h)=f(x)+hf'(x)+\frac{h^2f''(x)}{2!}+\frac{h^3f'''(x)}{3!}+\mathcal{O}(h^4)$$

to form

$$f(x-h)+f(x+h)=2f(x)+h^2f''(x)+\mathcal{O}(h^4)$$

which after subtracting $2f(x)$ and dividing by $h^2$ produces

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

in your case the grid points are $x=x_1$, $x-h=x_0$, and $x+h=x_2$ therefore

$$f''(x_1)\approx \frac{f(x_0)-2f(x_1)+f(x_2)}{h^2}$$

Axion004
  • 10,056