Question Residues -integral at Complex Analysis How can i find the integral below , which transformation should i do ? İ think i need to get $sin$ and $cos $ but i can't see 
$$\int\limits^{+\infty}_{-\infty} \frac{ \exp\left({ax}\right)} {1+\exp\left({x}\right)} \, \mathrm{d}x $$  for$  $  $ 0<a<1$
 A: Transform by subbing $u=e^x$, $dx=du/u$, to get
$$\int_0^{\infty} du \frac{u^{a-1}}{1+u}$$
This is easily attacked in the complex plane by using a keyhole contour about the positive real axis.  The result is that
$$\left (1-e^{i 2 \pi a} \right ) \int_0^{\infty} du \frac{u^{a-1}}{1+u} = i 2 \pi e^{i \pi (a-1)}$$
A: Another contour: you can forgo transforming the integrand if you use a rectangular contour whose horizontal components are the segment $[-R, R] \subset \mathbb{R}$ and $[- R, R] + 2 \pi i$. The vertical components vanish in the limit as $R \to \infty$, and there is a single simple pole in the interior region at $x = i \pi$. The integrands along the top and bottom horizontal lines are easily related.
A: I'll develop the method involving the substitution $u=e^x$, $\mathrm{d}x = \mathrm{d}u / u$, which has already already been mentioned, hoping it can help.
Calling $\Gamma$ the standard keyhole contour about the positive real line and the origin we have:
$$
\oint_{\Gamma}\frac{z^{a-1}}{z+1}\mathrm{d}z = 2\pi i e^{i\pi (a-1)} = -2 \pi i e^{i\pi a}
$$
by Residues' Theorem.
Furthermore, as the outer and inner circle of the contour tend to infinity and zero respectively, the contributes to the integral coming from these two traits go to zero: this is due to our integrand going down faster than $1/z$ as $|z|\to\infty$ and being regular in the origin.
To evaluate the other two pieces we can choose as a branch line for our polar expression of $z = \rho e^{i\theta}$ exactly on the positive real axis: $\theta \in [0, 2\pi )$.
We are then left with:
$$
\int_{0}^{\infty}\frac{x^{a-1}}{x+1}\mathrm{d}x - \int_{0}^\infty \frac{x^{a-1} e^{i2\pi(a-1)}}{x+1}\mathrm{d}x = (1-e^{i2\pi a})\int_{0}^{\infty}\frac{x^{a-1}}{x+1}\mathrm{d}x =  -2 \pi i e^{i\pi a}.
$$
Or again:
$$
\int_{0}^{\infty}\frac{x^{a-1}}{x+1}\mathrm{d}x = \pi \frac{2i}{e^{i \pi a}-e^{-i \pi a}} = \frac{\pi}{\sin(\pi a)}.
$$
