How many methods are there to evaluate $\int_0^{\infty} \frac{1}{\left(x+\frac{1}{x}\right)^{2n}}$? Background
As I had found the integral
$$I=\int_0^{\infty} \frac{1}{\left(x+\frac{1}{x}\right)^2} d x =\frac{\pi}{4}, $$
by using $x\mapsto \frac{1}{x}$ yields
$\displaystyle I=\int_0^{\infty} \frac{\frac{1}{x^2}}{\left(\frac{1}{x}+x\right)^2} d x\tag*{} $
Averaging them gives the exact value of the integral
$\displaystyle \begin{aligned}I & =\frac{1}{2} \int_0^{\infty} \frac{1+\frac{1}{x^2}}{\left(x+\frac{1}{x}\right)^2} d x \\& =\frac{1}{2} \int_0^{\infty} \frac{d\left(x-\frac{1}{x}\right)}{\left(x-\frac{1}{x}\right)^2+4} d x \\& =\frac{1}{4}\left[\tan ^{-1}\left(\frac{x-\frac{1}{x}}{2}\right)\right]_0^{\infty} \\& =\frac{1}{4}\left[\frac{\pi}{2}-\left(-\frac{\pi}{2}\right)\right] \\& =\frac{\pi}{4}\end{aligned}\tag*{} $

I guess that we can similarly evaluate the general integral
$$
I_n=\int_0^{\infty} \frac{d x}{\left(x+\frac{1}{x}\right)^{2 n}}
$$
by mapping $x\mapsto \frac{1}{x}$ and then averaging.
$$
I_n=\frac{1}{2} \int_0^{\infty} \frac{1+\frac{1}{x^2}}{\left(x+\frac{1}{x}\right)^{2 n}} d x=\frac{1}{2} \int_0^{\infty} \frac{d\left(x-\frac{1}{x}\right)}{\left[\left(x-\frac{1}{x}\right)^2+4\right]^n}
$$
Letting $x-\frac{1}{x}=\tan \theta$ yields
$$
\begin{aligned}
I_n & =\frac{1}{2} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \frac{2 \sec ^2 \theta d \theta}{4^n \sec ^{2 n} \theta} =\frac{1}{4^n} \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \cos ^{2 n-2} \theta d \theta= \boxed{\frac{\pi(2 n-3) ! !}{4^n(2 n-2) ! !}}
\end{aligned}
$$
where the last answer comes from the Wallis cosine formula.
My question: How many methods are there to evaluate $\int_0^{\infty} \frac{1}{\left(x+\frac{1}{x}\right)^{2n}}$?
 A: In terms of the Gaussian hypergeometric function
$$\int \frac{dx}{\left(x+\frac{1}{x}\right)^{2n}}=\frac{x^{1-2 n}}{2 n+1}\, _2F_1\left(2 n,\frac{2n+1}{2};\frac{2n+3}{2};-x^2\right)$$ which can also write
$$\int \frac{dx}{\left(x+\frac{1}{x}\right)^{2n}}=(-1)^{n+1}\frac{i}{2}  B_{-x^2}\left(n+\frac{1}{2},1-2 n\right)$$
$$\int_0^{\infty} \frac{dx}{\left(x+\frac{1}{x}\right)^{2n}}=\sqrt{\pi }\,\,\frac{ \Gamma
   \left(n-\frac{1}{2}\right)}{ 4^{n}\,\Gamma (n)}$$
