TITLE: Polynomials are dense in weighted $L^2$ space
QUESTION [5 upvotes]: Hi,
It seems to be a common knowledge that the polynomials $x^n$ are dense in $L^2$ spaces with various probability weights, such as the gamma distribution weight $x^{\alpha-1}e^{-x}/\Gamma(\alpha)\;dx$. 

Is there any reference to this fact preferrably including the condition which property of the weight implies the density of polynomials?

My guess is that if 
$$
\int_{-\infty}^{+\infty}e^{-\lambda|x|}P(dx)<\infty
$$
for some $\lambda>0$, then the polynomials are dense in $L^2(\mathbb{R},P)$.

REPLY [8 votes]: Sure, the beautiful book by N.I.Akhiezer  The Classical Moment Problem and Some Related Questions in Analysis, where in particular you can find a thorough discussion of the property of the density of the polynomials in $L^1$ and $L^2$ for measures with finite moments of all order (together with sufficient conditions and counter-examples to the density.)