# Assume $f$ is continuous on $[-1,1]$. If $\int_{-1}^{1}f(x)x^ndx=0$, for all nonnegative integer $n$, can we prove that $f(x)=0$?

Assume $f$ is continuous. If $$\int_{-1}^{1}f(x)x^ndx=0$$ holds for every non-negative integer $n$ , can we prove $f(x)=0$ for all $|x|\le 1$ ? Is it possible to have $f(x)x^n$ odd?

• Yes, for all $n\geq 0$. Sorry about that. I'm correcting it now. – 2ndaccount Aug 3 '17 at 16:37
• Well, you need the additional hypothesis that $f$ is continuous. Either that, or you weaken the conclusion to $f \equiv 0$ almost everywhere. – MathematicsStudent1122 Aug 3 '17 at 16:38
• yes, I forgot that... correcting now – 2ndaccount Aug 3 '17 at 16:39
• It's not possible to have $f(x) x^n$ odd for all $n$. Try it out: $f(x) x^n$ odd $\iff f(x) x^n = - f(-x) (-x)^n = (-1)^{n+1} f(-x) x^n$. Multiplying the last equation by $x$ gives $f(x) x^{n+1} = (-1)^{n+1} f(-x) x^{n+1}$, which does not satisfy the condition that $f(x) x^{n+1}$ is odd, which reads $f(x) x^{n+1} = (-1)^{n+2} f(-x) x^{n+1}$. – Jon Warneke Aug 3 '17 at 16:45
• That's explained in every decent textbook, and I think that's why it's regularly asked, here (i.e.math.stackexchange.com/questions/271199/…). Guys, if you don't understand it in the books, why do you think you'll understand the answers, here?! – Professor Vector Aug 3 '17 at 17:16

Let $M=\max|f|$. If $M=0$, then $f\equiv0$. Otherwise, fix $\varepsilon>0$ and let $P(x)$ be a polynomial with real coefficients such that $(\forall x\in[-1,1]):\bigl|f(x)-P(x)\bigr|<\frac\varepsilon{2M}$; such a polynomial exists by the Weierstrass approximation theorem. Then\begin{align*}\int_{-1}^1f(x)^2\,\mathrm dx&=\int_{1}^1f(x)P(x)\,\mathrm dx+\int_{-1}^1f(x)\bigl(f(x)-P(x)\bigr)\,\mathrm dx\\&=\int_{-1}^1f(x)\bigl(f(x)-P(x)\bigr)\,\mathrm dx,\end{align*}since $P(x)$ is a sum of monomials. But then$$\int_{-1}^1f(x)^2\,\mathrm dx=\left|\int_{-1}^1f(x)\bigl(f(x)-P(x)\bigr)\,\mathrm dx\right|<2M\frac\varepsilon{2M}=\varepsilon.$$Since this is true for every $\varepsilon>0$, $\int_{-1}^1f(x)^2\,\mathrm dx=0$ and the continuity of $f$ implies now that $f\equiv0$.
Hint: use the Stone-Weierstrass approximation theorem (a continuous function $f\colon [a,b]\to\mathbb{R}$ can be uniformly approximated by a sequence of polynomials).
• My concern was the possibility of $f(x)x^n$ being odd. – 2ndaccount Aug 3 '17 at 16:47
• Under your assumptions, you can prove that $f(x) = 0$ for every $x\in [-1,1]$. Hence, $f(x) x^n = 0$ for every $x\in[-1,1]$. – Rigel Aug 3 '17 at 16:48
• I think I still need to show that it cannot be odd, because consider the case $\int_{-1}^{1}f(x)x^{2n+1}dx$. – 2ndaccount Aug 3 '17 at 16:50
• It's not guaranteed that $f=0$ all the way since $f(x)$ could be even. – 2ndaccount Aug 3 '17 at 16:51