A different way to calculate $\int_0^\infty \tfrac{1}{1+x^n} dx$. Most of you might have stumbled upon this integral, when studying complex analysis, namely via contour integration, but today I asked myself if there is a different way to calculate it. I'm almost sure that I'm not the first one to come up with this technique, but I wanted to share it with you and would like to know if anyone of you knows another approach.
EDIT
I made a mistake regarding the format of this post, so I posted my own approach as an answer now.
 A: Use $x=\tan^{2/n}t$ to write the integral as $$\int_0^{\pi/2}\tfrac2n\tan^{2/n-1}tdt=\tfrac1n\operatorname{B}(\tfrac1n,\,1-\tfrac1n)=\tfrac1n\Gamma(\tfrac1n)\Gamma(1-\tfrac1n)=\tfrac{1}{\operatorname{sinc}\tfrac{\pi}{n}}.$$
You can show $\int_0^1(1-y^k)^{-1/k}dy$ has the same value with $y=\sin^{2/k}t$.
A: Here are two approaches.

Beta Function and Euler's Reflection Formula
$$
\begin{align}
\int_0^\infty\frac{\mathrm{d}x}{1+x^n}
&=\frac1n\int_0^\infty\frac{x^{\frac1n-1}}{1+x}\,\mathrm{d}x\tag{1a}\\
&=\frac1n\,\Gamma\!\left(\frac1n\right)\Gamma\!\left(1-\frac1n\right)\tag{1b}\\[3pt]
&=\frac\pi n\csc\left(\frac\pi n\right)\tag{1c}
\end{align}
$$
Explanation:
$\text{(1a)}$: substitute $x\mapsto x^{1/n}$
$\text{(1b)}$: Beta Integral
$\text{(1c)}$: Euler's Reflection Formula

