Residue integral why $-e^{2\pi i/n}$ term comes for inclined line? $$-e^{2\pi i/n}\int_0^\infty\frac1{1+x^n}\mathrm{d}x\tag{3}$$
from 
Show that $\int_0^ \infty \frac{1}{1+x^n} dx= \frac{ \pi /n}{\sin(\pi /n)}$ , where $n$ is a positive integer.
this link I dont understand where does it come from? im writting this in mobile under very uncomfortable conditions so I am sory about the asking procedure. Can someone explain or give hint basically ? Thank you so much in advanced.
 A: In the linked derivation, we parametrize the curve along the inclined line as $z = e^{2 \pi i/n} x$, with $x$ running from $R$ to 0.  Thus, the path integral in the complex plane becomes
$$
\int_{\text{inclined} \atop \text{line}} \frac{1}{1 + z^n} dz = \int_R^0 \frac{1}{1 + x^n} d(e^{2 \pi i/n} x) = e^{2 \pi i/n} \int_R^0 \frac{1}{1 + x^n} dx \\= -e^{2 \pi i/n} \int_0^R \frac{1}{1 + x^n} dx.
$$ 
A: A complex path integral along a differentiable path $\gamma:[0,1]\to\mathbb C$ is, by definition: $$\int_{\gamma} f(z)\,dz = \int_{0}^{1} f(\gamma(t))\gamma'(t)\,dt.$$
For your incline, the line segment from $Re^{2\pi i/n}$ to $0$, you have  $\gamma(t)=Re^{2\pi i/n}(1-t)$ and then $\gamma'(t)=-Re^{2\pi i/n}$ so you get:
$$\int_{\gamma} f(z)\,dz = -Re^{2\pi i/n}\int_{0}^{1} f(\gamma(t))\,dt.$$
But, since $f\left(e^{2\pi i/n}z\right)=f(z)$ for our $f(z)=\frac{1}{1+z^n}$  we have $f(\gamma(t))=f(R(1-t))$ so:
$$\int_{\gamma} f(z)\,dz = -Re^{2\pi i/n}\int_{0}^{1} f(R(1-t))\,dt.$$
Letting $u=R(1-t)$ you get $du=-R\,dt$ and thus:
$$\int_{\gamma} f(z)\,dz = e^{2\pi i/n}\int_R^0 f(u)\,du=-e^{2\pi i/n}\int_0^R  f(u)\,du$$
