Error of the extended rules
Using (8), we have for the midpoint rule that
As
, the term in brackets approaches a constant
(namely,
). Thus, the leading order
error in the midpoint rule is second order in
. Moreover, the term
in brackets is, in fact, the midpoint rule for computing
! Thus, we may complete the analysis and compute precisely
the numerical prefactor on
,
The trapezoid rule therefore errs in the second order with a
prefactor proportional to
! If, by coincidence or
design,
, the midpoint rule becomes correct to fourth
order!
Working in the same way from (11), we have for the
trapezoid rule,
where we have twice used the result (15). The
trapezoid rule thus also becomes fourth-order if
, and
sixth-order if also
.
Because the error series for both
and
involve only even
terms with numerical prefactors times the respective derivatives of
, we see that the full expansion for the error of the
trapezoid rule has the form
for some set of numerical coefficients
1. Thus, if we could arrange for
all of the derivatives of
to be equal at the endpoints
and
, then the trapezoid rule will converge faster than
to
any power -- exponentially! This is not so artificial as first
appears: a very common case is the numerical integration of periodic
functions.
Tomas Arias
2004-01-26