Evaluation of $\displaystyle \int^{\infty}_{0}\frac{x^{p-1}}{1+x^q}dx$
My attempt: put $\displaystyle1+x^q=\frac{1}{t}$. Then $qx^{q-1}dx=-\frac{1}{t^2}dt$.
So integral $$I=\frac{1}{q}\int^{1}_{0}\frac{(1-t)^{\frac{p-q}{q}}}{t^{p-q}}dx$$
It seems that we can express it in terms of the beta or gamma functions.
Could some help me to explain it.
$$\begin{align}I&=\int_0^\infty\dfrac{x^{p-1}}{1+x^q}\mathrm dx\\\text{Let }\dfrac1t&=1+x^q\implies-\dfrac{\mathrm dt}{t^2}=qx^{q-1}\mathrm dx\\&\qquad\qquad\implies-\dfrac1{qt^2}\mathrm dt=x^{q-1}\mathrm dx\\\hline I&=\int_0^\infty\dfrac{x^{q-1}\cdot x^{p-q}}{1+x^q}\mathrm dx\\&=\int_0^1\dfrac1{qt^2}\cdot\left(\dfrac1t-1\right)^{\frac{p-q}q}t\,\mathrm dt\\&=\dfrac1q\int_0^1\dfrac{(1-t)^{\frac{p-q}q}}{t\cdot t^{\frac{p-q}q}}\mathrm dt\\&=\dfrac1q\int_0^1t^{-\frac pq}(1-t)^{\frac pq-1}\mathrm dt\\&=\dfrac1q\int_0^1t^{\left(-\frac pq+1\right)-1}(1-t)^{\frac pq-1}\mathrm dt\\&=\dfrac1qB\left(1-\dfrac pq,\dfrac pq\right)\\&=\dfrac1q\cdot\dfrac{\Gamma\left(1-\dfrac pq\right)\Gamma\left(\dfrac pq\right)}{\Gamma(1)}\\&=\dfrac1q\cdot\dfrac\pi{\sin\left(\dfrac {p\pi}q\right)}\end{align}$$
Using Euler's reflection formula $$\boxed{\Gamma(1-z)\Gamma(z)=\dfrac\pi{\sin \pi z}}$$