I thought it might be instructive to present an approach that avoids use of Feyman's trick and relies on contour integration only. In the following development, we take the principal branch of all complex logarithms. To that end we proceed.
We first begin by writing
$$\begin{align}
\int_0^{\pi/2}\log\left(1+\cos^2(2x)\right)\,dx&=\int_0^{\pi/2}\log\left(\frac32+\frac12\cos(4x)\right)\,dx\\\\
&=-\log(2)\frac\pi2+\frac14 \int_{-\pi}^{\pi}\log(3+\cos(x))\,dx\\\\
&=-\log(2)\frac\pi2+\frac14\oint_{|z|=1}\frac{\log\left(\frac{6z+z^2+1}{2z}\right)}{iz}\,dz\\\\
&=-\log(2)\frac\pi2+\frac14\oint_{|z|=1}\frac{\log\left(6z+z^2+1\right)-\log(2z)}{iz}\,dz\\\\
&=-\log(2)\frac\pi2\\\\
&+\frac14\color{blue}{\oint_{|z|=1}\frac{\log\left(z-(-3+2\sqrt{2})\right)}{iz}\,dz}\tag1\\\\
&+\frac14\color{red}{\oint_{|z|=1}\frac{\log\left(z-(-3-2\sqrt{2})\right)}{iz}\,dz}\tag2\\\\
&-\frac14\color{green}{\oint_{|z|=1}\frac{\log(2)}{iz}\,dz}\tag3\\\\
&-\frac14\oint_{|z|=1}\frac{\log(z)}{iz}\,dz\tag4\\\\
&=-\log(2)\frac\pi2+\frac14\left(\color{blue}{0}+\color{red}{2\pi \log(3+2\sqrt2)}-\color{green}{2\pi\log(2)}-0\right)\\\\
&=\frac\pi2\log\left(\frac34 +\frac12\sqrt{2}\right)
\end{align}$$
NOTES:
In evaluating $(2)$ and $(3)$ we observed that the functions $\log(z+3+2\sqrt 2)$ and $\log(2)$ are analytic in and on the circle $|z|=1$. Hence, Cauchy's Integral Formula yields the results immediately.
To evaluate $(1)$, we cut the plane from $-3+2\sqrt 2$ to $-\infty$ and use the principal branch of the logarithm. Let $C$ be the contour comprised of the $(i)$ circular arc on $|z|=1$ from $-\pi^+$ to $\pi^-$, traversed counterclockwise, $(ii)$ integration around the branch cut from $-1$ to $-3+2\sqrt 2$, and $(iii)$ an "infinitesimal circular arc around the branch point. The contribution to the integration around the branch point vanishes. Then, Cauchy's Integral Theorem guarantees that
$$\begin{align}
2\pi\log(3-2\sqrt 2)&=\oint_{C}\frac{\log\left(z-(-3+2\sqrt 2)\right)}{iz}\,dz\\\\
&=\int_{|z|=1\\|\arg(z)|\le \pi^-}\frac{\log\left(z-(-3+2\sqrt 2)\right)}{iz}\,dz+\int_{-1}^{-3+2\sqrt 2}\frac{i2\pi}{iz}\,dz
\end{align}$$
Hence, we find that
$$\begin{align}
\oint_{|z|=1}\frac{\log\left(z-3+2\sqrt 2\right)}{iz}\,dz&=\int_{|z|=1\\|\arg(z)|\le \pi^-}\frac{\log\left(z-(-3+2\sqrt 2)\right)}{iz}\,dz\\\\
&=2\pi \log\left(3+2\sqrt 2\right)-\int_{-1}^{-3+2\sqrt 2}\frac{i2\pi}{iz}\,dz\\\\
&=2\pi \log\left(3+2\sqrt 2\right)-2\pi \log\left(3+2\sqrt 2\right)\\\\
&=0
\end{align}$$
Evaluation of $(4)$ proceeds similarly and we leave that as an exercise for the reader.