Today, I coincidentally found this. Is this valid ? Why is this happening ? Observe $\int_0^\infty \frac{t^ne^{-t}}{n!} dt = 1$, $\forall n\geq 0$.
Let's start $\frac12 = \int_0^\infty e^{-2t} dt=\int_0^\infty e^{-t} × e^{-t} dt$
$=$$\int_0^\infty \left(e^{-t}\sum_{n=0}^\infty\frac{(-1)^nt^n}{n!}\right) dt $
$\stackrel{!}{=}$ $\sum_{n=0}^\infty (-1)^n \left(\int_0^\infty e^{-t}\frac{t^n}{n!} dt \right) $ $ = \sum_{n=0}^\infty (-1)^n = 1-1+1-1+1...$.
NOTE:- I don't know whether the sequence $e^{-t}\frac{t^n}{n!}$ converges uniformly or not.
Switching the integral and the sum is not valid here. The conclusion that $\sum_{n=0}^\infty (-1)^n = 1/2$ is false in the sense of the sum of an infinite series as the limit of the sequence of partial sums.
It is true that $\frac{e^{-n}n^n}{n!} \to 0$ as $n \to \infty$ uniformly for $t \geqslant 0$, since $\frac{e^{-t}t^n}{n!}$ attains a maximum at $t=n$ and we have $0 \leqslant\frac{e^{-t}t^n}{n!} \leqslant \frac{e^{-n}n^n}{n!} $. Furthermore, the series $\sum_{n=0}^\infty(-1)^n\frac{e^{-t}t^n}{n!}$ converges uniformly for all $t \geqslant 0$ by Abel's test.
However, uniform convergence is not enough to justify switching the sum here with the integral over the infinite interval $[0,\infty)$.
Here is another example that uniform convergence is not sufficient for switching the limit of a sequence and an integral over an infinite interval. Note that $g_n(t) =n^{-1} \chi_{[0,n]}(t) \to 0$ uniformly for $t \geqslant 0$, but $\int_0^\infty g_n(t) \, dt = 1 \neq 0 = \int_0^\infty \lim_{n \to \infty}g_n(t) \, dt$.