Solution to the second integral
Integrate by parts to get
$$\begin{align*}
I &= \int_0^\infty \frac{1}{1+x^2} \tan^{-1}\left(\frac{1+x^2}{x^4}\right) \, dx \\[1ex]
&= 2 \int_0^\infty \frac{x^5+2x^3}{x^8+x^4+2x^2+1} \tan^{-1}(x) \, dx \\[1ex]
&= \int_{-\infty}^\infty \frac{x^5+2x^3}{x^8+x^4+2x^2+1} \tan^{-1}(x) \, dx
\end{align*}$$
Now we integrate $f(z)=\frac{z^5+2z^3}{z^8+z^4+2z^2+1} \tan^{-1}(z)$ along a positively oriented, semicircular contour $C$ in the upper imaginary half-plane with radius $R>1$, and with an indentation surrounding the branch cut along $[i,i\infty)$ and encircling the branch point at $z=i$. On the principal branch, we have
$$\tan^{-1}(z) = -\frac i2 \log\left(\frac{i-z}{i+z}\right) = -\frac i2 \log\left|\frac{i-z}{i+z}\right| + \frac12 \arg\left(\frac{i-z}{i+z}\right)$$

It's easy to show the integrals along the circular arcs vanish as $R\to\infty$ and $\varepsilon\to0$ (the radius of the small circle). The integral along the real axis converges to $I$. This leaves us with the contribution of the integrals along the vertical line segments.
Parameterize the right and left paths, respectively, by
$$A : z = \varepsilon + it , t\in[R,1+\varepsilon] \\
B : z = -\varepsilon + it , t\in[1+\varepsilon,R]$$
As $\varepsilon\to0$, the integral along $A$ converges to
$$\begin{align*}
\lim_{\varepsilon\to0} \int_A f(z) \, dz &= -\int_1^\infty f(it) \, i \, dt \\[1ex]
&= -\int_1^\infty \frac{(it)^5+2(it)^3}{(it)^8+(it)^4+2(it)^2+1} \left(-\frac i2 \log\left|\frac{i-it}{i+it}\right| + \frac\pi2\right) \, i \, dt \\[1ex]
&= -\frac i2 \int_1^\infty \frac{t^5-2t^3}{t^8+t^4-2t^2+1} \log\left|\frac{1-t}{1+t}\right| \, dt + \frac\pi2 \int_1^\infty \frac{t^5-2t^3}{t^8+t^4-2t^2+1} \, dt
\end{align*}$$
while the integral along $B$ converges to
$$\begin{align*}
\lim_{\varepsilon\to0} \int_B f(z) \, dz &= \int_1^\infty f(it) \, i \, dt \\[1ex]
&= \int_1^\infty \frac{(it)^5+2(it)^3}{(it)^8+(it)^4+2(it)^2+1} \left(-\frac i2 \log\left|\frac{i-it}{i+it}\right| - \frac\pi2\right) \, i \, dt \\[1ex]
&= \frac i2 \int_1^\infty \frac{t^5-2t^3}{t^8+t^4-2t^2+1} \log\left|\frac{1-t}{1+t}\right| \, dt + \frac\pi2 \int_1^\infty \frac{t^5-2t^3}{t^8+t^4-2t^2+1} \, dt
\end{align*}$$
so that by the residue theorem,
$$2\pi i \sum_{\rm poles} \operatorname{Res} f(z) = I + \pi \int_1^\infty \frac{t^5 - 2t^3}{t^8 + t^4 - 2t^2 + 1} \, dt$$
The remaining integral vanishes:
$$\begin{align*}
J &= \int_1^\infty \frac{t^5 - 2t^3}{t^8 + t^4 - 2t^2 + 1} \, dt \\[1ex]
&= \frac12 \int_1^\infty \frac{t^2 - 2t}{t^4+t^2-2t+1} \, dt \tag{1} \\[1ex]
&= \frac12 \int_0^\infty \frac{t^2 - 1}{t^4+4t^3+7t^2+4t+1} \, dt \tag{2} \\[1ex]
&= \frac12 \int_0^1 \frac{t^2 - 1}{t^4+4t^3+7t^2+4t+1} \, dt + \frac12 \int_1^\infty \frac{t^2 - 1}{t^4+4t^3+7t^2+4t+1} \, dt \\[1ex]
&= \frac12 \int_0^1 \frac{t^2 - 1}{t^4+4t^3+7t^2+4t+1} \, dt + \frac12 \int_0^1 \frac{1 - t^2}{1+4t+7t^2+4t^3+t^4} \, dt \tag{3} \\[1ex]
&= 0
\end{align*}$$
- $(1)$ : $t\mapsto\sqrt t$
- $(2)$ : $t\mapsto t+1$
- $(3)$ : $t\mapsto \frac1t$ in the second integral
All that remains is to find the poles and compute the residues. Observe that
$$z^8 + z^4 + 2z^2 + 1 = (z^4 + iz^2 + i) (z^4 - iz^2 - i)$$
and the rest can be factorized with the quadratic theorem, so finding the poles is easy. The $4$ that fall within $C$ are
$$z = \sqrt{\pm \frac i2 \pm \frac{\sqrt{-1\pm4i}}2} \qquad \qquad \bigg((+,+,+)\text{ and }(-,-,-)\bigg)\\ z = -\sqrt{\pm \frac i2 \mp \frac{\sqrt{-1\pm4i}}2} \qquad\qquad \bigg((+,-,+)\text{ and }(-,+,-)\bigg)$$
Computing the residues is tedious, but ultimately we find that their sum simplifies to
$$\sum_{\rm poles} \operatorname{Res} f(z) = -\frac i4 \cot ^{-1}\left(\sqrt{\frac{1-\sqrt{2}+\sqrt{14-8 \sqrt{2}}}{2} }\right)$$
(I cheated with Mathematica to get this nice closed form)
Hence we conclude that
$$I = \boxed{\frac\pi2 \cot ^{-1}\left(\sqrt{\frac{1-\sqrt{2}+\sqrt{14-8 \sqrt{2}}}{2} }\right)}$$