Suppose we have a bounded function $f:\mathbb{R} \to \mathbb{C}$. I want to compute $ \int_\mathbb{R} e^{-x^2} f(x) dx $
Of course this integral exists. I know that $f$ has a Taylor expansion which is valid for all of $\mathbb{R}$, say $ f(x)=\sum_{r=0}^\infty a_r \frac{x^r}{r!} $
Is it generally true that
$ \int_\mathbb{R} e^{-x^2} f(x) dx = \sum_{r=0}^\infty \frac{a_r}{r!} \int_\mathbb{R} e^{-x^2} x^r dx$
Of course all the integrals on the right hand side also exist. However, I cannot use the theorem of uniform convergence, since the Taylor expansion does not converge uniformly on $\mathbb{R}$ but of course on any compact subset. So my guess is that a this equality should hold anyways, in particular since the sum is not some wierdly constructed counterexample but a regular Taylor series.
How could I prove such a result. In fact I do not necessarily need to know how to prove it but just know it. Is there a reference?