Could anyone advise me on how to show$\begin{align} \int^{\infty}_{0}\end{align} \dfrac{1}{1+x^n}dx=\dfrac{\pi}{n\text{sin}\dfrac{\pi}{2}} ,\ $ for all integers $n \geq 2 \ ?$ Thank you.
Here is my attempt: Let $f:\mathbb{C} \to \mathbb{C}$ be defined by $f(z)=\dfrac{1}{1+z^n}.$
$z_k=e^{\dfrac{(2k+1)\pi i}{n}}, k=0,...,n-1,$ are all the roots of $z^n+1$ and they are simple poles of $f.$
For $R>1,$ let $\gamma_R(t)=Re^{it}, t\in[0,\frac{\pi}{2}].$ Then,$\ \gamma_{R} +[0,R]$ is a positively oriented closed contour whose interior contains $z_k,$ where $k \leq \dfrac{\frac{n}{2}-1}{2}=w.$
$\text{Res}_{z=z_k}f(z)=\text{lim}_{\ z \to z_k}(z-z_k)f(z)=\dfrac{1}{nz_k^{n-1}}.$
By Cauchy Residue theorem, $\begin{align}2\pi i\sum_{k \leq w}\text{Res}_{z=z_k}f(z)=\int^{R}_{0} \dfrac{1}{x^n+1}dx+ \int_{\gamma_{R}}f(z)dz\end{align}.$
But how do I evaluate $\begin{align}\sum_{k \leq w}\text{Res}_{z=z_k}f(z) \ ? \end{align} $