Contour integral of $\int_{-\infty}^\infty \frac{e^{ax}}{1+e^x}dx $ with non rectangular contour Is there a way to solve the integral of $$\int_{-\infty}^\infty \frac{e^{ax}}{1+e^x}dx $$ for $$a\in (0,1)$$
without using the rectangular region like in this post but still using a contour integral?
Perhaps using a semicircular region, circular region, or freshnel contour perhaps? I just don't have a lot of experience with the rectangular region problems. 
Thanks.
 A: After substituting $x\mapsto\log(x)$, we use the keyhole contour from this answer with $n=a-1$ and $m=1$:
$$
\begin{align}
\int_{-\infty}^\infty\frac{e^{ax}}{1+e^x}\,\mathrm{d}x
&=\int_0^\infty\frac{x^{a-1}}{1+x}\,\mathrm{d}x\\
&=\pi\csc(\pi a)
\end{align}
$$
A: (Not using contour integration ; Sorry )
$$I=\int_{-\infty}^{\infty} \frac {e^{ax}}{1+e^x} dx=\int_{-\infty}^{\infty} \frac {e^x\cdot e^{ax}}{e^x+e^{2x}} dx$$
Use the substitution $e^x=t$
$$I=\int_{0}^{\infty} \frac {t^{a-1}}{1+t}dt =B(a,1-a)=\Gamma(a)\Gamma(1-a)=\frac {\pi}{\sin (\pi a)}$$
A: Sure!
Take contour $C$ as an infinitely large semicircle on the upper half plane, centered at the origin.
Let $f(z)=\frac{e^{az}}{1+e^z}$.
Note that $$\oint_C f(z)dz=\int^\infty_{-\infty}f(z)dz+\int_{\text{arc}}f(z)dz$$ and the arc integral vanishes.

The poles enclosed are at $z=(2n+1)\pi i$ where $n\ge 0$.
It is easy to show that $$\text{Res}_{z=(2n+1)\pi i}f(z)=-e^{(2n+1)a\pi i}$$
Therefore, the sum of residues is a geometric series:
$$2\pi i\sum\text{Res}=-2\pi i\cdot e^{a\pi i}\cdot\frac1{1-e^{2a\pi i}}= \frac{\pi}{\sin(a\pi)}$$

As a result, by Residue theorem,
$$\color{red}{\int^\infty_{-\infty}\frac{e^{ax}}{1+e^x}= \frac{\pi}{\sin(a\pi)}}$$

As mentioned in the comments, the geometric series does not converge. However, if we use residue method to evaluate 
$$\lim_{k\to a}\int^\infty_{-\infty}\frac{e^{kx}}{1+e^x}dx$$, we would always obtain a convergent geometric sum, no mattet in which direction $a$ is approached, except horizontally. (I can attach a proof on request) Unfortunately, the integral would evaluate to a divergent series if $k=a$. I don’t know an explanation for this phenomenon.
