Show that $\int_{0}^{\infty}\frac{x^{m-1}}{1+x^{n}} dx= \frac{\pi}{n}(sin(\frac{m}{n}\pi))^{-1}$
I am trying to prove this using complex analysis. From the residue theorem i know that $\int_{-\infty}^{\infty} f(z) dz = 2\pi i \sum res(\frac{f(z_{0})}{g'(z_{0})})$
Now if n is an even number i could write the integral as $\frac{1}{2}\int_{-\infty}^{\infty}\frac{x^{m-1}}{1+x^{n}} dx $
The denominator has exactly n pole, all could be written as $e^{\frac {i\pi }{n}},........,e^{(i\pi- \frac {i\pi }{n})}$
If i want to use the residue theorem here i know that $f= z_{0}^{m-1}$ and $ g'=nz_{0}^{n-1}$
Evaluating now the residue: $\frac{1}{2n}2\pi i \frac{e^{(\frac {i\pi }{n})^{m-1}}+...+e^{(i\pi-\frac {i\pi }{n})^{m-1}}}{e^{(\frac {i\pi }{n})^{n-1}}+...+e^{(i\pi-\frac {i\pi }{n})^{n-1}}} $
After this step i try to simplify but it does not work, i must have something wrong.
Observe $n>m$ otherwise the integral diverges. Using the change of variable $u= x^n$, we see that \begin{align} \int^\infty_0 \frac{x^{m-1}}{1+x^n}\ dx = \frac{1}{n}\int^\infty_0 \frac{u^{\frac{m}{n}-1}}{1+u}\ du = \frac{1}{n}B\left(\frac{m}{n}, \frac{n-m}{n} \right) = \frac{\Gamma(\frac{m}{n})\Gamma(\frac{n-m}{n})}{n\Gamma(1)} \end{align} Now, using the fact that \begin{align} \frac{1}{\Gamma(x)\Gamma(1-x)} = \frac{\sin \pi x}{\pi x} \end{align} we get the desired result.