Is it possible to exchange the sum and the integral sign in this expression? I find this integral somewhere
$$
\int_0^\infty \sum_{k\geqslant 1}(-1)^{k-1}(kx)^2\exp\left(-(kx)^2/2\right)\,\mathrm d x
$$
Notice that if we set $c_n(x):=(nx)^2\exp\left(-(nx)^2/2\right)$ then the maximum of $c_n$ is achieved when $x=\sqrt 2/n$, thus for each $\epsilon >0$ there is some $N_\epsilon \in \Bbb N $ such that the sequence $(c_n)_{n>N_\epsilon }\downarrow 0$ for all $x>\epsilon $, so $0\leqslant |s_n(x)|\leqslant |s_{N_\epsilon }(x)|$ for all $x>\epsilon $ and all $n>N_\epsilon $, where $s_n$ is the $n$-th partial sum of the series. This show us that we can apply the dominated convergence theorem in the region of integration $[\epsilon ,\infty )$ to exchange the sum and the integral sign.
However I'm unable to find an argument to show that we can exchange the sum and the integral sign in the region $[0,\epsilon ]$. I tried to bound from above the series in its absolute values (to show uniform convergence) but I don't find the way (indeed I suspect that the series, in absolute values, does not converge uniformly in this region).
Then my question is: can we exchange the integral and the sum in the region $[0,\epsilon ]$ for some $\epsilon >0$?
 A: Seeing again this problem I found an argument to justify the exchange of the sum and the integral in the expression
$$
\int_{0}^\infty \sum_{k\geqslant 1}(-1)^{k-1} f(xk)\mathop{}\!d x\tag1
$$
where $f:\mathbb{R}\to \mathbb{R},\, t\mapsto t^2e^{-t^2/2}$. Notice that $f$ is increasing in the region $[0,\sqrt{2}]$ and decreasing in $[\sqrt{2},\infty )$, therefore
$$
\left| \sum_{k=1}^n(-1)^{k-1}f(xk) \right|\leqslant f(x),\quad \text{ when }x\geqslant \sqrt{2}\tag2
$$
Also, for fixed $x>0$ and setting $N:=\lfloor \frac{\sqrt{2}}{x} \rfloor$ we have that the function $f(x\cdot )$ is increasing in $\{1,\ldots ,N\}$ and decreasing in $\{N,N+1,\ldots \}$, therefore
$$
\begin{align*}
\left| \sum_{k=1}^n (-1)^k f(xk) \right|&\leqslant \left| \sum_{k=1}^N (-1)^k f(xk) \right|+\left| \sum_{k=N+1}^n (-1)^k f(xk) \right|\\&\leqslant f(Nx)+f((N+1)x)\\&\leqslant 2\|f\|_\infty \\&=\frac{4}{e} 
\end{align*}\tag3
$$
Consequently
$$
\left| \sum_{k=1}^n(-1)^{k-1}f(xk) \right|\leqslant \mathbf{1}_{(0,\sqrt{2})}(x)\frac{4}{e}+\mathbf{1}_{[\sqrt{2},\infty )}(x) f(x)\tag4
$$
for all $n$, so we can apply also the dominated convergence theorem to exchange the sum and the integral sign.∎
