Midpoint rule vs trapezoidal rule accuracy

calculusdefinite integralsintegrationnumerical methods

If we compute the exact value of $\int_1^2\frac1x\,dx$ we get $\ln2=0.693147\dots$ If we use the trapezoidal rule with $10$ intervals we get $0.693771$, and the midpoint rule with $10$ intervals gives $0.692835$.

Here it seems as if the trapezoidal rule is more accurate than the midpoint rule, even though we are told that the absolute value of the midpoint rule's error is half that of the trapezoidal rule, so the midpoint rule should be more accurate. Why?

Best Answer

The error bounds for classical numerical integration rules constrain nothing about the actual errors incurred when applying them to any function. It may be that the trapezoidal rule produces an exact result for a certain number of intervals while the midpoint rule does not, it may be the other way around, etc. – anything is possible when comparing the actual errors.

Instead the error bounds only give the asymptotic behaviour of the error as the number of intervals increases.