How do I compute the integral
$$\int_0^{\infty} \frac{1}{1+x^n}dx$$
where $n \geq 2$ is an integer? Is there a way to do this with the residue theorem?
How do I compute the integral
$$\int_0^{\infty} \frac{1}{1+x^n}dx$$
where $n \geq 2$ is an integer? Is there a way to do this with the residue theorem?
If we let $\omega$ denote the primitive $n$th root of unity $e^{2 \pi i /n}$, and $\nu$ the primitive $2n$th root of unity $e^{\pi i /n}$, then the solutions to $1+x^n = 0$ are
$$\nu, \omega \nu, \omega^2\nu, ... , \omega^{n-1}\nu. \tag{$\nu \omega^j = e^{\frac{(2 j +1) \pi i}{n}}$}$$
For large $R > 0$ which we will eventually take to infinity, we will integrate $\frac{1}{1+z^n}$ over the "pie slice" going from $0$ to $R$, then from $R$ to $Re^{2\pi i /n}$, and then from $Re^{2\pi i /n}$ back to $0$. The only singularity of $\frac{1}{1+z^n}$ inside this slice is at $\nu$, and using L'Hospital's rule (suggested by my high school student), we have
$$\operatorname{Res}_{z = \nu} \frac{1}{1+z^n} = \lim\limits_{z \to \nu} \frac{z-\nu}{1+z^n} = \lim\limits_{z \to \nu} \frac{1}{nz^{n-1}} = \frac{1}{n e^{(n-1)\pi i /n}} = - \frac{\nu}{n}.$$
Now if we let $\gamma$ be the path from $0$ to $R e^{2\pi i /n}$, and $\delta$ the circular arc path from $R$ to $Re^{2\pi i /n}$, the residue theorem tells us that
$$\int_0^R \frac{1}{1+x^n}dx - \int_{\gamma} \frac{1}{1+z^n} dz + \int\limits_{\delta} \frac{1}{1+z^n} dz = - \frac{2\pi i \nu}{n}. \tag{$\ast$}$$
Let's look at the path $\delta$ first. If we let $z$ be a point along this path, then $z^n$ has radius $R^n$, and hence $1+z^n$ has radius no less than $R^n-1$. The length of this path being $\frac{2 \pi R}{n}$, we can conclude that
$$| \int\limits_{\delta}\frac{1}{1+z^n} dz| \leq \frac{2 \pi R}{n(R^n-1)} \to 0 \textrm{ as $R \to \infty$}.$$
As for the path $\gamma$ from $0$ to $Re^{2 \pi i/n}$, we can parameterize this by setting
$$\gamma(t) = te^{2\pi i /n} = t \omega \tag{$0 \leq t \leq R$}$$
so that
$$\int\limits_{\gamma} \frac{1}{1+z^n} dz = \int_0^R \frac{1}{1 + (t \omega)^n} \omega dt = \omega \int_0^R \frac{1}{1+t^n} dt.$$
Taking $R \to \infty$ in equation ($\ast$), we see that
$$\int_0^{\infty} \frac{1}{1+x^n}dx - \omega \int_0^{\infty} \frac{1}{1+x^n}dx = -\frac{2 \pi i \nu}{n}$$
or
$$\int_0^{\infty} \frac{1}{1+x^n}dx = \frac{-2 \pi i \nu}{n(1-\omega)} = \frac{- 2\pi i e^{ \pi i/n}}{n(1-e^{2\pi i /n})} = \frac{-2 \pi i}{n(e^{- \pi i /n}- e^{\pi i /n})} = \boxed{\frac{\pi }{n\sin( \pi /n)}}$$
where we have used the identity $\frac{e^{iz} - e^{-iz}}{2i} = \sin z$.