TITLE: integration of a continuous function $f(x) $ and $xf(x)$ is zero
QUESTION [6 upvotes]: Possible Duplicate:
Prove that $\exists a<b$ s.t. $f(a)=f(b)=0$ when $\int_0^1f(x)dx=\int_0^1xf(x)dx=0$ 

Suppose that $f:[0,1]\to \mathbb{R}$ is continuous, and that $$\int_{0}^{1} f(x)=\int_{0}^{1} xf(x)=0.$$
How does one prove that $f$ has at least two distinct zeroes in $[0,1]$?
Well, if not say $\forall a,b\in [0,1] \ni a<b$, but $f(a)\neq f(b), f(a)>0$ then there will be a neighborhood of $a$ say $(a-\epsilon,a+\epsilon)$ where $f(x)>0$ and hence the integral will not be equal to $0$, but I don't know where I am using the other integral condition. am I wrong anywhere in my proof? please help.

REPLY [16 votes]: Define $F(x):= \int_0^xf(t)\,dt$ for $x \in [0,1]$. Then the second integral tells us
$$
\begin{aligned}
0  = \int_0^1xf(x)\,dx \, & = \, xF(x)\Bigr|_0^1-\int_0^1F(x)\,dx
\\
& = 1\,F(1) - 0\,F(0) - \int_0^1F(x)\,dx
\\
& = \int_0^1f(x)dx - \int_0^1F(x)\,dx
\\
& = -\int_0^1F(x)\,dx.
\end{aligned}
$$
By the mean value theorem and continuity of $F$, which follows from continuity of $f$, this tells us that there is $c \in (0,1)$ such that $F(c)=0$. That is,
$$
\int_0^cf(x)\,dx = 0.
$$
It follows that
$$
\int_c^1f(x)\,dx = \int_0^1f(x)\,dx-\int_0^cf(x)\,dx = 0 - 0 = 0
$$
as well.
We then apply the mean value theorem two more times, using continuity of $f$, for the intervals $[0,c]$ and $[c,1]$ to find $a \in (0,c)$ and $b \in (c,1)$ respectively such that $f(a)=f(b)=0$.