A: Letting $x=\tan \theta$ transforms the integral
$$
\begin{aligned}
I_n & = \int_0^{\infty} \frac{x^{2 n}}{\left(1+x^2\right)^{2 n}} d x \\&=\int_0^{\frac{\pi}{2}} \frac{\tan ^{2 n} \theta}{\sec ^{4 n} \theta} \sec ^2 \theta d \theta \\
& =\int_0^{\frac{\pi}{2}} \sin ^{2 n} \theta \cos ^{2n-2} \theta d \theta \\
& =\frac{1}{2} B\left(n+\frac{1}{2}, n-\frac{1}{2}\right) 
\end{aligned}
$$
In particular,
$$
I_2=\frac{1}{2} B\left(\frac{5}{2}, \frac{3}{2}\right)=\frac{1}{2} \cdot \frac{\pi}{16}=\frac{\pi}{32}
$$
A: Writing the integral on the form
$$
I_n = \int_0^{\infty} \frac{x^{2n}}{(x^2+1)^{2n}}dx
$$
can be seen as a Mellin transform of $f(x)=(1+x)^{-\rho}$. The Mellin transform is given by
$$
\mathcal{M}[f(x);s]=\frac{1}{\Gamma(\rho)}\Gamma[s,\rho-s]$$
Which then gives that
$$
 \mathcal{M}[f(x^2);s]=\frac{1}{2\Gamma(\rho)}\Gamma[s/2,\rho-s/2]
$$
With $\rho=2n$, $s=2n+1$, this gives
$$
I_n = \frac{1}{2\Gamma(2n)}\Gamma[n+1/2,n-1/2] = \frac{1}{2}B(n+1/2,n-1/2)
$$
A: $$
\begin{align}
\int_{0}^{\infty}\frac{1}{\left(x+\frac{1}{x}\right)^{2n}}dx &= \int_{0}^{\infty}\frac{x^{2n}}{\left(1+x^{2}\right)^{2n}}dx \\
&= \frac{1}{2}\int_{-\infty}^{\infty}\frac{x^{2n}}{\left(1+x^{2}\right)^{2n}}dx \\
&= \frac{1}{2}\int_{-\infty}^{\infty}\frac{x^{2n}}{\left(x-i\right)^{2n}\left(x+i\right)^{2n}}dx \\
&= \frac{1}{2}\cdot2\pi i\operatorname{Res}\left(\frac{z^{2n}}{\left(z-i\right)^{2n}\left(z+i\right)^{2n}},\ z=i\right) \tag{1}\\
&= \frac{\pi i}{\left(2n-1\right)!} \lim_{z\to i}\frac{d^{2n-1}}{dz^{2n-1}}\frac{\left(z-i\right)^{2n}z^{2n}}{\left(z-i\right)^{2n}\left(z+i\right)^{2n}} \\
&= \frac{\pi i}{\left(2n-1\right)!} \lim_{z\to i}\frac{d^{2n-1}}{dz^{2n-1}}\left(1-\frac{i}{z+i}\right)^{2n} \\
&= \frac{\pi i}{\left(2n-1\right)!}\lim_{z\to i}\frac{d^{2n-1}}{dz^{2n-1}}\sum_{j=0}^{2n} \binom{2n}{j}\left(-1\right)^{j}\frac{i^{j}}{\left(z+i\right)^{j}} \\
&= \frac{\pi i}{\left(2n-1\right)!}\lim_{z\to i}\sum_{j=1}^{2n}\binom{2n}{j}\left(-1\right)^{j}\frac{d^{2n-1}}{dz^{2n-1}}\frac{i^{j}}{\left(z+i\right)^{j}} \\
&= \frac{\pi i}{\left(2n-1\right)!}\lim_{z\to i}\left(-1\right)^{2n-1}\sum_{j=1}^{2n}\binom{2n}{j}\left(-1\right)^{j}\frac{\left(j+2n-2\right)!}{\left(j-1\right)!\left(z+i\right)^{j+2n-1}} \\
&= \frac{\pi i}{\left(2n-1\right)!}\left(-1\right)^{2n-1}\sum_{j=1}^{2n}\binom{2n}{j}\left(-i\right)^{j}\frac{\left(j+2n-2\right)!}{\left(j-1\right)!\left(2i\right)^{j+2n-1}} \\
&= \frac{\sqrt{\pi}Γ\left(n-\frac{1}{2}\right)}{4^{n}Γ\left(n\right)} \tag{2}\\
\end{align}
$$
For $(1)$ we define a contour $C := [-R,R] \cup \Gamma$ (such that $\Gamma$ is a semicircle of radius $R$) and $(2)$ do a lot of algebra and simplifying.
