Closed form for $ \int_0^\infty {\frac{{{x^n}}}{{1 + {x^m}}}dx }$
Solution 1:
I would like to make a supplementary calculation on BR's answer.
Let us first assume that $0 < \mu < \nu$ so that the integral $$ \int_{0}^{\infty} \frac{x^{\mu-1}}{1+x^{\nu}} \; dx $$ converges absolutely. By the substitution $x = \tan^{2/\nu} \theta$, we have $$ \frac{dx}{1+x^{\nu}} = \frac{2}{\nu} \tan^{(2/\nu)-1} \theta \; d\theta. $$ Thus $$ \begin{align*} \int_{0}^{\infty} \frac{x^{\mu-1}}{1+x^{\nu}} \; dx & = \int_{0}^{\frac{\pi}{2}} \frac{2}{\nu} \tan^{\frac{2\mu}{\nu}-1} \theta \; d\theta \\ & = \frac{1}{\nu} \beta \left( \frac{\mu}{\nu}, 1 - \frac{\mu}{\nu} \right) \\ & = \frac{1}{\nu} \Gamma \left( \frac{\mu}{\nu} \right) \Gamma \left( 1 - \frac{\mu}{\nu} \right) \\ & = \frac{\pi}{\nu} \csc \left( \frac{\pi \mu}{\nu} \right), \end{align*} $$ where the last equality follows from Euler reflexion formula.
Solution 2:
The general formula (for $m > n+1$ and $n \ge 0$) is $\frac{\pi}{m} \csc\left(\frac{\pi (n+1)}{m}\right)$. IIRC the usual method involves a wedge-shaped contour of angle $2 \pi/m$.
EDIT: Consider $\oint_\Gamma f(z)\ dz$ where $f(z) = \frac{z^n}{1+z^m}$ (using the principal branch if $m$ or $n$ is a non-integer) and $\Gamma$ is the closed contour below:
$\Gamma_1$ goes to the right along the real axis from $\epsilon$ to $R$, so $\int_{\Gamma_1} f(z)\ dz = \int_\epsilon^R \frac{x^n\ dx}{1+x^m}$. $\Gamma_3$ comes in along the ray at angle $2 \pi/m$. Since $e^{(2 \pi i/m) m} = 1$, $\int_{\Gamma_3} f(z)\ dz = - e^{2 \pi i (n+1)/m} \int_{\Gamma_1} f(z)\ dz$. $\Gamma_2$ is a circular arc at distance $R$ from the origin. Since $m > n+1$, the integral over it goes to $0$ as $R \to \infty$. Similarly, the integral over the small circular arc at distance $\epsilon$ goes to $0$ as $\epsilon \to 0$. So we get
$$ \lim_{R \to \infty, \epsilon \to 0} \int_\Gamma f(z)\ dz = (1 - e^{2 \pi i (n+1)/m}) \int_0^\infty \frac{x^n\ dx}{1+x^m}$$
The meromorphic function $f(z)$ has one singularity inside $\Gamma$, a pole at $z = e^{\pi i/m}$ where the residue is $- e^{\pi i (n+1)/m}/m$. So the residue theorem gives you
$$ \int_0^\infty \frac{x^n\ dx}{1+x^m} = \frac{- 2 \pi i e^{\pi i (n+1)/m}}{ m (1 - e^{2 \pi i (n+1)/m})} = \frac{\pi}{m} \csc\left(\frac{\pi(n+1)}{m}\right)$$
Solution 3:
Contour Integration Approach
Assuming only that $m>0$ and $-1<n<m-1$, let $z=x^m$ with the exaggerated contour $\gamma$:
$\hspace{4.5cm}$
$\gamma$ is actually tight above and below the positive real axis and around the origin and circles back at an arbitrarily large distance from the origin.
The part just above the positive real axis captures the integral. The part just below the positive real axis gets $-e^{2\pi i\frac{n-m+1}{m}}$ times the integral. The residue at $z=-1$ of $\frac{z^{\frac{n-m+1}{m}}}{1+z}$ is $e^{\pi i\frac{n-m+1}{m}}$. Putting this all together yields
$$ \frac1m\int_\gamma\frac{z^{\frac{n-m+1}{m}}}{1+z}\,\mathrm{d}z=\left(1-e^{2\pi i\frac{n-m+1}{m}}\right)\int_0^\infty\frac{x^n}{1+x^m}\,\mathrm{d}x $$ $$ \frac{2\pi i}{m}e^{\pi i\frac{n-m+1}{m}}=\left(1-e^{2\pi i\frac{n-m+1}{m}}\right)\int_0^\infty\frac{x^n}{1+x^m}\,\mathrm{d}x $$ $$ \frac{\pi}{m}=\sin\left(\pi\frac{n+1}{m}\right)\int_0^\infty\frac{x^n}{1+x^m}\,\mathrm{d}x $$ $$ \frac{\pi}{m}\csc\left(\pi\frac{n+1}{m}\right)=\int_0^\infty\frac{x^n}{1+x^m}\,\mathrm{d}x\tag1 $$
Relation to $\bf{\Gamma(\alpha)\Gamma(1-\alpha)}$
Setting $m=1$, $n=\alpha-1$, and using the substitution $s=tu$ yields Euler's Reflection Formula: $$ \begin{align} \Gamma(\alpha)\Gamma(1-\alpha) &=\int_0^\infty s^{\alpha-1}e^{-s}\,\mathrm{d}s\int_0^\infty t^{-\alpha}e^{-t}\,\mathrm{d}t\\ &=\int_0^\infty\int_0^\infty u^{\alpha-1}e^{-(tu+t)}\,\mathrm{d}u\,\mathrm{d}t\\ &=\int_0^\infty\frac{u^{\alpha-1}}{1+u}\,\mathrm{d}u\\[6pt] &=\pi\csc(\pi\alpha)\tag2 \end{align} $$
Another Proof of $\bf{(1)}$ $$ \begin{align} \int_0^\infty\frac{x^{\alpha-1}}{1+x}\,\mathrm{d}x &=\int_0^1\frac{x^{-\alpha}+x^{\alpha-1}}{1+x}\,\mathrm{d}x\\ &=\sum_{k=0}^\infty(-1)^k\int_0^1\left(x^{k-\alpha}+x^{k+\alpha-1}\right)\mathrm{d}x\\ &=\sum_{k=0}^\infty(-1)^k\left(\frac1{k-\alpha+1}+\frac1{k+\alpha}\right)\\ &=\sum_{k\in\mathbb{Z}}\frac{(-1)^k}{k+\alpha}\\[9pt] &=\pi\csc(\pi\alpha)\tag3 \end{align} $$ where the last step of $(3)$ is proven in $(3)$ of this answer. Then apply $(3)$ to get $$ \begin{align} \int_0^\infty\frac{x^n}{1+x^m}\,\mathrm{d}x &=\frac1m\int_0^\infty\frac{x^{\frac{n-m+1}m}}{1+x}\,\mathrm{d}x\\ &=\frac\pi{m}\csc\left(\pi\frac{n+1}m\right)\tag4 \end{align} $$
Solution 4:
Use Ramanujan's Master theorem, with $u=x^b\Rightarrow dx=\frac{du}{bu^{1-\frac{1}{b}}}$:
$$\int_0^{\infty}\frac{x^{a-1}}{1+x^b}dx=\frac{1}{b}\int_0^{\infty}\frac{u^{\frac{a-1}{b}-1+\frac{1}{b}}}{1+u}du$$ $$=\frac{1}{b}\int_0^{\infty}u^{\frac{a}{b}-1}\sum_{k \ge 0}\frac{(-u)^k}{\Gamma(k+1)}\Gamma(k+1)du$$ $$=\frac{1}{b}\Gamma\left(\frac{a}{b}\right)\Gamma\left(1-\frac{a}{b}\right)=\frac{\pi}{b \sin \left(\frac{a\pi}{b}\right)}.$$