I had to compute a series expansion of $1/(e^{x}-1)$ about $x=0$, and in the course of its derivation, I made a couple of manipulations that are not allowed mathematically. Still, comparing the final result against Maple showed that it was right.
The following is what I did:
\begin{equation} \begin{split} \frac{1}{e^{x}-1} &= \frac{e^{-x}}{1-e^{-x}} = \sum_{n=1}^{\infty} e^{-nx} \\ &= \sum_{n=1}^{\infty} \sum_{k=-\infty}^{\infty}\frac{(-nx)^{k}}{\Gamma(k+1)}\\ &= \sum_{k=-\infty}^{\infty}(-1)^{k}\frac{x^{k}}{\Gamma(k+1)}\sum_{n=1}^{\infty} n^{k}\\ &= \sum_{k=-\infty}^{\infty}(-1)^{k}\frac{\zeta(-k)}{\Gamma(k+1)} x^{k}\\ &= \sum_{k=-1}^{\infty}(-1)^{k}\frac{\zeta(-k)}{\Gamma(k+1)} x^{k}\\ \end{split} \end{equation} I naively exchanged the order of summation to obtain the third line. Then, I pretended that the summation over $n$ converged (i.e., as if $k$ were always smaller than -1), and replaced it by the Riemann zeta function. Notice that whenever $1/\Gamma(k+1) = 0$ , the coefficient of $x^{k}$ vanishes except when $k=-1$, for which the poles of gamma and zeta functions cancel out and give a finite value.
I suppose that there is a deeper reason that such unreliable steps led me to the correct result? My guess is that it has to do with the analytic structure of the summand as a function of $k$, but I haven't been able to figure out in detail why and when this works.
I'll appreciate any insights on this.