Here's a numerical analysis question which may not be very important, especially in practice, but has been bugging me.


Suppose $f$ is a continuous function on an interval $[a,b]$. Let $T\_n(f)$ be the
approximation to $\int\_a^b f$ using the trapezoid rule with $n$ subintervals of equal length, and $E\_n(f)$ the error $\int\_a^b f-T\_n(f)$. Simple examples show that $|E\_n(f)|$ does not necessarily decrease monotonically as $n$
increases, even if $f$ is a polynomial, although $|E\_n(f)|\to0$ if $f$ is continuous.
The question is: if $f$ is a polynomial, does $|E\_n(f)|$ eventually (for large enough $n$) decrease monotonically?
What if $f$ is merely smooth? Some smoothness is obviously needed: consider
$\int\_{-1}^1 |x|\,dx$. The same question can be asked about the midpoint rule or other schemes.



Monotonicity of Trapezoid Approximations
For convenience let the interval be $[0,1]$, and let's look at
the case $f(t) = t^p$. We have $E\_n(t^p) = 0$ for $p \le 1$, while by Faulhaber's formula we have 
$$\eqalign{E\_n(t^p) &= \dfrac{1}{p+1} + \dfrac{1}{2n} - \dfrac{1}{n^{p+1}} \sum\_{i=1}^{n} i^p\cr
&= - \sum\_{j=0}^{p-2} {p \choose j} \dfrac{B\_{p-j}}{j+1} n^{j-p} }$$
where $B\_{p-j}$ is a Bernoulli number.
For any polynomial $f$, $E\_n(f)$ is a linear combination of these, and for its asymptotic behaviour as $n \to \infty$ we take the least negative power of $n$ whose coefficient does not cancel out: $E\_n(f) \sim c n^{-k}$ for some nonzero constant $c$ and some integer $k \ge 2$. In particular its absolute value is monotonically decreasing for sufficiently large $n$.


EDIT: For smooth functions the behaviour can be more complicated. Consider e.g. 
a function $f$ that is periodic with period $1$. Write $f$ as a
Fourier series
$$ f(x) = \sum\_{m=-\infty}^\infty c\_m \exp(2\pi i m x)$$
and note that $T\_n(\exp(2\pi i m x) = 0$ unless $m$ is a multiple of $n$, in which case $T\_n(\exp(2\pi i m x) = 1$. Thus
$E\_n(f) = - \sum\_{k \ne 0} c\_{kn}$, which need not be monotonic. 


