Seeking Methods to solve $\int_{0}^{\frac{\pi}{2}} \ln\left|\sec^2(x) + \tan^4(x) \right|\:dx $

$$I = \int_{0}^{\frac{\pi}{2}} \ln\left(\sec^2(x) + \tan^4(x) \right)dx=\int_0^\infty \frac{\ln(1+x^2+x^4)}{1+x^2}dx$$Consider: $$I(a)=\int_0^\infty \frac{\ln((1+x^2)a+x^4)}{1+x^2}dx$$ Derivating under the integral sign with respect to $a$ gives: $$I'(a)=\int_0^\infty \frac{1+x^2}{(1+x^2)a+x^4}\frac{dx}{1+x^2}=\int_0^\infty \frac{1}{x^4+ax^2+a}dx\overset{\large{x=\frac{\sqrt a}{t}}}=\int_0^\infty \frac{\frac{t^2}{\sqrt a}}{t^4+at^2+a}dt$$ $$2I'(a)=\int_0^\infty \frac{\frac{t^2}{\sqrt a}+1}{t^4+at^2+a}dt\Rightarrow I'(a)=\frac{1}{2\sqrt a}\int_0^\infty \frac{t^2+\sqrt a}{t^4+at^2+a}dt$$ $$=\frac{1}{2\sqrt a}\int_0^\infty \frac{1+\frac{\sqrt a}{t^2}}{\left(t-\frac{\sqrt a}{t}\right)^2+a+2\sqrt a}dt=\frac{1}{2\sqrt a}\int_0^\infty \frac{d\left(t-\frac{\sqrt a}{t}\right)}{\left(t-\frac{\sqrt a}{t}\right)^2+\left(\sqrt{a+2\sqrt a}\,\right)^2}$$ $$=\frac{1}{2\sqrt a}\frac{1}{\sqrt{a+2\sqrt a}}\arctan\left(\frac{t-\frac{\sqrt a}{t}}{\sqrt{a+2\sqrt a}}\right)\bigg|_0^\infty \Rightarrow I'(a)=\frac{\pi}{2\sqrt a}\frac{1}{\sqrt{a+2\sqrt a}}$$ And noticing that $I(0)=4\int_0^\infty \frac{\ln x}{1+x^2} dx=0$. By the fundamental theorem of Calculus we have: $$I=I(1)-I(0)=\int_0^1 I'(a)da=\frac{\pi}{2}\int_0^1 \frac{1}{\sqrt a \sqrt {a+2\sqrt a}}da$$ Finally setting $\sqrt a =x$ gives: $$I=\pi \int_0^1 \frac{1}{\sqrt{(x+1)^2-1}}dx=\pi\ln(2+\sqrt 3)$$


We use the representation

$$ I=\int_0^{\infty}\frac{\log(g(x))}{1+x^2}dx $$

derived by OP.

Here $g(z)=1+z^2+z^4$. Note that $\log(g(z))$ has four branch points at $z_n=e^{i n \pi/3}$, $n={1,2,4,5}$ of which $z_{1,2}$ lie in the upper half of the complex plane. Let us define

$$ f(z)=\frac{\log(g(z))}{1+z^2} $$ By parity we have also that $2\int_0^{\infty}\frac{\log(g(x))}{1+x^2}dx=\int_{-\infty}^{\infty}\frac{\log(g(x))}{1+x^2}dx$. We furthermore note that since $\log(g(z))\sim_i-2i(x-i)$ the residue at $i$ vanishs. Last but not least, $|f(z) |\sim C\log(R)/R^2$ so integrals over large semicirles of this function vanish in the limit of $R\rightarrow \infty$.

We can therefore state that twice our integral of interest equals the two integrals encirceling the two branchcuts in the upper half of the complex plane ($\delta\rightarrow 0_+$).

$$ 2I=\color{blue}{\int_{e^{i \pi(1/3-\delta)}}^{e^{i \pi(1/3-\delta)}\infty}f(z)dz-\int_{e^{i \pi(1/3+\delta)}}^{e^{i \pi(1/3+\delta)}\infty}f(z)dz}-\\ \color{red}{\int_{e^{i \pi(2/3-\delta)}}^{e^{i \pi(2/3-\delta)}\infty}f(z)dz-\int_{e^{i \pi(2/3+\delta)}}^{e^{i \pi(2/3+\delta)}\infty}f(z)dz}$$ It is a well known fact that such pairs of integrals collapse into integrals over the discontinuity of the integrand which is given in both cases by $2 \pi i\times(1+z^2)^{-1}$ and therefore: $$ 2I=2\pi i\left[\color{blue}{z_1\int_1^{\infty}\frac{dq}{1+(z_1q)^2}}-\color{red}{z_2\int_1^{\infty}\frac{dq}{1+(z_2q)^2}}\right]=\\ 2\pi i[\color{blue}{\text{arccot}(z_1)}-\color{red}{\text{arccot}(z_2)}] $$

Annoying algebra yields ($\text{arccot}(z_{1,2})=\mp i\log(2+\sqrt{3})+\frac{\pi}{4}$) the pleasantly simple end result:

$$ I=\pi(\log(2+\sqrt{3})) $$