Is there a general formula for $I(m,n)$? Consider the integral
$$I(m,n):=\int_0^{\infty} \frac{x^m}{x^n+1}\,\mathrm dx$$
For $m=0$, a general formula is $$I(0,n)=\frac{\frac{\pi}{n}}{\sin\left(\frac{\pi}{n}\right)}$$
Some other values are $$I(1,3)=\frac{2\pi}{3\sqrt{3}}$$ $$I(1,4)=\frac{\pi}{4}$$ $$I(2,4)=\frac{\pi}{2\sqrt{2}}$$
For natural $m,n$ the integral exists if and only if $n\ge m+2$. 

Is there a general formula for $I(m,n)$ with integers $m,n$ and $0\le m\le n-2$ ?

 A: We can use contour integration to arrive at the general result.  Note that
$$\begin{align}
\oint_C \frac{z^m}{z^n+1}\,dz&=2\pi i \text{Res}\left(\frac{z^m}{z^n+1}, z=e^{i\pi/n}\right)\\\\
&=-2\pi i \frac{e^{i\pi(m+1)/n}}{n}\tag 1
\end{align}$$
where $C$ is the "pie slice" contour comprised of (i) the real-line segment from $0$ to $R$, where $R>1$, (ii) the circular arc of radius $R$ that begins at $R$ and ends at $Re^{i2\pi/n}$, and $(3)$ the straight line segment from $Re^{i2\pi/n}$ to $0$.
Then, we can write
$$\oint_C \frac{z^m}{z^n+1}\,dz=\int_0^R \frac{x^m}{x^n+1}\,dx+\int_0^{2\pi/2}\frac{R^me^{im\phi}}{R^ne^{in\phi}+1}\,iRe^{i\phi}\,d\phi-\int_0^R \frac{x^me^{i2\pi m/n}}{x^n+1}e^{i2\pi/n}\,dx \tag 2$$
If $n>m+1$, then as $R\to \infty$, the second integral on the right-hand side of $(2)$ vanishes and we find that
$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty \frac{x^m}{x^n+1}\,dx=2\pi i\frac{e^{i\pi(m+1)/n}}{n(e^{i2\pi(m+1)/n}-1)}=\frac{\pi/n}{\sin(\pi(m+1)/n)}}$$
A: We shall compute it in two steps. First, perform the substitution $y = x^n$ in order to get
$$I(m,n) = \int \limits _0 ^\infty \frac {y ^{\frac m n}} {1 + y} \frac 1 n y ^{\frac 1 n - 1} \ \Bbb d y = \frac 1 n \int \limits _0 ^\infty \frac {y ^{\frac {m+1} n - 1}} {1 + y} \ \Bbb d y .$$
Now perform the change $t = \frac y {1+y}$, to obtain
$$I(m,n) = \frac 1 n \int \limits _0 ^1 \frac {\left( \frac t {1-t} \right) ^{\frac {m+1} n - 1}} {1 + \frac t {1-t}} \frac 1 {(1-t)^2} \ \Bbb d t = \frac 1 n  \int \limits _0 ^1 t^{\frac {m+1} n - 1} (1-t)^{- \frac {m+1} n} \ \Bbb d t = \frac 1 n  B \left( \frac {m+1} n, 1 - \frac {m+1} n \right) = \frac 1 n \frac \pi {\sin \pi {\frac {m + 1} n}} .$$
In the above, $B$ is Euler's Beta function and I have used the known formula $B(x, 1-x) = \frac \pi {\sin \pi x}$.
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

The integral diverges when $\ds{n = 0}$. Hereafter, we consider the case
  $\ds{n \not= 0}$:

\begin{align}
&\left.\vphantom{\Large A}\mrm{I}\pars{m,n}\right\vert_{\ n\ \not=\ 0}  \equiv
\int_{0}^{\infty}{x^{m} \over x^{n} + 1}\,\dd x
\,\,\,\stackrel{x^{n}\ \mapsto\ x}{=}\,\,\,
{1 \over n}\int_{0}^{\infty}{x^{\pars{m + 1}/n - 1} \over x + 1}\,\dd x
\\[2mm]
&\mbox{Note that the integral converges whenever}\ {m + 1 \over n} - 1 > -1\
\mbox{and}\ {m + 1 \over n} - 1 < 0
\\
&\mbox{which is equivalent to}\ \color{#f00}{0 < {m + 1 \over n} < 1}.
\end{align}

\begin{align}
\left.\vphantom{\Large A}\mrm{I}\pars{m,n}\right\vert_{\ n\ \not=\ 0} & \equiv
\int_{0}^{\infty}{x^{m} \over x^{n} + 1}\,\dd x =
{1 \over n}\int_{0}^{\infty}x^{\pars{m + 1}/n - 1}\
\overbrace{\int_{0}^{\infty}\expo{-\pars{x + 1}t}\,\dd t}
^{\ds{1 \over x + 1}}\ \,\dd x
\\[5mm] & =
{1 \over n}\int_{0}^{\infty}\expo{-tx}\int_{0}^{\infty}x^{\pars{m + 1}/n - 1}
\expo{-tx}\,\dd x\,\dd t
\\[5mm] & \stackrel{tx\ \mapsto\ t}{=}\,\,\,
{1 \over n}\
\underbrace{\bracks{\int_{0}^{\infty}\expo{-tx}t^{-\pars{m + 1}/n}\,\dd t}}
_{\ds{\Gamma\pars{1 -\,{m + 1 \over n}}}}\
\underbrace{\bracks{\int_{0}^{\infty}x^{\pars{m + 1}/n - 1}\expo{-x}\,\dd x}}
_{\ds{\Gamma\pars{m + 1 \over n}}}
\\ &
\pars{~\mbox{where}\ \Gamma:\ Gamma\ Function~}
\\[5mm] & =\ \bbox[#ffe,10px,border:1px dotted navy]{\ds{%
{1 \over n}\,{\pi \over \sin\pars{\pi\bracks{m + 1}/n}}}}\qquad
\pars{~Euler\ Reflection\ Formula~}
\\[1mm] &
\mbox{and}\quad \color{#f00}{0 < {m + 1 \over n} < 1\,,\quad n \not= 0}
\end{align}
