# Non-convergent series of convergent integral

I'm trying to find a series representation for a integral, but I think there's something I'm missing, as even though the algebraic manipulations I'm doing are valid (I think!), the series representation of the integral (which I know to converge) ends up diverging. Here's what I'm doing (specifics omitted for brevity, p and q are large polynomials with non-integer exponents, deg(q)>deg(p), q(x) has no roots in the positive reals): $$\mathcal{I}=\int_0^\infty \frac{p(\lambda)}{q(\lambda)}e^{-k\lambda^2}d\lambda$$ $$\mathcal{I}=\int_0^\infty \frac{p(\lambda)}{q(\lambda)}\sum_{n=0}^\infty\frac{(-1)^nk^n\lambda^{2n}}{n!}d\lambda$$ $$\mathcal{I}=\sum_{n=0}^\infty\frac{(-1)^nk^n}{n!}\int_0^\infty \frac{\lambda^{2n}p(\lambda)}{q(\lambda)}d\lambda$$ $$\mathcal{I}=\sum_{n=0}^\infty\frac{(-1)^nk^n}{n!}C_i$$ , where $C_i$ is a constant involving the ratios of Gamma functions. Only problem is, the last expression for $\mathcal{I}$ does not converge (or, at least, oscillates enormously beyond the ability of my computer to calculate- it pegs the 200th partial sum at around $10^{2500}$), when in fact the first expression gives a accurate value of around 0.02.

My question is, what error (of concept or execution) have I wound up inadvertently committing and, if possible, what means is there to correct it so I wind up with a convergent series that can be used?

Thanks.

-

The exponential series converges uniformly on compact intervals but not on the whole of $[0,+\infty)$. You cannot interchange the integral with the sum of that series.
Yes. ${}{}{}{}$ –  Mariano Suárez-Alvarez Jul 14 '13 at 3:56