Here is yet another approach that uses Feynman's trick of differentiating under the integral sign.
We begin by enforcing a substitution of $x \mapsto x^{1/n}$. This gives
$$\int_0^\infty \tan^{-1} \left (\frac{1}{x^n} \right ) \, dx = \frac{1}{n} \int_0^\infty \frac{\tan^{-1} x}{x^{1 + \frac{1}{n}}} \, dx, \quad n > 1.$$
Now let
$$I(a) = \frac{1}{n} \int_0^\infty \frac{\tan^{-1} (ax)}{x^{1 + \frac{1}{n}}} \, dx, \quad a > 0.$$
Note that $I(0) = 0$ and we are required to find the value of $I(1)$.
Differentiating with respect to the parameter $a$ yields
$$I'(a) = \frac{1}{n} \int_0^\infty \frac{x^{-1/n}}{1 + a^2 x^2} \, dx,$$
or
$$I'(a) = \frac{a^{\frac{1}{n} - 1}}{2n} \int_0^\infty \frac{t^{-\frac{1}{2n}-\frac{1}{2}}}{1 + t} \, dt,$$
after a substitution of $x \mapsto \sqrt{t}/a$ has been enforced. The integral appearing above can be expressed in terms of Euler's Beta function $\text{B}(x,y)$. Here
\begin{align*}
I'(a) &= \frac{a^{\frac{1}{n} - 1}}{2n} \int_0^\infty \frac{t^{(\frac{1}{2} - \frac{1}{2n}) - 1}}{(1 + t)^{(\frac{1}{2}-\frac{1}{2n}) + (\frac{1}{2} + \frac{1}{2n})}} \, dt\\
&= \frac{a^{\frac{1}{n}-1}}{2n} \text{B} \left (\frac{1}{2} - \frac{1}{2n}, \frac{1}{2} + \frac{1}{2n} \right )\\
&= \frac{a^{\frac{1}{n} - 1}}{2n} \Gamma \left (\frac{1}{2} - \frac{1}{2n} \right ) \Gamma \left (\frac{1}{2} + \frac{1}{2n} \right )\\
&= \frac{a^{\frac{1}{n} - 1}}{2n} \Gamma \left [1 - \left (\frac{1}{2} + \frac{1}{2n} \right ) \right ] \Gamma \left (\frac{1}{2} + \frac{1}{2n} \right )\\
&= \frac{a^{\frac{1}{n} - 1}}{2n} \frac{\pi}{\sin \pi \left (\frac{1}{2} + \frac{1}{2n} \right )} \tag1\\
&= \frac{\pi}{2n} \sec \left (\frac{\pi}{2n} \right ) a^{\frac{1}{n} - 1},
\end{align*}
where in (1) Euler's reflection formula has been used.
So on integrating up with respect to the parameter $a$ we have
\begin{align*}
I(1) &= \int_0^1 I'(a) \, da = \frac{\pi}{2n} \sec \left (\frac{\pi}{2n} \right ) \int_0^1 a^{\frac{1}{n} - 1} \, da = \frac{\pi}{2} \sec \left (\frac{\pi}{2n} \right ) \Big{[} a^{\frac{1}{n}} \Big{]}_0^1
\end{align*}
giving
$$\int_0^\infty \tan^{-1} \left (\frac{1}{x^n} \right ) \, dx = \frac{\pi}{2} \sec \left (\frac{\pi}{2n} \right ),$$
as expected.
\displaystyle
in the title. For further info, you may consult Why no use displaystyle in titles on Math.Meta.SE. – GNUSupporter 8964民主女神 地下教會 Feb 22 '18 at 12:19