Find the value of $\int_0^{\infty} \frac{x^{a-1}\,\mathrm{d}x}{1+x^{2}},\,$ where $\,0Using the Residue Theorem calculate
$$
\int_0^{\infty} \frac{x^{a-1}\,\mathrm{d}x}{1+x^{2}},\,\,\,\, \text{where}\,\,\,0<a<2.
$$
My solution comes out to be
$$ \frac{\pi}{2}[i^{a-1}-(-i)^{a-1}]$$
How to proceed from here since the solution of a rational expression must be independent of  $i$

In this answer, it is shown that for $m\gt0$ and $-1<n<m-1$
$$
\frac{\pi}{m}\csc\left(\pi\frac{n+1}{m}\right)=\int_0^\infty\frac{x^n}{1+x^m}\,\mathrm{d}x
$$
Plug in $n=a-1$ and $m=2$ to get that for $0\lt a\lt2$
$$
\int_0^\infty\frac{x^{a-1}}{1+x^2}\,\mathrm{d}x=\frac\pi2\csc\left(\frac{\pi a}2\right)
$$
