how to compute $\int_{0}^{\infty} \frac{dx}{x^{2017}+1}$ How do I simplify this following integral
$$\int_{0}^{\infty} \frac{dx}{x^{2017}+1}$$
I think the answer is
 $\frac{1}{2017}\pi \csc\left(\frac{\pi}{2017}\right)$
which is really close to one, what is the best method to solve this ?  I was trying compute it with residue integral but I noticed this integral does have a massive poles. Any ideas?
 A: To expand on my comment, the given integral is equal to $$\int_{0}^{\infty}\frac{dx}{x^{n}+1}=\frac{1}{n}\int_{0}^{\infty}\frac{t^{1/n-1}}{1+t}\,dt=\frac{B(1/n,1-1/n)}{n}=\frac{\Gamma(1/n)\Gamma(1-1/n)}{n\Gamma(1)}=\frac{\pi}{n\sin(\pi/n)}$$ In the above we have used the substitution $x^{n} =t$ and the properties of Gamma and Beta functions namely $$B(m, n) =\int_{0}^{\infty}\frac{x^{m-1}}{(1+x)^{m+n}}\,dx=\frac{\Gamma (m) \Gamma (n)} {\Gamma (m+n)}, \, \Gamma (x) \Gamma (1-x)=\frac{\pi}{\sin x\pi} $$
A: Integrating along the contour as mentioned in my comment, letting $r\to\infty$, rearranging, I obtained
$$(1-e^{2\pi i/2017})I=2\pi i \DeclareMathOperator{\Res}{Res}\Res (f,z_1)$$
in which $I$ is the integral in question and to calculate the residue, note that
$$\frac1{z^{2017}+1}=\frac1{z^{2017}-z_1^{2017}}=\frac1{z-z_1}(z^{2016}+z^{2015}z_1+\cdots+z_1^{2016})^{-1}$$
so $\Res(f,z_1)=1/2017\exp(i2016\pi/2017)$. So
$$I=\frac{2\pi i }{2017\exp(i2016\pi/2017)(1-e^{2\pi i/2017})}$$
WolframAlpha gives the numerical value as $1.00000040433$, which I believe matches your result.
Edit: actually the result can be simplified promptly as 
\begin{align}&\frac{2\pi i }{2017\exp(i2016\pi/2017)(1-e^{2\pi i/2017})}\\
=&\frac{2\pi i }{2017(-e^{-i\pi/2017})(1-e^{2\pi i/2017})}\\
=&\frac{2\pi i }{2017(2i\sin(\pi/2017))}\\
=&\frac\pi{2017}\csc(\pi/2017).\end{align}
This can also be immediately generalised if you replace $2017$ with any $n\ge 2$.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#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}$

Roots of $\ds{z^{2017} + 1 = 0}$ are given by $\ds{z_{n} = \exp\pars{{2n + 1 \over 2017}\,\pi\ic}}$ with $\ds{n = 0, 1, 2,\ldots,2016}$. I'll integrate along a pizza-slice contour, of radius $\ds{R > 1}$, in the first quadrant which has its center $\ds{\mbox{at}\ \pars{0,0}}$. The angle between the two straight segments of the contour is $\ds{2\pi/2017}$. At the end of the evaluation, I'll take the limit $\ds{R \to \infty}$.

The 'enclosed pole' is
$\ds{\underline{solely}}$ $\ds{z_{0} = \exp\pars{\pi\ic \over 2017}}$. Then,
\begin{align}
\int_{0}^{\infty}{\dd x \over x^{2017} + 1} & =
2\pi\ic\,{1 \over 2017\,z_{0}^{2016}}\ -\
\overbrace{\lim_{R \to \infty}\int_{0}^{2\pi/2017}{R\expo{\ic\theta}\ic\,\dd\theta \over R^{2017}\expo{2017\ic\theta} + 1}}
^{\ds{=\ 0}}\ -\
\int_{\infty}^{0}{\exp\pars{2\pi\ic/2017}\,\dd r \over r^{2017} + 1}
\end{align}

\begin{align}
&\bracks{1 - \exp\pars{{2\pi \over 2017}\,\ic}}\int_{0}^{\infty}
{\dd x \over x^{2017} + 1} =
-\,2\pi\ic\,{z_{0} \over 2017} =
-\,2\pi\ic\,{\exp\pars{\pi\ic/2017} \over 2017}
\end{align}

\begin{align}
\overbrace{\bracks{\exp\pars{-\,{\pi \over 2017}\,\ic} - \exp\pars{{\pi \over 2017}\,\ic}}}
^{\ds{-2\ic\sin\pars{\pi/2017}}}\
\int_{0}^{\infty}{\dd x \over x^{2017} + 1} = -\,{2\pi\ic \over 2017}
\end{align}

$$
\bbx{\int_{0}^{\infty}{\dd x \over x^{2017} + 1} =
{\pi \over 2017}\,\csc\pars{\pi \over 2017}} \approx 
1 + 0.4043 \times 10^{-6}
$$
