# Prove that this polynomial is zero

Let $P$ be any polynomial such that $\int_a^b P(x)x^n \, dx =0$ for all $n\in\mathbb N$, prove that $P=0$. I've been thinking for 1 hour and don't have any clue yet. Please help me, thank you.

-
As observed by @AndrewSalmon, you get $\int_a^b|P(x)|^2dx=0$ by linearity. Then this implies $|P|=0$ hence $P=0$ on $[a,b]$. So $P$ has infinitely many roots. Thus $P=0$. –  1015 Apr 4 '13 at 4:51
More interesting: this is still true if you replace $P$ by a continuous complex-valued function. But it requires more technology: e.g. Stone-Weierstrass. –  1015 Apr 4 '13 at 4:54

If $P$ is a real polynomial, then by linearity, $$\int_a^b P(x)^2 dx = 0$$

The result follows since $P(x)^2 \ge 0$ is continuous, so $P(x)^2 = 0$ and $P(x) = 0$ on $[a,b]$.

Since nonzero polynomials have finitely many roots (but this is $0$ everywhere in $[a,b]$), $P(x) = 0$ for all $x$.

-
It is straightforward, but you might want to add a little step: $P$ is $0$ on $[a,b]$ first, hence $P=0$ as it has infintely many roots. Anyway, +1 for catching the easy argument. –  1015 Apr 4 '13 at 4:56
very beautiful proof, thank you guys –  user63219 Apr 4 '13 at 17:52

Hint: polynomials are uniformly dense in $C([0,1]$.

-