Way to solve $\int\limits _0^\limits\infty \frac{x^{-t}}{1+x}\ dx$

The usual strategy substitutes $x=\tan^2\theta$ so, if you know your Beta and Gamma functions, the integral becomes $$\int_0^{\pi/2}2\tan^{1-2t}\theta\operatorname{d}\theta=\operatorname{B}(1-t,\,t)=\Gamma (1-t)\Gamma (t)=\pi\csc\pi t.$$The final result is the Gamma function's reflection formula.


This approach avoids a direct mention of the Bèta function because to some this function may sound a bit vague. Instead, this approach makes use of the Gamma function.

Let us consider your integral: $$I=\int_0^\infty\frac{x^{-t}}{1+x}dx$$ Let $z=\frac{x}{1+x}\rightarrow x=\frac{z}{1-z}$ such that $dx=\frac{dz}{(1-z)^2}$, where $0<z<1$: $$I=\int_0^1 z^{(1-t)-1}\cdot (1-z)^{(t)-1}dz$$ Establish the integral: $$J=\int_0^\infty e^{-y}\cdot y^{(1-t)+(t)-1}dy=\int_0^\infty e^{-y}dy=1$$ Therefore, $$I=J\cdot I=\int_0^\infty e^{-y}\cdot y^{(1-t)+(t)-1}dy\cdot \int_0^1 z^{(1-t)-1}\cdot (1-z)^{(t)-1}dz$$ It follows that $$I=\int_0^1\int_0^\infty e^{-y}\cdot(y\cdot z)^{(1-t)-1}\cdot(y\cdot(1-z))^{(t)-1}\cdot y\ dy\ dz$$ Let $v=y\cdot z$ and $w=y\cdot (1-z)$. Note that $v+w=y$.

Since $0<y<\infty$ and $0<z<1$, it follows that $0<v<\infty$ and $0<w<\infty$.

The Jacobian is given by $$\frac{\partial(v,w)}{\partial(y,z)}=\begin{vmatrix}\frac{\partial v}{\partial y}&\frac{\partial v}{\partial z}\\\frac{\partial w}{\partial y}&\frac{\partial w}{\partial z}\\ \end{vmatrix}=\begin{vmatrix}z&y\\1-z&-y\\ \end{vmatrix}=-y\cdot z-y+y\cdot z=-y$$ Because $y>0$, it follows that $dv\ dw=\left|\frac{\partial(v,w)}{\partial(y,z)}\right|dy\ dz=y\ dy\ dz$.

Therefore, $$I=\int_0^\infty\int_0^\infty e^{-(v+w)}\cdot v^{(1-t)-1}\cdot w^{(t)-1}dv\ dw$$ It follows that $$I=\int_0^\infty e^{-v}\cdot v^{(1-t)-1}dv\cdot\int_0^\infty e^{-w}\cdot e^{(t)-1}dw$$ Write the integrals in terms of the Gamma function: $$I=\Gamma(1-t)\cdot\Gamma(t)$$ Because $0<t<1$, one can apply Euler's reflection formula (which holds for non-integer values of $t$): $$I=\frac{\pi}{\sin(\pi\cdot t)}=\pi\cdot\csc(\pi\cdot t)$$


Consider the contour integral $$I(t,\epsilon):=\oint_{\Gamma_{\epsilon}}\,f_t(z)\,\text{d}z\text{ for }\epsilon\in(0,1)\text{ and }t\in\mathbb{C}\text{ with }0<\text{Re}(t)<1\,,$$ where $$f_t(z):=\frac{z^{-t}}{1+z}\text{ for all }z\in\mathbb{C}\setminus\mathbb{R}_{\geq 0}\,,$$ and $\Gamma_\epsilon$ is the positively oriented keyhole contour $$\begin{align}\left[\epsilon\,\exp(\text{i}\epsilon),\frac{1}{\epsilon}\,\exp(\text{i}\epsilon)\right]&\cup\Biggr\{\frac{1}{\epsilon}\,\exp(\text{i}\theta)\,\Big|\,\theta\in[\epsilon,2\pi-\epsilon]\Biggr\} \\&\cup\left[\frac{1}{\epsilon}\,\exp\big(\text{i}(2\pi-\epsilon)\big),\epsilon\,\exp\big(\text{i}(2\pi-\epsilon)\big)\right]\cup\Biggr\{{\epsilon}\,\exp(\text{i}\theta)\,\Big|\,\theta\in[2\pi-\epsilon,\epsilon]\Biggr\}\,.\end{align}$$ (You can also use a similar keyhole contour like this one.)

Then, we see that $$\lim_{\epsilon\to 0^+}\,I(t,\epsilon)=\big(1-\exp(-2\text{i}\pi t)\big)\int_0^\infty\,\frac{x^{-t}}{1+x}\,\text{d}x\,.$$ By the Residue Theorem, $$\lim_{\epsilon\to 0^+}\,I(t,\epsilon)=2\pi\text{i}\,\text{Res}_{z=-1}\big(f_t(z)\big)=2\pi\text{i}\exp(-\text{i}\pi t)\,.$$ Consequently, $$\int_0^\infty\,\frac{x^{-t}}{1+x}\,\text{d}x=\frac{2\pi\text{i}\exp(-\text{i}\pi t)}{1-\exp(-2\text{i}\pi t)}=\frac{\pi}{\sin(\pi t)}=\pi\,\text{csc}(\pi t)$$ for all complex numbers $t$ such that $0<\text{Re}(t)<1$.