Numerical Methods – Deriving Error of Simpson’s Rule from Taylor Expansion

numerical methodsnumerical-calculus

I am reading a numerical analysis textbook. In the chapter numerical integration, I followed one exercise as it gives the hint:

For interval $[a,b]$, let $h=\frac{b-a}{2}$. Use Taylor expansion to derive
$$\int_{a}^{b}f(x)\mathrm{d}x=2hf(\frac{a+b}{2})+\frac{h^3}{3}f''(\frac{a+b}{2})+\frac{h^5}{60}f^{(4)}(\frac{a+b}{2})+O(h^7)+\cdots$$

I got that expression without difficulty. Next I tried to use Taylor expansion to Simpson's rule to get:
$$I(f)=\frac{h}{3}[f(a)+4f(\frac{a+b}{2})+f(b)]=2hf(\frac{a+b}{2})+\frac{h^3}{3}f''(\frac{a+b}{2})+\frac{h^5}{36}f^{(4)}(\frac{a+b}{2})+O(h^7)+\cdots$$

The error $E(f)=\int_{a}^{b}f-I(f)$ is:
$$-\frac{1}{90}h^{5}f^{(4)}(\frac{a+b}{2})+O(h^7)+\cdots$$

However, as we know the error of Simpson's rule should be $-\frac{1}{90}h^{5}f^{(4)}(\xi)$ where $\xi\in(a,b)$. Since I got the fixed midpoint $x=\frac{a+b}{2}$, how to 'prove' that $\xi$ in error term? I have viewed this kind of question on MSE, but none of these answers used Taylor expansion method.

So I came out one idea, suppose $f^{(4)}$ and $f^{(5)}$ are both continuous, how about changing the $h^5$ term to
$$-\frac{1}{90}h^5 f^{(4)}(\xi)+\left(-\frac{1}{90}h^{5}f^{(4)}(\frac{a+b}{2})+\frac{1}{90}h^5 f^{(4)}(\xi)\right)=-\frac{1}{90}h^5 f^{(4)}(\xi)+\frac{1}{90}h^5\cdot\left(\left|\frac{a+b}{2}-\xi\right|f^{(5)}(\eta)\right)$$

Best Answer

According to @Kakashi's comment, I solved it with integral remainders in Taylor expansion. It's well-known that for a function $f$ with at least $n+1$ order derivatives, it could be expanded as: $$f(h)=\sum_{k=0}^{n}\frac{f^{(k)}(0)}{k!}h^{k}+\frac{1}{n!}\int_{0}^{h}f^{(n+1)}(t)(h-t)^{n}\mathrm{d}t$$ For interval $[a,b]$, let $h=\frac{b-a}{2}$, define error function $E(u)$ when $u\in[0,h]$: $$E(u)=\int_{-u}^{u}f(t)\mathrm{d}t-\frac{u}{3}\left(f(-u)+4f(0)+f(u)\right)$$ It's easy to know $E(0)=E'(0)=E''(0)=0$ and $E^{(3)}(u)=\frac{u}{3}(f^{(3)}(-u)-f^{(3)}(u))$. $$E(h)=\frac{1}{6}\int_{0}^{h}(f^{(3)}(-t)-f^{(3)}(t))t(h-t)^2\mathrm{d}t$$ By integral mean value theorem, there exists $\eta\in(0,h)$ and $\theta\in(0,\eta)$ that $$E(h)=\frac{f^{(3)}(-\eta)-f^{(3)}(\eta)}{180\eta}h^5=\frac{f^{(4)}(\theta)(-2\eta)}{180\eta}h^5=-\frac{h^5}{90}f^{(4)}(\theta)$$