$\int_I x^n f(x)dx=0$ and $I$ open imply $f=0$

Let $I$ be a bounded interval of $\mathbb{R}$ and $f$ be a continuous function on $I$.

Assume $I$ is closed, ie: $I=[a,b]$, and $\forall n\geq 0$, $\int_I x^n f(x)dx=0$. Then, one can show with Weierstrass approximation that $f=0$ on $I$.

This can be done because, with this assumption, $I$ is compact so one can apply Weierstrass theorem. But someone told me that the result holds even though $I$ is open, ie: $I=(a,b)$.

How can this be done ?

• This has been addressed many times before. A possible approach is the following: $C^0(I)\subset L^2(I)$, and there is an orthogonal base of polynomials (shifted Legendre polynomials) for $L^2(I)$. By the given constraints, the Fourier-Legendre series of $f(x)$ over $I$ only has zero coefficients. By applying Parseval's identity, it follows that $\int_I f(x)^2\,dx = 0$, hence $f(x)\equiv 0$. – Jack D'Aurizio Oct 13 '16 at 14:01
• A similar question: math.stackexchange.com/questions/1373720/… – Jack D'Aurizio Oct 13 '16 at 14:03
• Are you assuming $f$ is absolutely integrable on $(a,b)$? Or are you assuming improper Riemann integrals exists on $(a,b)$? – DisintegratingByParts Oct 15 '16 at 16:08

If you assume that $f$ is absolutely integrable on $(a,b)$, then you can get what you want. To see this, suppose $g$ is continuous on $[a,b]$. Then the Weierstrass approximation theorem gives you a sequence $\{ g_n \}$ of polynomials on $[a,b]$ that converges uniformly to $g$. Therefore, $$\left|\int_{a}^{b}g_n f dx - \int_{a}^{b}g fdx\right| \le \int_{a}^{b}|f(x)|dx\cdot\sup_{x\in [a,b]}|g_n(x)-g(x)|\rightarrow 0 \mbox{ as } n\rightarrow\infty.$$ Because $\int_{a}^{b}g_n(x)f(x)dx = 0$ for all $n$, it follows that $$\int_{a}^{b}g(x)f(x)dx=\lim_n \int_{a}^{b}g_n(x)f(x)dx=0.$$ The above must hold for all $g \in C[a,b]$. Fix a subinterval $[c,d]\subset (a,b)$ and define $g_{\delta}(x)$ to be $f$ on $[c,d]$, to be $0$ on $(a,c-\delta)\cup(d+\delta,b)$, and to be linear and continuous on the remaining intervals $[c-\delta,c]\cup[d,d+\delta]$. Then $$0=\lim_{\delta\downarrow 0}\int_{a}^{b}f(x)g_{\delta}(x)dx=\int_{c}^{d}f(x)^2dx.$$ The above holds for all $a < c < d < b$. And $f(x)^2$ is continuous on $(a,b)$. By the Fundamental Theorem of Calculus, $$0=\frac{d}{dy}\int_{c}^{y}f(x)^2dx=f(y)^2.$$

• where did you use the integrability hypthesis ? – anonymus Oct 16 '16 at 23:44
• @anonymus : I used the absolute integrability of $f$ in the very first equation. Without that integral being finite, the right side is meaningless. – DisintegratingByParts Oct 17 '16 at 0:44
• Oh yes of course ! Thank you :) – anonymus Oct 17 '16 at 0:56
• @anonymus : You're welcome. It's good that you're being careful. – DisintegratingByParts Oct 17 '16 at 1:00

Viewing the problem as if it was about vectors in the space $L^2(X)$, we note that the spaces $L^2[a,b]$ and $L^2(a,b)$ are practicaly the same space ($L^2(X)$ is the space of square integrable, lebesgue measurable functions defined on the measurable space $X$).

This condition is equivalent to $f$ being orthogonal to a spanning set: $\{x^n\} _{n=1}^\infty$, and the only vector (function) that is orthogonal to a dense set is the zeroth vector.

Now, the zeroth vector in such spaces are functions that equal $0$ almost everywhere (up to a null set). Since $f$ is continuous, it must be $0$ everywhere.

• Pretty. But it's a bit too sophisticated for my purpose. – anonymus Oct 13 '16 at 14:20
• Sure, but I like this point of view and I think people can benefit from seeing a problem in a wider prespective. – Ranc Oct 13 '16 at 14:27

You can apply Weierstrass on the intervals $[a+\frac1k,b-\frac1k]$ for natural $k>\frac 2{b-a}$.

• Is the following argument correct/rigorous ? Let $I_k :=[a+1/k,b-1/k]$ and $P_k$ a polynomial function s.t. $\|f-P_k \|_{L^\infty(I_k)}<\epsilon$. Since $\int_{I_k} fP_k = 0$, we have $\int_I f^2 = \lim_k \int_{I_k} f^2 = \lim_k \int_k f(f-P_k) \leq (\lim_k \int_k f)\epsilon \leq \lambda(I) \|f\|_{L^\infty (I)} \epsilon$. – anonymus Oct 13 '16 at 13:58
• Why do all that? We get $f\equiv 0$ on each $I_k$ This implies $f\equiv 0$ on $(a,b).$ – zhw. Oct 15 '16 at 17:44
• yes you're right : $\cup_k I_k =\lim_k I_k = (a,b)$. – anonymus Oct 16 '16 at 23:42