How do I get the residue of the given function? I'm reading the solution of the integral:
$$\int\limits_{-\infty}^{\infty} dx\frac{e^{ax}}{1+e^x}$$
by the residue method. And I understood everything, but how to get the residue of $\frac{e^{az}}{1+e^z}$ (the book just states that the residue is $-e^{i\pi a}$).
I know there is a simple pole at $z=i\pi$ and that is the point where I want the residue.
Since it is a simple pole I tried using the formula $a_{-1}=f(x)(z-z_0)$ by using the series expansion of the exponential function and I got to this formula
$$a_{-1}=-e^{i\pi a}\left[\frac{\left(1+\sum\limits_{n=1}^{\infty}\frac{(z-i\pi)^{n-1}}{n!}(z-i\pi)\right)^a}{\sum\limits_{n=1}^{\infty}\frac{(z-i\pi)^{n-1}}{n!}}\right]_{z=i\pi}$$but I believe thats wrong and I couldn't find my mistake or another way of solving it.

$$\lim_{z\to\pi i}(z-\pi i)\frac{e^{az}}{1+e^z}\stackrel{\text{L'Hopital}} = \lim_{z\to\pi i}\frac{e^{az}}{e^z} = -e^{a\pi i}$$.
