Show that $\int_0^ \infty \frac{1}{1+x^n} dx= \frac{ \pi /n}{\sin(\pi /n)}$ , where $n$ is a positive integer.
The integral of $$ \int_\gamma\frac1{1+z^n}\mathrm{d}z\tag{1} $$ on the outgoing ray on the real axis tends to $$ \int_0^\infty\frac1{1+x^n}\mathrm{d}x\tag{2} $$ On the incoming ray parallel to $e^{2\pi i/n}$, the integral tends to $$ -e^{2\pi i/n}\int_0^\infty\frac1{1+x^n}\mathrm{d}x\tag{3} $$ For $n\ge2$, the integral on the circular arc vanishes. Therefore, $$ \int_\gamma\frac1{1+z^n}\mathrm{d}z =\left(1-e^{2\pi i/n}\right)\int_0^\infty\frac1{1+x^n}\mathrm{d}x\tag{4} $$ There is one singularity contained in $\gamma$ at $z_0=e^{\pi i/n}$. The residue of $\frac1{1+x^n}$ at $z_0$ is $\frac1{nz_0^{n-1}}=-\frac{z_0}{n}$. Thus, $$ 2\pi i\left(-\frac{e^{\pi i/n}}{n}\right) =\left(1-e^{2\pi i/n}\right)\int_0^\infty\frac1{1+x^n}\mathrm{d}x\tag{5} $$ which resolves by division to $$ \int_0^\infty\frac1{1+x^n}\mathrm{d}x=\frac{\pi/n}{\sin(\pi/n)}\tag{6} $$ For $n=1$, the integral diverges and $\frac{\pi}{\sin(\pi)}=\frac\pi0$.