TITLE: If $\int_1^\infty f(x) x^n dx=0$ for all $n>1$, is $f=0$?
QUESTION [6 upvotes]: For a continuous function $f$, if
$$
\int_1^\infty f(x) x^n dx =0
$$
For all integers $n>1$, is it true that $f=0$? Here, $\int_1^\infty f(x) \text d x = 0$ means $\lim_{A \to \infty} \int_1^A f(x)\text dx =0$.
By looking at the real and imaginary parts, we can assume $f$ is real. If $f$ has compact support, then approximating $f$ with Stone-Weierstrass shows that $\int f^2=0$ so $f=0$. If $f$ stops changing signs outside an interval $[1,a]$, then $\int_1^a f(x) (x/a)^n \to 0$ by the DCT, and the rest of the integral must diverge, contradicting the assumption, so the sets where $f$ is positive or negative must be unbounded.
The problem is that the approximation theorems I know only apply in compact domains, so integrating to infinity makes it more complicated. The fact that I do not know if $f$ is bounded also complicates matters, I know that if $f$ were decaying better than $e^{-x}$ this would be more tractable since I could just cut off at some point. So far, I am coming up empty. Is it true that $f = 0$ or is there some counterexample?

REPLY [3 votes]: I am going to rewrite the answer provided by Yalikesifulei in the comments for my own sake, since I was not expecting there to be a counterexample.
Let $g(x) = e^{-x}e^{ix}$ so that $|g(x)| = e^{-x}$ and therefore $\int_0^\infty x^n g(x) \text dx$ converges absolutely. Integration by parts with $u= x^n \Rightarrow \text d u = n x^{n-1} \text dx$ and $\text dv = e^{(-1+i)x} \text d x \Rightarrow v = (-1+i)^{-1}e^{(-1+i)x} $ yields
\begin{align}
I_n &:= \int_0^\infty x^n e^{(-1+i)x} \text dx = \frac{x^n}{-1+i}e^{(-1+i)x}|_0^\infty +\frac n{1-i}\int_0^\infty x^{n-1}e^{(-1+i)x} 
\text dx 
\\
&= \frac{n}{1-i} I_{n-1}
\end{align}
Because $I_0 = \int_0^\infty e^{(-1+i)x} \text d x = \frac 1{1-i}$, we assume that $I_n = \frac{n!}{(1-i)^{n+1}}$ for some $n$ so that $I_{n+1} = \frac{n+1}{(1-i)} \frac{n!}{(1-i)^{n+1}} = \frac{(n+1)!}{(1-i)^{(n+1)+1}}$ and induction establishes this identity for all $n$. In particular, because $1-i = \sqrt{2}e^{-i \pi/4}$, we have
\begin{align}
\int_0^\infty x^n e^{-x} \sin(x) \text d x &= \Im\left(\int_0^\infty x^n e^{-x} (\cos(x) + i \sin(x))\text d x \right)
\\
&= \Im(I_n) =  2^{-(n+1)/2}n! \Im \left( e^{i \frac \pi 4(n+1)}\right)
\\
&= 2^{-(n+1)/2}n! \sin\left(\frac \pi 4(n+1)\right)
\end{align}
If $n= 4m + 3$ for any $m \in \Bbb N$ then $\frac \pi 4(n+1) = (m+1) \pi$ forces the above to vanish, so, putting $f(x) = \sin((x-1)^{1/4})e^{-(x-1)^{1/4}}$ gives:
\begin{align}
\int_1^\infty u^m f(u) \text ds &\overbrace{=}^{s = u - 1}
\sum_{k = 0}^m \binom mk \int_0^\infty s^k \sin(s^{1/4}) e^{-s^{1/4}} \text d s
\\
&\overbrace{=}^{s=x^4, \text ds = 4x^3 \text d x}4\sum_{k = 0}^m \binom mk\int_0^\infty x^{4k +3} \sin(x)e^{-x} \text d x = 0
\end{align}
Hence such a non-zero $f$ exists and, furthermore, it is analytic on $(1, \infty)$