TITLE: The discussion about $\int_a^b P^2(x)f(x)dx=0$
QUESTION [6 upvotes]: $f$ is Riemann integrable in $[a,b]$,and $\int_a^b f(x)dx>0$. If the polynomial $P(x)$ satisfies $\int_a^b P^2(x)f(x)dx=0$. Prove $P(x)=0$.

REPLY [3 votes]: You need more conditions on $f, P$.
Choose $f(x) = 1$ when $x \in [0,\sqrt[3]{\frac{2}{3}}]$, and $f(x)=-2$ when $x \in (\sqrt[3]{\frac{2}{3}}, 1]$. Let $P(x) = x$. Then I have $\int_0^1 f(x) dx > 0$, and
$ \int_0^1 P^2(x) f(x) dx = 0$, but clearly $P \neq 0$.