TITLE: Interchange of integration and summation and the Taylor expansion
QUESTION [9 upvotes]: 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?

REPLY [4 votes]: Summation over $\mathbb{N}$ is actually integration with respect to a measure with discrete "atoms", that is a measure defined on $\mathbb{N}$ that assignes a real or complex number to every natural number.
In our case we can define a measure $\mu$ on  $\mathbb{N}$ via 
$$
\mu (r) := \frac{a_r}{r!}
$$
If we next define a function on the product measure space $(\mathbb{R}, d x) \times (\mathbb{N}, \mu)$ via
$$
g(x, r) := \exp(- x^2) x^r
$$
then your question becomes a candidate for an application of Fubini's theorem.
Edit: to avoid making $\mu$ a signed measure, we can redefine
$$
\mu (r) := \frac{1}{r!}
$$
and
$$
g(x, r) := a_r \; \exp(- x^2) \; x^r
$$
The question is of course: are the coefficients $a_r$ such that Fubini's theorem is applicable? That depends on the coefficients, of course...