\begin{equation} \int_0^{\infty} \dfrac{x^{\lambda -1}}{x^2+1} dx = \dfrac{\pi}{2 \sin{\dfrac{\pi \lambda}{2}}} \quad (0< \lambda < 2) \end{equation}
I will prove this using complex integral, but I don't come up with how I should set the integral route.
I tried prove the equality using the integral route below and using residue theorem.
$ C_{R} : \text{semicircle in first and second quadrant whose radius is R }\\ C_1 : [-R, \epsilon]\\ C_{\epsilon} : \text{semicircle in first and second quadrant whose radius is $\epsilon$ }\\ C_2 : [\epsilon, R] $
However, I failed to prove. It seems that it is impossible to calculate the integral with this integral route.
I would like you to teach me how I should set the integral route.
One may use $\beta$ function.
$$I=\int_{0}^{\infty} \frac{x^{k-1}}{1+x^2} dx$$ Let $x=\tan t$, then $$I=\int_{0}^{\pi/2} \sin^{k-1}t ~\cos^{1-k}t ~dt=\frac{1}{2} \frac{\Gamma(k/2)\Gamma(1-k/2)}{\Gamma(1)}= \frac{\pi}{2}\csc(\pi k/2), 0<k<2$$
See for $\beta$ function: https://en.wikipedia.org/wiki/Beta_function