# If $\int_0^1 f(x)x^n \ dx=0$ for every $n$, then $f=0$. [duplicate]

Possible Duplicates:
Nonzero $f \in C([0, 1])$ for which $\int_0^1 f(x)x^n dx = 0$ for all $n$

Slight generalization of an exercise in (blue) Rudin

I found a nice problem I would like to share.

Problem: If $f$ is continuous on $[0,1]$, and if

$$\int_0^1 f(x)x^n \ dx =0$$

for every positive integer $n$, prove that $f(x)=0$ on $[0,1]$.

Source: W. Rudin, Principles of Mathematical Analysis, Chapter 7, Exercise 20.

I have posted a proposed solution in the answers.

-

## marked as duplicate by t.b., Marvis, Did, Davide Giraudo, Jonas MeyerJul 2 '12 at 20:32

... This is not how posting on this site works Potato. Do you want people to review your proof? Then ask them to. It seems to me you jsut wanted to share a proof of a classical exercise, a blog would be better suited for this. – Olivier Bégassat Jul 2 '12 at 19:22
@Olivier: It is. See also here – t.b. Jul 2 '12 at 19:25
@t.b. seems I was wrong. – Olivier Bégassat Jul 2 '12 at 19:30
@OlivierBégassat: See here for some context. – Did Jul 2 '12 at 19:40

We will show that the integral of $f^2$ over $[0,1]$ is 0. This will show that $f$ is zero, because if $f$ were not identically equal to zero, $f^2$ would be positive on some interval (by continuity) and have a nonzero integral.
Using the Stone-Weierstrass theorem, we can approximate $f$ uniformly by polynomials $P_n$ so that $||P_n-f||<1/n$ in the $\sup$ norm. The given condition obviously implies that the integral of $f(x)P(x)$ is zero for any polynomial $P$, by linearity. Note that
$$\left|\int_0^1 f(x)f(x) \ dx \right|=\left|\int_0^1 f(x)f(x) \ dx - \int_0^1 f(x)P_n(x)\right|\le \int_0^1 |f(x)| |f(x)-P_n(x)|\ dx \\\le \frac{1}{n}\int_0^1 |f(x)| \ dx.$$
The last integral is constant, so taking $n$ arbitrarily large completes the proof.
Does the $x^n$ matter in this case? Will the proof be the same if it's just another constant? Thanks. – lsy Apr 21 at 6:41