18.1 Midpoint Rule#
In the midpoint rule you approximate the area under the curve as a rectangle with the height as the function value at the midpoint of the interval:
Which can also be derived from a Taylor expansion [IntMid1].
This can be shown to have an error of:
for some \(\xi \in [a, b]\). Although we can’t actually determine the relevant \(\xi\), we can find an upper bound for the error by finding the maximum of \(f''\) in the interval of \([a, b]\). Note as the error is proportional to \((b - a)^3\), for a large interval (larger than 1) the midpoint rule is not very accurate.
Composite Midpoint Rule#
For a more accurate solution we can subdivide the interval into small sub-intervals, approximate the integral values for the sub-intervals and sum these. Let’s illustrate this for the midpoint rule:
For \(n\) subdivisions:
If these divisions are equal, then
which gives us:
This can be shown [IntMid1] to have an (global) error of:
for some different \(\xi \in [a, b]\). Remember, that we want to choose \(n\) so that \(h < 1\) to reduce the error.