Subsection 1.11.5 Optional — An error bound for the midpoint rule
We now try develop some understanding as to why we got the above experimental results. We start with the error generated by a single step of the midpoint rule. That is, the error introduced by the approximation
To do this we are going to need to apply integration by parts in a sneaky way. Let us start by considering 13 We chose this interval so that we didn't have lots of subscripts floating around in the algebra. a subinterval \(\alpha \leq x \leq \beta\) and let's call the width of the subinterval \(2q\) so that \(\beta=\alpha+2q\text{.}\) If we were to now apply the midpoint rule to this subinterval, then we would write
since the interval has width \(2q\) and the midpoint is \(\alpha+q=\beta-q\text{.}\)
The sneaky trick we will employ is to write
and then examine each of the integrals on the right-hand side (using integration by parts) and show that they are each of the form
Let us apply integration by parts to \(\int_\alpha^{\alpha+q} f(x)\dee{x}\) — with \(u=f(x), \dee{v}=\dee{x}\) so \(\dee{u}=f'(x)\dee{x}\) and we will make the slightly non-standard choice of \(v=x-\alpha\text{:}\)
Notice that the first term on the right-hand side is the term we need, and that our non-standard choice of \(v\) allowed us to avoid introducing an \(f(\alpha)\) term.
Now integrate by parts again using \(u=f'(x), \dee{v}=(x-\alpha)\dee{x}\text{,}\) so \(\dee{u}=f''(x), v = \frac{(x-\alpha)^2}{2}\text{:}\)
To obtain a similar expression for the other integral, we repeat the above steps and obtain:
Now add together these two expressions
Then since \(\alpha+q=\beta-q\) we can combine the integrals on the left-hand side and eliminate some terms from the right-hand side:
\begin{align*} \int_\alpha^\beta f(x)\dee{x} &= 2q f(\alpha+q) + \int_\alpha^{\alpha+q} \frac{(x-\alpha)^2}{2}f''(x)\dee{x} + \int_{\beta-q}^\beta \frac{(x-\beta)^2}{2}f''(x)\dee{x} \end{align*}Rearrange this expression a little and take absolute values
where we have also made use of the triangle inequality 14 The triangle inequality says that for any real numbers \(x,y\) \(|x+y| \leq |x| + |y|.\). By assumption \(|f''(x)| \leq M\) on the interval \(\alpha \leq x \leq \beta\text{,}\) so
where we have used \(q = \frac{\beta-\alpha}{2}\) in the last step.
Thus on any interval \(x_i \leq x \leq x_{i+1}=x_i+\De x\)
Putting everything together we see that the error using the midpoint rule is bounded by
as required.
A very similar analysis shows that, as was stated in Theorem 1.11.13 above,
- the total error introduced by the trapezoidal rule is bounded by \(\ds \frac{M}{12}\frac{(b-a)^3}{n^2}\text{,}\)
- the total error introduced by Simpson's rule is bounded by \(\ds \frac{M}{180}\frac{(b-a)^5}{n^4}\)