Prove $\int_{0}^{\frac{\pi}{2}} \sqrt[n]{\tan x} dx = \frac{\pi}{2} \sec (\frac{\pi}{2n})$ without complex techniques Prove
$$\int_{0}^{\frac{\pi}{2}} \sqrt[n]{\tan x} \,dx = \frac{\pi}{2} \sec \left(\frac{\pi}{2n}\right)$$
for all natural numbers $n \ge 2$.
There are several answers (A1 A2) to this integral but they all involve the gamma function or the beta function or contour integration  etc. Can one solve this using only 'real' 'elementary' techniques? For $n = 2$ and $n = 3$ it can be solved using only elementary substitutions and partial fractions.
 A: $$
\begin{align}
\int_0^{\frac\pi2}\sqrt[n]{\tan(x)}\,\mathrm{d}x\
&=\int_0^\infty\frac{u^{1/n}\,\mathrm{d}u}{1+u^2}\tag{1a}\\
&=\frac12\int_0^\infty\frac{v^{\frac{1-n}{2n}}}{1+v}\,\mathrm{d}v\tag{1b}\\
&=\frac\pi2\csc\left(\pi\frac{n+1}{2n}\right)\tag{1c}\\[6pt]
&=\frac\pi2\sec\left(\frac\pi{2n}\right)\tag{1d}
\end{align}
$$
Explanation:
$\text{(1a)}$: set $x=\tan^{-1}(u)$
$\text{(1b)}$: set $u=v^{1/2}$
$\text{(1c)}$: apply $(2)$ below
$\text{(1d)}$: $\csc(\pi/2+x)=\sec(x)$
Here is the argument from $(3)$ of this answer with more explanation:
$$
\begin{align}
\int_0^\infty\frac{x^{\alpha-1}}{1+x}\,\mathrm{d}x
&=\int_0^1\frac{x^{-\alpha}+x^{\alpha-1}}{1+x}\,\mathrm{d}x\tag{2a}\\
&=\sum_{k=0}^\infty(-1)^k\int_0^1\left(x^{k-\alpha}+x^{k+\alpha-1}\right)\mathrm{d}x\tag{2b}\\
&=\sum_{k=0}^\infty(-1)^k\left(\frac1{k-\alpha+1}+\frac1{k+\alpha}\right)\tag{2c}\\
&=\sum_{k\in\mathbb{Z}}\frac{(-1)^k}{k+\alpha}\tag{2d}\\[6pt]
&=\pi\csc(\pi\alpha)\tag{2e}
\end{align}
$$
Explanation:
$\text{(2a)}$: break the integral into two parts: $[0,1]$ and $(1,\infty)$
$\phantom{\text{(2a):}}$ substitute $x\mapsto1/x$ in the second part
$\text{(2b)}$: apply the series for $\frac1{1+x}$
$\text{(2c)}$: evaluate the integrals
$\text{(2d)}$: write as a principal value sum
$\text{(2e)}$: apply $(8)$ from this answer
A: Here is to integrate with partial fractions. Utilize the factorization
$ 1+y^{2n} = \prod^n_{k=1} (y^2-2y\cos a_k +1 )$, with $a_k=\frac{(2k-1)\pi}{2n}$
\begin{align}
&\int_{0}^{\frac{\pi}{2}} \sqrt[n]{\tan x} \,dx \\
=&\ \frac12 \int_{0}^{\frac{\pi}{2}} \sqrt[n]{\tan x}+\sqrt[n]{\cot x} \ {dx }
\overset{y^n=\tan x} = \frac 12\int_0^\infty\frac{n(y^n+y^{n-2})}{1+y^{2n}}dy\\
= &\ \frac12 \int_0^\infty \sum_{k=1}^n \frac{(-1)^{k+1}\sin 2a_k}{y^2-2y\cos a_k +1 }dy
=- \sum_{k=1}^n (-1)^{n-k}a_k\cos a_k\\
=&-\frac{d}{dt}\bigg(\sum_{k=1}^n (-1)^{n-k}\sin a_k t\bigg)_{t=1}= - \frac{d}{dt}\bigg(\frac{\sin \pi t}{2\cos\frac{\pi t}{2n}}\bigg)_{t=1}
= \frac\pi2 \sec\frac\pi{2n}
\end{align}
A: \begin{aligned}
\int_{0}^{\frac{\pi}{2}} \sqrt[n]{\tan x} d x&=\int_{0}^{\frac{\pi}{2}} \sin ^{\frac{1}{n}} x \cos ^{-\frac{1}{n}} x d x\\
&= \int_{0}^{\frac{\pi}{2}} \sin ^{2\left(\frac{1}{2 n}+\frac{1}{2}\right)-1} x \cos^ {2\left(-\frac{1}{2n}+\frac{1}{2}\right)-1 }x d x\\
&=\frac{1}{2} B\left(\frac{1}{2 n}+\frac{1}{2},-\frac{1}{2 n}+\frac{1}{2}\right)\\
&=\frac{1}{2} \pi \csc \left[\pi\left(\frac{1}{2 n}+\frac{1}{2}\right)\right]\\
&=\frac{\pi}{2} \sec \frac{\pi}{2 n}
\end{aligned}
where the second last line using the property of Beta function:
$$B(x, 1-x)=\pi \csc (\pi x) \quad x \notin \mathbb{Z}.$$
