The substitution $e^x=y$ leads to the integral $ \int_0^\infty\frac{y^{a-1}}{y+1}\,dy. $ This can be computed integrating the function $f(z)=z^{a-1}/(z+1)$ along the keyhole contour. We consider the branch of $z^{a-1}$ defined on $\mathbb{C}\setminus[0,\infty)$ with $f(-1)=e^{\pi i}$. For small $\epsilon>0$ and large $R>0$, he contour is made up of the interval $[\epsilon,R]$, the circle $C_r=\{|z|=R\}$ counterclockwise, the interval $[R,\epsilon]$ and the circle $C_\epsilon=\{|z|=\epsilon\}$ clockwise. The function $f$ has a simple pole at $z=-1$ with residue $(-1)^{a-1}=e^{\pi(a-1)i}$. It is easy to see that $ \lim_{\epsilon\to0}\int_{C_\epsilon}f(z)\,dz=\lim_{R\to\infty}\int_{C_R}f(z)\,dz=0. $ Then $ \int_0^\infty\frac{y^{a-1}}{y+1}\,dy+\int_\infty^0\frac{(e^{2\pi i}y)^{a-1}}{y+1}\,dy=2\,\pi\,i\operatorname{Res}(f,-1), $ from where $ \bigl(1-e^{2\pi(a-1)i}\bigr)\int_0^\infty\frac{y^{a-1}}{y+1}\,dy=2\,\pi\,i\,e^{\pi(a-1)i} $ and $ \int_0^\infty\frac{y^{a-1}}{y+1}\,dy=\frac{\pi}{\sin((1-a)\pi)}. $