Evaluation of $\int_{0}^{\pi/2}\log\left(1+\cos^2 (2x)\right)\, \mathrm{d}x $ $$I=\int_{0}^{\pi/2}\log\left(1+\cos^2 (2x)\right)\, \mathrm{d}x $$
This integral came up while attempting
$$I=\int_{0}^{\infty}\frac {\log(1+y^4)}{1+y^2}\, dy$$
Let $x=\arctan(y)$
$$I=\int_{0}^{\frac{π}{2}}(\ln(1+\tan^4 (x)) \,dx$$
$$I=\int_{0}^{\pi/2}\log\left(1+\cos^2 (2x)\right)-\log(2)-4\log(\cos (x)) dx $$
I don't know how to integrate this one
$$\int_{0}^{\pi/2}\log\left(1+\cos^2 (2x)\right)\, dx $$
I tried to convert$ \log(1+\cos^2 (2x))$ into $\log(3+\cos (4x))$, which also doesn't work
 A: \begin{align}
&\int_{0}^{\frac {π}{2}}\ln(1+\cos^2 2x) dx 
\overset{t=2x} =\int_{0}^{\frac {π}{2}}\ln(1+\cos^2t) dt \\
=& \int_{0}^{\frac {π}{2}}dt \int_0^1 \frac{\cos^2t}{1+y\cos^2t}dy
= \int_0^1 \frac{dy}y \int_{0}^{\frac {π}{2}}\left( 1-  \frac{1}{1+y\cos^2t}\right)dt \\ 
= & \frac\pi2 \int_0^1 \bigg( \frac1 y-  \frac{1}{y\sqrt{1+y}}\bigg)dy 
 = \pi\ln(1+\sqrt2)-\pi\ln2\\
\end{align}
A: 
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.
A: Alternatively, instead of making the substitution $x= \arctan y$, we can evaluate the integral $$\int_{0}^{\infty} \frac{\log(1+y^{4})}{1+ y^{2}} \, \mathrm dy$$ by integrating the function $$f(z) = \frac{\log (z +e^{i \pi /4})}{1+z^{2}} $$ around an infinitely large, closed semicircle in the upper half of the complex plane.
Here we assume that we're using the principal branch of the logarithm, which means that $f(z)$ is meromorphic in the upper half-plane.
Integrating around the contour, we get $$\int_{-\infty}^{\infty} \frac{\log(y+e^{i \pi /4})}{1+ y^{2}} \, \mathrm dy = 2 \pi i \operatorname{Res}[f(z), i]= 2 \pi i \left(\frac{\log(i+ e^{i \pi /4})}{2i} \right). $$
If we then equate the real parts on both sides of the above equation, we get 
$$ \begin{align} \frac{1}{2} \int_{-\infty}^{\infty} \frac{\log(y^{2}+\sqrt{2}y+1)}{1+y^{2}} \, \mathrm dy &= \small \frac{1}{2} \left( \int_{-\infty}^{0}\frac{\log(y^{2}+\sqrt{2}y+1)}{1+y^{2}} \, \mathrm dy + \int_{0}^{\infty} \frac{\log(y^{2}+\sqrt{2}y+1)}{1+y^{2}} \, \mathrm dy \right)\\ &= \small\frac{1}{2} \left(\int_{0}^{\infty} \frac{\log(u^{2}-\sqrt{2} u +1)}{1+u^{2}} \, \mathrm du + \int_{0}^{\infty}\frac{\log(y^{2}+\sqrt{2}y+1)}{1+y^{2}} \, \mathrm dy  \right)\\ &= \frac{1}{2} {\color{red}{\int_{0}^{\infty} \frac{\log(1+y^{4})}{1+y^{2}} \, \mathrm dy}}
\\ &=\pi \, \frac{\log(2 + \sqrt{2})}{2}. \end{align} $$
EDIT:
I had forgotten that I had evaluated a similar integral here.
