Sign of the error in Simpson's rule Let $f : [a,b] \to \mathbb{R}$ be a $C^\infty$ function.  The Riemann integral $I = \int_a^b f(x)\,dx$ can be approximated by using Simpson's rule:
$$I \approx S = \frac{b-a}{6} \left[ f(a) + 4 f\left(\frac{a+b}{2}\right) + f(b) \right]$$
The error in this approximation is known to be controlled by the fourth derivative of $f$: 
$$|I-S| \le \frac{1}{90} \left(\frac{b-a}{2}\right)^5 \sup_{[a,b]} |f^{(4)}|.$$
Now with some other approximation rules for integrals, we can, under certain conditions, say something about the sign of the error.  For instance, if one uses the left endpoint approximation $L = (b-a) f(a)$, then if $f$ is increasing ($f' \ge 0$) we have $L \le I$.  Likewise, using the midpoint approximation $M = (b-a) f\left(\frac{a+b}{2}\right)$, it can be shown that if $f$ is concave up ($f'' \ge 0$) then we have $M \le I$.
Are there any simple conditions on $f$ that guarantee $S \le I$ (or vice versa)?  For instance, does it happen if the fourth derivative $f^{(4)}$ has a definite sign?
It would be particularly nice if this condition were "stable under subdivision".  That is, given any subdivision $\pi = \{a = x_0 < x_1 < \dots < x_n = b\}$, we can form a Simpson's rule approximation of the integral:
$$I \approx S_\pi = \sum_{i=1}^n \frac{x_n - x_{n-1}}{6} \left[ f(x_{n-1}) + 4 f\left(\frac{x_{n-1} + x_n}{2}\right) + f(x_n)\right].$$
I would be especially interested in any condition that guarantees $S_{\pi} \le I$ for every $\pi$.  (Analogously, having $f$ be an increasing function guarantees the corresponding fact for the left endpoint rule, as does concave up for the midpoint rule.)
 A: Set $x=(a+b)/2$, $h=(b-a)/2$ and consider 
$$
\frac{6\int_{x-h}^{x+h}f(t)dt-2h(f(x+h)+4f(x)+f(x-h))}{h^5}
$$
as a function in $h$ and apply the extended mean value theorem repeatedly to get
\begin{align}
&=\frac{4f(x+h_1)-8f(x)+4f(x-h_1)-2h_1(f'(x+h_1)-f'(x-h_1))}{5h_1^4}\\[1em]
&=\frac{2f'(x+h_2)-2f'(x-h_2)-2h_2(f''(x+h_2)+f''(x-h_2))}{20h_2^3}
\\ \\
&=\frac{2h_3(f'''(x+h_3)-f'''(x-h_3))}{60h_3^2}=\frac1{15}·\frac{f'''(x+h_3)-f'''(x-h_3)}{2h_3}
\\ \\
&=\frac1{15}·f^{(4)}(x+h_4)
\end{align}
where $|h_4|<h_3<h_2<h_1<h$. In the end, this means that
$$
I-S=\int_{a}^{b}f(t)dt-\frac{b-a}6·(f(a)+4f(\tfrac{a+b}2)+f(b))
=
\frac1{90}·\left(\tfrac{b-a}2\right)^5·f^{(4)}(a+\theta(b-a))
$$
with $θ\in(0,1)$. Thus the sign of $I-S$ depends on the sign of the 4th derivative, and it is only definite if the 4th derivative has constant sign over the interval. Under constant sign, this gives a stable inequality for all subdivisions of the interval.
A: Find a polynomial which matches $f$ at $-h, 0, h$ and $f'$ at $0$. It will have order 3 and the error term has order 4. More importantly, the polynomial factor has fixed sign, so you can pull out the fourth derivative from the integral using the mean value theorem of integration. Extend the result to an arbitrary interval in the usual manner.