Applying Elementary (Completely Real) Tools
$$
\begin{align}
\int_0^\infty\frac{\mathrm{d}x}{1+x^n}
&=\frac1n\int_0^\infty\frac{x^{\frac1n-1}}{1+x}\,\mathrm{d}x\tag{2a}\\
&=\frac1n\int_0^1\frac{x^{\frac1n-1}}{1+x}\,\mathrm{d}x+\frac1n\int_0^1\frac{x^{-\frac1n}}{1+x}\,\mathrm{d}x\tag{2b}\\
&=\frac1n\int_0^1\sum_{k=0}^\infty(-1)^kx^{k+\frac1n-1}\,\mathrm{d}x+\frac1n\int_0^1\sum_{k=0}^\infty(-1)^kx^{k-\frac1n}\,\mathrm{d}x\tag{2c}\\
&=\frac1n\sum_{k=0}^\infty\frac{(-1)^k}{k+\frac1n}+\frac1n\sum_{k=0}^\infty\frac{(-1)^k}{k-\frac1n+1}\tag{2d}\\
&=\frac1n\sum_{k\in\mathbb{Z}}\frac{(-1)^k}{k+\frac1n}\tag{2e}\\[3pt]
&=\frac\pi{n}\csc\left(\frac\pi{n}\right)\tag{2f}
\end{align}
$$
Explanation:
$\text{(2a)}$: substitute $x\mapsto x^{1/n}$
$\text{(2b)}$: break the domain of integration into $[0,1]$ and $[1,\infty)$
$\phantom{\text{(2b):}}$ substitute $x\mapsto1/x$ on $[1,\infty)$
$\text{(2c)}$: Taylor series for $\frac1{1+x}$
$\text{(2d)}$: integrate
$\text{(2e)}$: substitute $k\mapsto-k-1$ in the right-hand sum
$\text{(2f)}$: apply $(8)$ from this answer
A: Note that you can express the integral as a double integral, in fact since
$$\int_{0}^{+\infty} e^{-ay}\text{d}y=\frac{1}{a} $$
you have:
$$I:=\int_{0}^{+\infty}\frac{\text{d}x}{1+x^n}=\int_{0}^{+\infty}\int_0^{+\infty} e^{-y(1+x^n)}\text{d}x\text{d}y $$
Now letting $u=yx^n$ and $\text{d}u=nx^{n-1}y\,\text{d}x$ you obtain:
$$\int_{0}^{+\infty}\int_0^{+\infty} e^{-y(1+x^n)}\text{d}x\text{d}y=\frac{1}{n}\int_{0}^{+\infty}e^{-y}y^{-1/n}\text{d}y  \int_0^{+\infty} u^{1/n-1}e^{-u}\text{d}u $$
The first integral is $\Gamma(1-1/n)$ and the second one is $\Gamma(1/n)$, hence you can conclude using the reflection formula:
$$I=\Gamma\left(1-\frac{1}{n}\right)\Gamma\left(\frac{1}{n}\right)= \frac{\pi}{n}\csc \left(\frac{\pi}{n}\right) $$
A: Here is my own answer. Of course, we asumme $n\ge 2$ and I also assume, that you have some knowledge on the Gamma function and its friends. I started by
$$\int_0^\infty \frac{1}{1+x^n}dx =\int_0^\infty \frac{1}{nx^{n-1}}\frac{nx^{n-1}}{1+x^n}dx=\left[\frac{1}{n}x^{-(n-1)}\ln(1+x^n) \right]_0^\infty +\frac{n-1}{n}\int_0^\infty \frac{\ln(1+x^n)}{x^n}dx$$
by integration by parts. One readily checks with L'Hospitals rule that the first term is equal to zero. Now since
$$\left.\frac{d}{dt}(1+x^n)^t\right|_{t=0}=\left.\left((1+x^n)^t \ln(1+x^n)\right)\right|_{t=0}=\ln(1+x^n) $$
by the Leibniz integration rule, we obtain
$$ \int_0^\infty \frac{1}{1+x^n}=\frac{n-1}{n}\frac{d}{dt}\left.\left(\int_0^\infty \frac{(1+x^n)^t}{x^n}dx \right)\right|_{t=0}.
$$
Using the substitution $u=1+x^n$, $(u-1)^{\tfrac{n-1}{n}}=x^{n-1}$ and $dx=\tfrac{1}{n}(u-1)^{-\tfrac{n-1}{n}}du$, we have
$$\int_0^\infty \frac{(1+x^n)^t}{x^n}dx=\frac{1}{n}\int_1^\infty u^t(u-1)^{\tfrac{1-2n}{n}}du.
$$
Substituting $u=\tfrac{1}{v}$, $du=-\tfrac{1}{v^2}dv$ it follows that
$$\int_0^\infty \frac{(1+x^n)^t}{x^n}dx=\frac{1}{n}\int_0^1 v^{-t-2-\tfrac{1-2n}{n}}(1-v)^{\tfrac{1-2n}{n}}dv=\frac{1}{n}B(-t+\tfrac{n-1}{n},-\tfrac{n-1}{n})=\frac{1}{n}\frac{\Gamma(-t+\tfrac{n-1}{n})\Gamma(-\tfrac{n-1}{n})}{\Gamma(-t)},
$$
where $B$ is the Beta function and the well-known connection to the Gamma function was used. Now we "only" have to evaluate the derivate at $t=0$. We have
$$\frac{d}{dt}\left(\frac{\Gamma(-t+\tfrac{n-1}{n})}{\Gamma(-t)}\right)=\frac{\Gamma(-t+\tfrac{n-1}{n})}{\Gamma(-t)}(\psi(-t)-\psi(-t+\tfrac{n-1}{n})),
$$
where $\psi$ is the logarithmic derivative of $\Gamma$ - the digamma function. Since the Gamma function has simple poles at the negative integers including zero, we can't just plug in $t=0$. Now WolframAlpha suggests that the evaluation is in fact $-\Gamma(\tfrac{n-1}{n})$. Does anyone know a simple way to show this? Anyway continuing, we have
$$\int_0^\infty \frac{1}{1+x^n}=\frac{n-1}{n^2}\Gamma(-\tfrac{n-1}{n})(-\Gamma(\tfrac{n-1}{n}))=\frac{1}{n}\Gamma(\tfrac{1}{n})\Gamma(1-\tfrac{1}{n})
$$
and finally by Euler's reflection formula we have
$$\int_0^\infty \frac{1}{1+x^n}dx=\frac{\pi/n}{\sin(\pi/n)}.
$$
