Let $I(f)=\int_a^b f(x)\, dx$. The midpoint rule (open Newton-Cotes for $n=0$) is $I_0(f)=(b-a)f(\frac{a+b}{2})$
Show: For $f\in C^1([a,b])$ holds $|I(f)-I_0(f)|\leq \frac{(b-a)^2}{4}\|f'\|_\infty$
In the lecture we have shown some error estimations, which should not work here. They require, that $I_n$ is exact of order $n$. But $I_0(f)$ should not be exact at all:
Let $I_n$ be a quadrature formula, which is exact of order $n$. Let $f\in C^1([a,b])$, $W(x)=\prod_{j=0}^n (x-x_j)$, then is $|I(f)-I_n(f)|\leq C_n\|f^{n+1}\|_\infty$ where $C_n=\frac{1}{(n+1)!}\int_a^b w(x)|W(x)|\, dx$.
[w(x) should be the polynomial \prod_{k=0}^m (x-x_k), where $x_0,\dotso, x_k$ are the support points of a polynomial interpolation.]
An other error estimation requires $n>0$ because in the formula you have $h=\frac{b-a}{n}$, but here $n=0$.
Let $f\in C^{n+1}([a,b])$. For the closed Newton-Cotes formula is $|I(f)-I_n(f)|\leq h^{n+2}c_n\|f^{(n+1)}\|_\infty$, $h=\frac{b-a}{n}$ where $c_n=\frac{1}{(n+1)!}\int_0^n\prod_{k=0}^n |t-k|\, dt \|w\|_\infty$
So both error estimations should not work here. How can I approach this problem? It should not be to difficult, but I am stuck.
Do you have a hint? Thanks in advance.
Define interval length $h =b-a$ and midpoint $c = (a+b)/2$.
Note that $b-c = c-a = (b-a)/2 = h/2.$
The midpoint approximation error is
$$E_M = \int_{a}^{b} f(x) \, dx - hf(c) = \int_{a}^{b} [f(x) - f(c)] \, dx.$$
Using a Taylor approximation (or MVT), there exists $\xi_x$ between $x$ and $c$ such that
$$f(x) = f(c) + f'(\xi_x)(x-c) $$
We get
$$|E_M| = \left|\int_{a}^{b} f'(\xi_x)(x-c) \, dx\right| \leqslant\int_{a}^{b} |f'(\xi_x)||x-c| \, dx\leqslant \|f'\|_\infty\int_{a}^{b} |x-c| \, dx = \frac{h^2}{4} \|f'\|_\infty$$
Note that
$$\int_{a}^{b} |x-c| \, dx = \int_c^b (x-c)\, dx + \int_a^c (c - x) \, dx = \frac{1}{2}(b-c)^2 + \frac{1}{2} (c-a)^2 = \frac{1}{2} \frac{h^2}{4} + \frac{1}{2} \frac{h^2}{4} = \frac{h^2}{4}$$