Which rule has been applied here? 
$$\int_0^\infty \frac{1}{1+x^n} \, dx=\frac 1n \int_0^\infty \frac{x^{\frac 1n-1}}{1+x} \, dx=\frac 1n \left(\frac{\pi}{\sin \frac{\pi}n} \right)=\frac{\pi}n\csc\left(\frac{\pi}n\right)$$

Which rule or law has been applied after the first equality sign?
 A: The "rule" that has been applied is

$$ \int_0^\infty \frac{x^{a - 1}}{1 + x} = \frac{\pi}{\sin \pi a}, \quad 0 < a < 1$$

If you don't know residue theory, one way to show this is to prove that the function
$$F(a) = \int_0^\infty \frac{x^{a-1}}{1 + x}\, dx,\quad 0 < a < 1$$
satisfies the differential equation
$$\ddot{F}F - \dot{F}^2 - F^4 = 0,\quad F(1/2) = \pi, \quad \dot{F}(1/2) = 0$$
and verify that the unique solution is $\pi/\sin \pi a$. 
A: The substitution
$$
z = x^n \\
dz = n x^{n-1} dx = n (z/x) \, dx 
\Rightarrow 
dx = \frac{1}{n} \frac{x}{z} dz
= \frac{1}{n} \frac{z^{1/n}}{z} dz
= \frac{1}{n} z^{(1/n)-1} dz
$$
which leads to
$$
\int\limits_0^\infty \frac{dx}{1+x^n} =
\frac{1}{n}\int\limits_0^\infty \frac{z^{(1/n)-1}}{1+z} dz
$$
was used and then they renamed $z$ back into $x$.
A: Letting $u=x^n$,
$$
\begin{align}
\int_0^\infty\frac{\mathrm{d}x}{1+x^n}
&=\frac1n\int_0^\infty\frac{u^{\frac1n-1}}{1+u}\,\mathrm{d}u\\[8pt]
&=\tfrac1n\mathrm{B}\left(\tfrac1n,1-\tfrac1n\right)\\[4pt]
&=\frac1n\frac{\Gamma\left(\frac1n\right)\Gamma\left(1-\frac1n\right)}{\Gamma(1)}
\end{align}
$$
where $\mathrm{B}(x,y)$ is the Beta Function and $\Gamma(x)$ is the Gamma Function.
We can use Euler's Reflection Formula, which says
$$
\Gamma(x)\Gamma(1-x)=\pi\csc(\pi x)
$$
A number of methods for evaluating this integral and a proof of the Euler's Reflection Formula can be found in this answer.
