Integration – Error in Trapezoidal Rule via Integral Mean Value Theorem

approximate integrationintegrationnumerical methods

During a class, I saw the following analysis of the error term in the trapezoidal rule

For $f \in C^2([a,b])$, $\int_a^b f(x) \,dx – \frac{b-a}{2}[f(a)+f(b)] = -\frac{(b-a)^3}{12}f''(\eta)$ for some $\eta \in (a,b)$

Proof

The error is $\int_a^b f(x) – p_1(x)\,dx$ where $p_1$ is the Langrange interpolant of $f$ at $a,b$. We have $f(x) – p_1(x) = (x-a)(x-b) \frac{f''(\zeta(x))}{2}$ for some $\zeta(x) \in (a,b)$ so by the integral mean value theorem $$\int_a^b f(x) \,dx – \frac{b-a}{2}[f(a)+f(b)] = \int_a^b (x-a)(x-b)\frac{f''(\zeta(x))}{2} \, dx = $$

$$f''(\eta) \int_a^b \frac{(x-a)(x-b)}{2} \,dx \text{ for some } \eta \in (a,b)$$ and then computing the integral gives the result.

The derivation I know for the error term for the Lagrange interpolant (in general) involves repeated applications of Rolle's theorem. In particular, the proof of existence of suitable $\zeta(x)$ is non-constructive so we don't know that $\zeta(x)$ is continuous, which I think is a problem for applying the integral mean value theorem since $f''\circ \zeta$ may not be continuous even though $f''$ is.

I've since seen this proof in a few different places and all of them pass over this issue without comment. Why is it that we can apply the integral mean value theorem here?

Edit: I've changed the proposition to be for $f$ twice continuously differentiable on $[a,b]$ rather than on $(a,b)$. Given this is a requirement in the IMVT I imagine this was either a typographical error either in my memory or in the original proof.

Best Answer

The proposition is simpler than implied because $$\frac{(x-a)(x-b)}2\le0$$ For all $x\in[a,b]$. Thus $$\frac{(x-a)(x-b)}2\max\left(f^{\prime\prime}(x)\right)\le\frac{(x-a)(x-b)}2f^{\prime\prime}(\zeta(x))\le\frac{(x-a)(x-b)}2\min\left(f^{\prime\prime}(x)\right)$$ And so $$\begin{align}\max\left(f^{\prime\prime}(x)\right)\int_a^b\frac{(x-a)(x-b)}2dx&\le\int_a^b\frac{(x-a)(x-b)}2f^{\prime\prime}(\zeta(x))dx\\ &\le\min\left(f^{\prime\prime}(x)\right)\int_a^b\frac{(x-a)(x-b)}2dx\end{align}$$ Now $$\int_a^b\frac{(x-a)(x-b)}2f^{\prime\prime}(\zeta(x))dx=f^{\prime\prime}(\eta)\int_a^b\frac{(x-a)(x-b)}2dx$$ Follows from the continuity of $f^{\prime\prime}(x)$ and the intermediate value theorem.