Suppose $f:\Bbb R\to\Bbb C$ is real analytic. In order for $f$ to be in $L^2(\Bbb R)$, clearly all terms in the power series cannot be positive since $f$ would diverge at $\pm\infty$. Likewise, the distribution of negative terms cannot go to zero so we see that the power series for $f$ must be alternating (in some fashion). However this does not tell us much.
Taking $f(x) = \sum\limits_{n=0}^{\infty} \dfrac{(-1)^n}{n!}x^{2n}$ gives $f(x) = \exp(-x^2)$ and is in $L^2(\Bbb R)$. In this case, the coefficients have factorial decay but it is not immediately obvious what kind of decay the coefficients can have while still giving rise to an $L^2$ function.
Are there sufficient conditions on the power series coefficients that will ensure that the function is in $L^2(\Bbb R)$? For instance, are there asymptotic bounds on the coefficients that will ensure that the function is in $L^2(\Bbb R)$ or is this an impossible task?
Assume $f(x)=\sum _{n=0}^\infty a_n x^n$. Put $c_n=\sum_{m=0}^n a_m a_{n-m}$, so that $f(x)^2=\sum _{n=0}^\infty c_n x^n$. Then, invoking first the Monotone Convergence Theorem, then the Tonelli/Fubini Theorem and then removing vanishing terms, we see that $$ \int f^2 dx=\lim_{k\rightarrow\infty} \int_{-k}^k f^2 dx=\lim_{k\rightarrow \infty} \sum_{n=0}^\infty \frac{c_n(k^{n+1}-(-k)^{n+1})}{n+1}=\lim_{k\rightarrow \infty} \sum_{n=0}^\infty \frac{2c_{2n}}{2n+1}k^{2n+1}. $$ Thus, $f\in L^2$ if and only if the increasing function $g:[0,\infty)\rightarrow [0,\infty)$ defined by $$ g(k)=\int_{-k}^k f^2 dx=\sum_{n=0}^\infty \frac{2c_{2n}}{2n+1}k^{2n+1} $$ satisfies $$ g(k)\leq M $$ for some $M<\infty$.