Evaluate the integral $\int\limits_{-\infty}^{\infty} \frac{e^{ax}}{1 + e^x}dx\;$ where $\;0I have to evaluate : $\displaystyle\int_{-\infty}^{\infty} \frac{e^{ax}}{1 +  e^x}dx\;$ where $\;0<a<1\;.$
I know that we have :
$\displaystyle\int_{-\infty}^{\infty} \frac{e^{ax}}{1 +  e^x}dx =\lim\limits_{R \to \infty}\int_{-R}^{R} \frac{e^{ax}}{1 +  e^x}dx =$
$\displaystyle\quad=\lim\limits_{R \to \infty}\int_{\gamma_R} \frac{e^{ax}}{1 +  e^x}dx - \int_{C_R} \frac{e^{ax}}{1 +  e^x}dx$
For C$_R$ half-circle runs $R$ from $-R$ and $\gamma_R$ a closed contour.
I have a hint: try other closures than C$_R\;.$
 A: $$I(a)=\int_{-\infty}^{\infty} \frac{e^{ax}}{1 + e^x}dx$$
Using the following contour and periodicity of $\,e^{x+2\pi i}=e^x$

$$\oint=I(a)+I_1+I_2-e^{2\pi ia}I(a)=2\pi i Res_{x=\pi i}\frac{e^{ax}}{1 + e^x}$$
It can be shown that $I_1$ and $I_2\to0$ at $R\to\infty$. We have a single simple pole inside the contour at $x=e^{\pi i}$, therefore
$$I(a)(1-e^{2\pi ia})=-2\pi i e^{i\pi a}$$
$$I(a)=\frac{\pi}{\sin(\pi a)}$$
A: I'm bad with contour integration, but this is another way of evaluating the integral.
Let's separate the integral in 2 parts $I=I_1+I_2$:
$$I_1=\int_0^\infty \frac{e^{a x}dx}{e^x+1}$$
$$I_2=\int_0^\infty \frac{e^{(1-a) x}dx}{e^x+1}$$
Clearly, both integrals have the same form just with $a \to 1-a$.
Let's find $I_1$:
$$I_1=\sum_{n=0}^\infty (-1)^n \int_0^\infty e^{-(n+1-a) x} dx=\sum_{n=0}^\infty \frac{(-1)^n}{n+1-a}$$
So our integrals are:
$$I_1=\sum_{n=0}^\infty \frac{(-1)^n}{n+1-a}=\frac{1}{2} \left[\psi \left(1-\frac{a}2 \right)-\psi \left(\frac12-\frac{a}2  \right) \right]$$
$$I_2=\sum_{n=0}^\infty \frac{(-1)^n}{n+a}=\frac{1}{2} \left[\psi \left(\frac12+\frac{a}2 \right)-\psi \left(\frac{a}2 \right) \right]$$
Where we used https://en.wikipedia.org/wiki/Digamma_function and one of its series definition.
We have, using reflection formula:
$$\psi \left(1-\frac{a}2 \right)=\psi \left(\frac{a}2 \right)+\pi \cot \frac{\pi a}{2}$$
$$\psi \left(\frac12-\frac{a}2  \right)=\psi \left(\frac12+\frac{a}2 \right)+\pi \cot \left(\frac{\pi}{2}+\frac{\pi a}{2} \right)$$
Collecting all the terms, we now have:
$$I=\frac{\pi}{2} \left( \cot \frac{\pi a}{2} -\cot \left(\frac{\pi}{2}+\frac{\pi a}{2} \right)\right)=\frac{\pi}{2} \left( \cot \frac{\pi a}{2} +\tan \frac{\pi a}{2}\right)=\frac{\pi}{\sin \pi a}$$
Clearly, this is not a satisfactory answer, since the most clear proof of the reflection formula comes from complex analysis. Still, I hope this might be helpful.
A: $$I(a)=\int_{-\infty}^\infty\frac{e^{ax}}{1+e^x}\,dx$$
$u=1+e^x\Rightarrow dx=du/e^x=du/(u-1)$ so:
$$I(a)=\int_1^\infty\frac{(u-1)^a}{u(u-1)}du=\int_1^\infty(u-1)^{a-1}u^{-1}\,du$$
and this wouldnt be too hard to write in terms of the incomplete beta function so you could express it as the limit of that?
