error of the composite trapezoidal rule

Let $f\in C^2[a,b]$. The composite trapezoidal rule is given by $$T_n[f]:=h\left(\frac{f(a)+f(b)}{2}+\sum_{k=1}^{n-1}f(x_k)\right)\;\;\;\;\;\left(h:=\frac{b-a}{n},\;x_k:=a+kh\right)$$

First, I've shown, that it holds: $$\int_{[a,b]}f(x)\text{ dx}-T_1[f]=-\frac{(b-a)^3}{12}f''(\xi)$$ After that, It's easy to see, that it holds: \begin{equation} \begin{split} \int_{[a,b]}f(x)\text{ dx}-T_n[f] &= \left|\sum_{k=1}^n\left(\int_{x_{k-1}}^{x_k}f(x)\text{ dx}-T_1[f|_{[x_{k-1},x_k]}]\right)\right| \\ &= \left|\sum_{k=1}^n\left(-\frac{(x_k-x_{k-1})^3}{12}f''(\xi_k)\right)\right\| \\ &\le \frac{b-a}{12}\displaystyle\max_{x\in [a,b]}|f''(x)|h^2 \end{split} \end{equation}

So, this leads to my question. I'm asked to show, that if $f''\in L^2(a,b)$, then it holds: $$\left|\int_{[a,b]}f(x)\text{ dx}-T_n[f]\right|\le\frac{\sqrt{b-a}}{\sqrt{120}}\left\|f''\right\|_{L^2(a,b)}h^2$$ How can I conclude this error bound from my previous result?

• Can you give your source ? – Tony Piccolo Jan 20 '14 at 17:57
• @TonyPiccolo - Do you mean the error bound $$\frac{\sqrt{b-a}}{\sqrt{120}}\left\|f''\right\|_{L^2(a,b)}h^2$$ I was asked to prove it. – 0xbadf00d Jan 21 '14 at 10:10

My reference is Dragomir, Cerone, Sofo - Some remarks on the trapezoid rule in numerical integration (2000): I adapted their work (lemma 1 and theorem 1) to your question.

One starts from the formula $$\int_a^b f(x)\,dx=\frac {(b-a)}2[f(a)+f(b)]-\frac 12\int_a^b(x-a)(b-x)f''(x)\,dx$$that will be proved later.

Applying the inequality of the modulus of an integral and the Cauchy's integral inequality, one has $$\left|\int_a^b f(x)\,dx-\frac {(b-a)}2[f(a)+f(b)]\right|$$$$\le\frac 12\int_a^b(x-a)(b-x)|f''(x)|\,dx$$$$\le \frac 12 \sqrt {\int_a^b (x-a)^2(b-x)^2\,dx} \cdot\sqrt {\int_a^b[f''(x)]^2\,dx}$$$$=\frac 1{\sqrt {120}}\sqrt{(b-a)^5}\sqrt {\int_a^b[f''(x)]^2\,dx}$$Now the composite rule.

Applying Cauchy's sum inequality in the third inequality, one has $$\left|\int_a^bf(x)\,dx-T_n(f) \right|$$$$\le\sum_{k=1}^n\,\left|\int_{x_{k-1}}^{x_k}f(x)\,dx-\frac{(x_k-x_{k-1})}2[f(x_{k-1})+f(x_k)]\right|$$$$\le \frac 1{\sqrt {120}}\sum_{k=1}^n \left[\sqrt{\left(\frac {b-a}n\right)^5}\cdot \sqrt {\int_{x_{k-1}}^{x_k}[f''(x)]^2\,dx} \right]$$$$\le \frac 1{\sqrt {120}}\sqrt {\sum_{k=1}^n\left(\frac {b-a}n\right)^5}\cdot\sqrt {\sum_{k=1}^n\int_{x_{k-1}}^{x_k}[f''(x)]^2\,dx}$$$$\le \frac 1{\sqrt {120}}\sqrt {n\left(\frac {b-a}n\right)^5}\sqrt {\int_a^b[f''(x)]^2\,dx}$$$$=\frac {\sqrt{b-a}}{\sqrt{120}}\left(\frac{b-a}n \right)^2\|f''\|_2$$

Proof of the initial formula:

integrating by parts (two times), one has $$\int_a^b(x-a)(b-x)f''(x)\,dx$$$$=[(x-a)(b-x)f'(x)]_a^b-\int_a^b[(a+b)-2x]f'(x)\,dx$$$$=\int_a^b[2x-(a+b)]f'(x)\,dx$$$$=f(x)[2x-(a+b)]_a^b-2\int_a^bf(x)\,dx$$$$=(b-a)[f(a)+f(b)]-2\int_a^bf(x)\,dx$$

Final remark:$$\int_a^b(x-a)(b-x)|f''(x)|\,dx$$$$\le \int_a^b(x-a)(b-x)\,dx \cdot \max_{x \in [a,b]}|f''(x)|$$$$=\frac {(b-a)^3}6 \cdot \max_{x \in [a,b]}|f''(x)|$$and one has the usual error bound.