TITLE: Inequality of integrals $\int_0^1(f(x))^2 dx \geq 4$ if $\int_0^1xf(x) dx=\int_0^1f(x) dx = 1$
QUESTION [13 upvotes]: If 
$$\int_0^1xf(x) dx=\int_0^1f(x) dx = 1$$
prove that
$$\int_0^1(f(x))^2 dx \geq 4$$
EDIT
My attempt is as follows - 
I can use only the $\int xf(x)$dx part to get a bound $\int f^2(x) dx \geq 3$ from cauchy schwarz. I can't think of ways how to incorporate the other given condition.

REPLY [3 votes]: We have for each $a,b$:
$$ \int_0^1 \Big(f(x)-ax-b\Big)^2dx \geq 0$$
So we have
\begin{eqnarray*}
\int_0^1 f(x)^2 dx &\geq &2\int _0^1f(x)(ax+b)dx -\int _0^1
(ax+b)^2dx \\
&=&2(a+b) -{(a+b)^3-b^3\over 3a}\\
&=&2(a+b) -{a^2+3ab+3b^2\over 3} =:E
\end{eqnarray*}
This inequality is valid for all $a,b$, so even when $E$ achieves maximum:
\begin{eqnarray*}
E &=&\underbrace{-b^2 +b(2-a) - {(2-a)^2\over 4}} + \underbrace{{(2-a)^2\over
4} -{a^2\over
3}}\\
&=&-\Big(b - {2-a\over 2}\Big)^2+{-a^2-12a+12\over 12}\\
    &\leq & {-a^2-12a+12\over 12} \\
   &=&  {-(a-6)^2+48\over 12}\\
    &\leq & 4
\end{eqnarray*}
Equality is achieved at $a=6$ and $b={2-a\over 2}= -2$, that is when $f(x)=6x-2$.