Prove that: $\frac{2\pi i}{(1 - e^{2i\pi/n})\prod_{k=0, k \neq 1}^{n-1} (e^{i\pi/n} - e^{i(2k-1)\pi/n})} = \frac{\pi/n}{\sin(\pi/n)}$ I am trying to find $\int_0^{\infty} \frac{dx}{1 + x^n}$ using contour integration. I did the computation by taking the contour $[0,R] \cup \gamma_R \cup [R e^{2i\pi/n}, 0]$, with $\gamma_R$ the arc joining $R$ to $Re^{2i\pi/n}$, and found that (for $n \ge 2$):
$$\int_0^{\infty} \frac{dx}{1 + x^n} = \frac{2\pi i}{(1 - e^{2i\pi/n})\prod_{k=0, k \neq 1}^{n-1} (e^{i\pi/n} - e^{i(2k-1)\pi/n})}$$
Apparently, this should be equal to:
$$\frac{\pi/n}{\sin(\pi/n)}$$
How to get that?
 A: $$\int_{[0,Re^{2i \pi /n}]} \frac{1}{1+z^n} dz = \int_0^R \frac{1}{1+(e^{2i \pi /n}x)^n} d(e^{2i \pi /n}x) = e^{2i \pi /n} \int_0^R \frac{1}{1+x^n} dx$$ the poles of $\frac{1}{1+z^n}$ are at $e^{i\pi (2k+1)/ n}, k = 0 \ldots n-1$. the only one inside the whole contour $\Gamma_R : [0,R] \cup [R, R e^{2 i \pi /n}] \cup [R e^{2 i \pi / n}, 0]$ is the one at $e^{i \pi /n }$. 
and $\displaystyle\frac{1}{1+z^n} = \frac{h(z)}{z-e^{i \pi / n}}$ with $ \displaystyle h(z) = \frac{-1}{\prod_{k=1}^{n-1} (z-e^{i \pi (2 k +1)/n})}$ so that $$Res(\frac{1}{1+z^n} , e^{i \pi /n}) = h(e^{i \pi / n}) =  \frac{-1}{\prod_{k=1}^{n-1} (e^{i\pi /n}-e^{i \pi (2 k +1)/n})}$$ 
hence $$\lim_{R \to \infty}\int_{\Gamma_R} \frac{1}{1+z^n}dz = 2 i \pi \frac{-1}{\prod_{k=1}^{n-1} (e^{i\pi /n}-e^{i \pi (2 k +1)/n})} = (1-e^{2i \pi /n}) \int_0^\infty \frac{1}{1+x^n} dx$$ and $$\int_0^\infty \frac{1}{1+x^n} dx = \frac{-2 i \pi }{(1-e^{2i \pi /n})\prod_{k=1}^{n-1} (e^{i\pi /n}-e^{i \pi (2 k +1)/n})}$$
note that another way to compute the residue $Res(\frac{1}{g(z)},a)$ when $g(z)$ has a simple zero at $a$ is $$Res(\frac{1}{g(z)},a) = \frac{1}{g'(a)}$$
hence with $g(z) = 1+z^n, g'(z) = n z^{n-1}$  $$Res(\frac{1}{1+z^n} , e^{i \pi /n}) = \frac{1}{g'(e^{i \pi /n})} = \frac{1}{n(e^{i \pi (n-1)/n})} = \frac{-e^{i \pi /n }}{n}$$
 so that 
$$\frac{-2 i \pi }{(1-e^{2i \pi /n})\prod_{k=1}^{n-1} (e^{i\pi /n}-e^{i \pi (2 k +1)/n})} = \frac{-2 i \pi e^{i \pi /n }}{n(1-e^{2i \pi /n})}$$
and your assertion follows (up to errors of sign, probably on my side)
A: If I have understood correctly, you want to see why the integral is also equal to $$\frac{\pi/n}{\sin\left(\pi/n\right)}
 $$ (if I am wrong tell me and I will delete the answer). A way to see it to observe that, taking $1+x^{n}=u^{-1}
 $ $$\int_{0}^{\infty}\frac{1}{1+x^{n}}dx=\frac{1}{n}\int_{0}^{1}u^{-1/n}\left(1-x\right)^{1/n-1}=\frac{1}{n}\frac{\Gamma\left(1-\frac{1}{n}\right)\Gamma\left(\frac{1}{n}\right)}{\Gamma\left(1\right)}=\frac{\pi/n}{\sin\left(\pi/n\right)}
 $$ for the reflection formula of the Gamma function. It is possible to generalize the result $$\int_{0}^{\infty}\frac{x^{b}}{1+x^{a}}dx=\frac{\pi/a}{\sin\left(\pi\left(b+1\right)/a\right)},\, a>0,b\geq0.$$
