This exercise is from Rudin's Real and Complex analysis at chapter 15, problem 22.
$A=\{ f_{n} = t^n exp(-t)\}$ where $(0 \leq t \leq \infty, n \in \mathbb{N}).$ Prove that $A$ is dense in $L^{2}(0,\infty)$.
Hint : If $g \in L^{2}(0,\infty)$ is orthogonal to each $f_n$ and if $F(z) = \int_{0}^{\infty}exp(-tz)\overline{g(t)}dt,$ (Re $z>0$), then all derivatives of $F$ are $0$ at $z=1$. Consider $F(1+yi)$.
I understand the hint want me to use Hanh-Banach theorem, but I don't know how the $F(z)$ is related with the theorem. Even if I accept $F'(1)=0$, what can I do that? Could you give me more hints to approach this problem?
Edit: Thank you for all of you. I'll give a try for solving problem.
Let $g \in L^{2}(0,\infty)$ is orthogonal to each $f_n,$ e.g. $\int_{0}^{\infty}t^{n}e^{-t}\overline{g(t)}dt = 0$ for all $n=0,1,2, \cdots$. Define $F(z) = \int_{0}^{\infty}\exp(-tz)\overline{g(t)}dt$ where Re $z >0$.
1) F is well-defined since $(\int_{0}^{\infty}|exp(-tz)|^{2}dt)^{1/2} = \frac{1}{\sqrt{2 Re z}} <\infty$, so $e^{-tz}$, $g(t)$ are in $L^{2}$.
2) $F^{(n)}(w) = \int_{0}^{\infty}(-1)^{n}t^n e^{-tz} \overline{g(t)}dt$
since $\lim_{z \to w}\frac{F(z) - F(w)}{z-w} = \lim_{z \to w} \int_{0}^{\infty}\frac{e^{-tz}-e^{-tw}}{z-w}\overline{g(t)}dt $
and this part is what I do not know how to deal with, but I think I can apply dominated convergence theorem or any other theorem, to derive that
$\lim_{z \to w} \int_{0}^{\infty}\frac{e^{-tz}-e^{-tw}}{z-w}\overline{g(t)}dt = \int_{0}^{\infty}\lim_{z \to w} \frac{e^{-tz}-e^{-tw}}{z-w}\overline{g(t)}dt= \int_{0}^{\infty}-te^{-tz}\overline{g(t)}dt$, and by repeating such differentiating, we get desired result.
3) $F^{(n)}(1) = 0$ for any $n \in \mathbb{N}\cup \{0\}$ since $F^{(n)}(1)$ is just $<f_{n},g>$, which is 0 by assumption.
4) So $F$ is holomorphic on half plane where real part is greater than 0, and $F$'s power series representation at $z=1$ implies $F \cong 0$.
So, if we think $0= F(1+iy)$ for $y\in \mathbb{R}$, $F(i+y) = \int_{0}^{\infty}e^{-t}\overline{g(t)}e^{-iyt}dt$, a Fourier transform of $e^{-t}\overline{g(t)}$, call $\mathbb{F}(e^{-t}\overline{g(t)}$. Hence by fourier inversion formula, $e^{-t}\overline{g(t)} = \int_{0}^{\infty}\mathbb{F}(e^{-t}\overline{g(t)}e^{iyt} = \int 0 dt =0$. So $e^{-t}\overline{g(t)} \cong 0$. But $e^{-t}\neq 0$ for any $t \in (0,\infty)$, $g(t) = 0$ almost everywhere.
5) Conclusion : so any function which is not spanned by closure of span$\{f_n \}$ is zero almost everywhere. Hence the span is dense.
Re-question : You know that my proof was not completed, especially on interchanging limit and integral when I calculate $F^{(n)}$. Could you give some more idea?