# 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}$$.

-

Make change of variables $u=e^x$ to get $$\int\limits_{-\infty}^\infty\frac{e^{ax}}{1+e^x}dx= \int\limits_{0}^\infty\frac{u^{a-1}}{1+u}du$$ then see this answer.

-
On this link he doesn't show the steps too, and I couldn't find it myself even using the function used on the link. – Ivan Lerner Nov 14 '12 at 16:00

Let $g,h$ holomorphic and $z_0 \in \Omega$ such that $h(z_0)=0$, $h'(z_0) \not= 0$ and $g(z_0) \not= 0$. Then the equality $$\text{Res}_{z=z_0} \frac{g}{h} = \frac{g(z_0)}{h'(z_0)}$$ holds.

In this example we obtain $$\text{Res}_{z=\imath \, \pi} f = \frac{e^{\imath \, \pi \cdot a}}{e^{\imath \, \pi}} = - e^{\imath \, \pi \cdot a}$$

-