This problem arose when I was studying the analytic continuation of the $\Gamma$ function.
Consider
$$f(z) = \int_{0}^1 e^{-t}t^{z-1} dt$$
This integral converges only for $\Re(z)>0$. However, if we expand $e^{-t}$ into power series and interchange the summation and integration, we get that
$$f(z) = \sum_{n=0}^{\infty} \dfrac {(-1)^n}{n!(n+z)}$$
which converges for every $z \not = -n$. This of course means that the interchange of summation and integration was not justified. However, I attempted to come up with a justification anyway, and I cannot find the mistake. Can you help me find it please?
Justification
We will use the Weierstrass $M$-test. First, if we replace $e^{-t}$ by a power seires and simplify, we get
$$f(z) = \int_0^1 \left[\sum_{n=0}^{\infty} \dfrac {(-1)^n}{n!}t^{n+z-1} \right]dt$$
We will now show that for $0< \delta < 1$, the series converges uniformly on $[\delta, 1]$. We have
$$\left|\dfrac {(-1)^n}{n!}t^{n+z-1} \right| = \dfrac {1}{n!}t^{\Re(z)+n-1}$$
For $n$ large enough (greater than some $N$), we have $\Re(z)+n-1 > 0$, and as a result,
$$\dfrac {1}{n!}t^{\Re(z)+n-1} < \dfrac {1}{n!} = M_n, \text{ and } \sum_{n=N}^{\infty} M_n \text{converges}$$
Therefore $$\sum_{n=N}^{\infty} \dfrac {(-1)^n}{n!}t^{n+z-1}$$
converges uniformly on $[\delta, 1]$, and as a result,
$$\sum_{n=0}^{N-1} \dfrac {(-1)^n}{n!}t^{n+z-1} + \sum_{n=N}^{\infty} \dfrac {(-1)^n}{n!}t^{n+z-1} = \sum_{n=0}^{\infty} \dfrac {(-1)^n}{n!}t^{n+z-1} $$
converges uniformly on $[\delta, 1].$ Therefore
$$\int_{\delta}^1 \left[\sum_{n=0}^{\infty} \dfrac {(-1)^n}{n!}t^{n+z-1} \right]dt = \sum_{n=0}^{\infty} \left[ \int_{\delta}^1 \dfrac {(-1)^n}{n!}t^{n+z-1} dt \right] = \sum_{n=0}^{\infty} \left[ \dfrac {(-1)^n}{n!(n+z)}- \dfrac {(-1)^n}{n!(n+z)} \delta^{n+z} \right]$$
$$= \sum_{n=0}^{\infty} \dfrac {(-1)^n}{n!(n+z)} - \sum_{n=0}^{\infty} \dfrac {(-1)^n}{n!(n+z)} \delta^{n+z}$$
Now looking at the sum on the right as a function of $\delta$, we can argue that the series converges uniformly by splitting up the series as we did above. Thus if we take the limit as $\delta \to 0$, that sum vanishes and we get that
$$\int_{0}^1 \left[\sum_{n=0}^{\infty} \dfrac {(-1)^n}{n!}t^{n+z-1} \right]dt = \sum_{n=0}^{\infty} \dfrac {(-1)^n}{n!(n+z)} $$, as desired.