The discussion about $\int_a^b P^2(x)f(x)dx=0$

$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$.

-
 @SimingTu How can you define f(x)? – 89085731 Apr 21 '12 at 2:49 I don't think you are able to choose $f$. – robjohn♦ Apr 21 '12 at 2:49 @robjohn The problem seems a little weird.Actually,I think the function of P(x) depends on the root of P(x) and f(x). – 89085731 Apr 21 '12 at 3:06 Maybe need some real analysis knowledge to solve it. – noname1014 Apr 21 '12 at 4:05 @Gingerjin: Sorry, I misread the question. – Siming Tu Apr 21 '12 at 6:02

If, in addition, $f$ is non-negative, here is a hint.
Hint: Polynomials that are not identically $0$ can vanish only on a finite set. Consider the open sets $$U_k=\left\{x\in(a,b):|P(x)|>\frac1k\right\}\tag{1}$$ and let $$F_k=\int_{U_k}f(x)\,\mathrm{d}x\tag{2}$$ Show that $$\int_a^bf(x)\,\mathrm{d}x=F_1+\sum_{k=2}^\infty(F_{k}-F_{k-1})\tag{3}$$ and $$\int_a^bP^2(x)f(x)\,\mathrm{d}x\ge F_1+\sum_{k=2}^\infty(F_{k}-F_{k-1})\frac{1}{k^2}\tag{4}$$ What conclusions can you draw from $(3)$ and $(4)$?
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$.
 Ah, I misread the problem. I thought that somewhere, it said that $f$ was positive. – robjohn♦ Apr 21 '12 at 4:29 Yes, I suspect that $f(x)\geq 0$ should be part of the problem statement. – copper.hat Apr 21 '12 at 4:36 If $f(x)\geq 0$ I think this result is true. – Siming Tu Apr 21 '12 at 6:03 It is true under this condition, as @robjohn pointed out earlier. – copper.hat Apr 21 '12 at 6:33