TITLE: Proof of bound on $\int t\,f(t)\ dt$ given well-behaved $f$
QUESTION [14 upvotes]: I got the following question by mail from someone I don't know from Adam. (Quoted in part.)

if $f(t)$ continuously diff. on $[0,1]$ and
a) $\int_0^1f(t)\ dt=0$
b) $m\le f\,'\le M$ on $[0,1]$
Prove
$\frac m{12}\le\int_0^1t\cdot f(t)\ dt\le\frac M{12}$
I suspect it might be an error

I assumed immediately that it's an error, but my first two thoughts as counterexamples were $f(t)=\frac12-t$ and $f(t)=\sin(2\pi t)$, both of which satisfy the result. Anyone with a proof or counterexample?

REPLY [13 votes]: Edit: Incorporated simplification and shortening of the argument suggested by Didier. Thanks!

By a) we know that $\frac{1}{2} \int_{0}^{1} f(x)\,dx = 0$. Therefore 
\begin{align*}
\int_{0}^{1} xf(x)\,dx & = \int_{0}^{1} \left(x - \frac{1}{2}\right)f(x)\,dx \\
& =
\left. \frac{1}{2}(x^{2} - x) f(x)\right\vert_{0}^{1} -
\int_{0}^{1}  \frac{1}{2}(x^{2} - x)f'(x)\,dx \\ 
& = \frac{1}{2} \int_{0}^{1}  (x - x^{2})f'(x)\,dx
\end{align*}
using integration by parts.
Now note that $x - x^{2} \geq 0$ on $[0,1]$ and by b) we have $m \leq f'(x) \leq M$, hence 
$$
C m \leq \int_{0}^{1} x f(x)\,dx \leq C M
$$
with
$$
C = \frac{1}{2} \int_{0}^{1} (x - x^{2})\,dx = \left.\frac{1}{2}\left(\frac{1}{2}x^{2} - \frac{1}{3}x^{3}\right)\right\vert_{0}^{1} = \frac{1}{12}
$$
as we wanted.
Let me add that these estimates arise in the Euler summation method and are often used in proofs of the Stirling formula.