It is generally known that polynomials are dense in the Hilbert space. How do i show this?
I know, it suffices to show completeness and i would like to use this defination: The vectors $\{e_n\}_{n=0}^{\infty}$ are complete in the Hilbert space $L^2(w)$ if $\int_{-\infty}^{\infty}f(x)e_nw(x)dx=0$ for all $n\ge0$ and $f\in L^2(w)$ implies that $f=0$ almost everywhere.
But again, i know that $f=0$ almost everywhere if its fourier transform is zero from the following: If the function f is integrable on $(-\infty,\infty)$ and $\hat{f}(x)=\int_{-\infty}^{\infty}f(t)e^{ixt}dt\equiv0,$ then $f=0$ almost everywhere.
So, how do i show that the fourier transform is identically zero? Lets take the weight to be $w(x)=1/2\cosh\frac{\pi}{2}x$ but any other weight can do since the polynomials should be dense regardless of the weight chosen.
Thanking you in advance.
$Proof.$ I have tried to work it out using the defination that $\{e_n\}_{n=0}^{\infty}$ is complete in $L^2(w)$ if $\langle f,e_n\rangle=0$ implies that $f=0$ a.e.
Let $f\in L^2(w)$ and suppose that $\int_{-\infty}^{\infty}f(x)x^nw(x)dx=0$ for all $n\ge0$, then \begin{align} \int_{-\infty}^{\infty}f(x)e^{itx}w(x)dx=\sum_{k=0}^{\infty}\frac{(it)^n}{n!}\int_{-\infty}^{\infty}f(x)x^nw(x)dx=0 \end{align} Thus, since the fourier transform is zero, $f(x)=0$ a.e. and so $\{x^n\}_{n=0}^{\infty}$ is complete in $L^2(w)$ by definition.
Could this be ok and how can i be sure that this fourier transform exists or is analytic so that even the interchange of sum and integral can be valid by beppo-levi lemma?