Prove $\int_0^{\infty}\! \frac{\mathbb{d}x}{1+x^n}=\frac{\pi}{n \sin\frac{\pi}{n}}$ using real analysis techniques only
I have found a proof using complex analysis techniques (contour integral, residue theorem, etc.) that shows $$\int_0^{\infty}\! \frac{\mathbb{d}x}{1+x^n}=\frac{\pi}{n \sin\frac{\pi}{n}}$$ for $n\in \mathbb{N}^+\setminus\{1\}$
I wonder if it is possible by using only real analysis to demonstrate this "innocent" result?
Edit A more general result showing that $$\int\limits_{0}^{\infty} \frac{x^{a-1}}{1+x^{b}} \ \text{dx} = \frac{\pi}{b \sin(\pi{a}/b)}, \qquad 0 < a <b$$ can be found in another math.SE post
Solution 1:
$$ \int_{0}^{\infty}\frac{1}{1+x^n}\ dx =\int_{0}^{\infty}\int_{0}^{\infty}e^{-(1+x^{n})t}\ dt\ dx $$
$$ =\int_{0}^{\infty}\int_{0}^{\infty}e^{-t}e^{-tx^{n}}\ dx\ dt =\frac{1}{n}\int_{0}^{\infty}\int_{0}^{\infty}e^{-t}e^{-u}\Big(\frac{u}{t}\Big)^{\frac{1}{n}-1}\frac{1}{t}\ du\ dt $$
$$ =\frac{1}{n}\int_{0}^{\infty}t^{-\frac{1}{n}}e^{-t}\int_{0}^{\infty}u^{\frac{1}{n}-1}e^{-u}\ du\ dt =\frac{1}{n}\int_{0}^{\infty}t^{-\frac{1}{n}}e^{-t}\ \Gamma\Big(\frac{1}{n}\Big)\ dt $$
$$ =\frac{1}{n}\ \Gamma\Big( 1-\frac{1}{n}\Big)\Gamma\Big(\frac{1}{n}\Big) =\frac{\pi}{n}\csc\Big(\frac{\pi}{n}\Big) $$
Solution 2:
Here is another method. Let $\varphi: x\mapsto \displaystyle\int_0^{+\infty}\dfrac{dt}{1+t^x}$ and $\psi:x\mapsto\dfrac{\dfrac {\pi}{x}}{\sin\left(\dfrac{\pi}{x}\right)}$
You can easily prove that $\varphi$ and $\psi$ are both defined and continuous on $\mathscr I=\mathbb ]1,+\infty[$.
Let $\mathscr{A}=\left\{\dfrac pq : p\in2\mathbb Z, q\in2\mathbb Z+1 \right\}$ and $\mathscr A^*_+=\mathscr A \cap \mathscr I$. Then $\mathscr A^*_+$ is a dense subset of $\mathscr I$.
Now let $p$ be an even integer and $q$ an odd one such that $p>q>0$. We have :
$$\varphi\left(\frac{p}{q}\right)=\int_0^{+\infty}\frac{dt}{1+t^\frac{p}{q}}=\int_0^{+\infty}\frac{qu^{q-1}}{1+u^p}du= \frac{q}{2}\int_{-\infty}^{+\infty}\frac{u^{q-1}}{1+u^p}du=\frac{q}{2}\lim_{t\rightarrow+\infty}\int_{-t}^t\frac{u^{q-1}}{1+u^p}du$$
We can write : $\displaystyle{\frac{u^{q-1}}{1+u^p}=\sum_{k=0}^{p-1}\frac{a_k}{u-b_k}}$ with $\displaystyle{b_k=e^{i\frac{(2k+1)\pi}{p}}}$ and $\displaystyle{a_k=\frac{-b_k^q}{p}=-\frac{e^{i\frac{(2k+1)\pi q}{p}}}{p}}$
Now let $x$ be a real number such that $\sin(x)\neq 0$.
We can then write : $\displaystyle{\frac{1}{u-e^{ix}}=\frac{u-\cos(x)+i\sin(x)}{u²-2u\cos(x)+1}}$
Now if $t>0$ we get : $\displaystyle{\int_{-t}^t\frac{u-\cos(x)}{u²-2u\cos(x)+1}du=\frac{1}{2}\ln\left(\frac{t²-2t\cos(x)+1}{t²+2t\cos(x)+1}\right)}$ and this integral tends to $0$ as $t$ tends to $+\infty$.
We have as well : $\displaystyle{\int_{-t}^t\frac{\sin(x)}{u²-2u\cos(x)+1}du=\arctan\left(\frac{t-\cos(x)}{\sin(x)}\right)+\arctan\left(\frac{t+\cos(x)}{\sin(x)}\right)}$ and this integral tends to $\pi$ if $\sin(x)>0$ and $-\pi$ if $\sin(x)<0$ (when $t$ tends to $+\infty$).
So we get : $$\lim_{t\to +\infty} \int_{-t}^t \dfrac{du}{u-e^{ix}}=\left\{\begin{array}{lr} i\pi & \text{if}\ \sin(x)>0\\ -i\pi & \text{if}\ \sin(x)<0\end{array}\right.$$
Now let's go back to our little integral :
$$\dfrac q2 \lim_{t\to +\infty}\int_{-t}^t \dfrac{u^{q-1}}{1+u^p} du=i\pi\dfrac q2\left(\sum_{k=0}^{\frac p2-1}a_k-\sum_{k=\frac p2}^{p-1} a_k\right)=-q\pi\mathrm{Im}\left(\sum_{k=0}^{\frac p2-1} a_k\right) \ (\text{because}\ a_k=\overline{a_{p-1-k}})$$
But this last sum is just a simple geometric sum :
$$\sum_{k=0}^{\frac p2-1} a_k=-\dfrac 1p e^{i\pi\frac qp}\frac{1-e^{i\pi q}}{1-e^{2i\pi\frac qp}}=-\frac{i}{p\sin\left(\pi\frac qp\right)}$$
And finally we get :
$$\varphi\left(\frac pq\right)=-q\pi\left(-\frac1{p\sin\left(\pi\frac qp\right)}\right)=\frac{\dfrac{\pi}{\frac pq}}{\sin\left(\dfrac{\pi}{\frac pq}\right)}=\psi\left(\frac pq\right)$$
$\varphi$ and $\psi$ are both continuous and they agree on the dense subset $\mathscr A^*_+$ of $\mathscr I$. Hence they're equal.
Solution 3:
We can use the geometric series $\frac{1}{1-x}=\sum_{k=0}^\infty x^n$ for $|x|<1$ to evaluate: \begin{eqnarray} \int_0^\infty\frac{1}{1+x^n}dx&=&\int_0^1\frac{1+x^{n-2}}{1+x^n}dx\\ &=&\sum_{k=0}^\infty(-1)^k\int_0^1(1+x^{n-2})x^{nk}dx\\ &=&\sum_{k=0}^\infty(-1)^k\left(\frac{1}{nk+1}+\frac{1}{nk+n-1}\right)\\ &=&\sum_{k=-\infty}^\infty(-1)^k\frac{1}{nk+1}\\ &=&\frac{\pi}{n\sin\frac{\pi}{n}}. \end{eqnarray}