Proving $\int_0^\infty \log\left (1-2\frac{\cos 2\theta}{x^2}+\frac{1}{x^4} \right)dx =2\pi \sin \theta$ 
Prove $$\int_0^\infty \log \left(1-2\frac{\cos 2\theta}{x^2}+\frac{1}{x^4} \right)dx =2\pi \sin \theta$$where $\theta\in[0,\pi]$.

I've met another similar problem,
$$ \int_0^{2\pi} \log(1-2r\cos \theta +r^2) d\theta=2\pi \log^+(r^2) $$
I am curious whether there is any relationship between them.
And I got stuck on the proposition in the title. I found that
$$1-2\frac{\cos 2\theta}{x^2}+\frac{1}{x^4} =\left(\frac{1}{x}-e^{i\theta}\right)\left(\frac{1}{x}+e^{i\theta}\right)\left(\frac{1}{x}-e^{-i\theta}\right)\left(\frac{1}{x}+e^{-i\theta}\right)$$
But I couldn't move on.
Any hints? Thanks in advance.

For $\theta \in [0;\pi]$,
\begin{align}
J(\theta)&=\int_0^\infty \ln\left(1-\frac{2\cos(2\theta)}{x^2}+\frac{1}{x^4}\right) \,dx
\end{align}
Perform the change of variable $y=\dfrac{1}{x}$,
\begin{align}
J(\theta)&=\int_0^\infty \frac{\ln\left(1-2\cos(2\theta)x^2+x^4\right)}{x^2} \,dx
\end{align}
For $a\geq -1$, define the function $F$ by,
\begin{align}F(a)&=\int_0^\infty \frac{\ln\left(1+2ax^2+x^4\right)}{x^2} \,dx\\
&=\left[-\frac{\ln\left(1+2ax^2+x^4\right)}{x}\right]_0^\infty+\int_0^\infty \frac{4\left(x^2+a\right)}{1+2ax^2+x^4}\,dx\\
&=\int_0^\infty \frac{4\left(x^2+a\right)}{1+2ax^2+x^4}\,dx\\
\end{align} 
Perform the change of variable $y=\dfrac{1}{x}$, 
\begin{align}F(a)&=\int_0^\infty \frac{4\left( \frac{1}{x^2}+a\right) }{x^2\left(1+\frac{2a}{x^2}+\frac{1}{x^4}\right) } \,dx\\
&=\int_0^\infty \frac{4\left( 1+ax^2\right) }{x^4+2ax^2+1 } \,dx\\
\end{align}
Therefore,
\begin{align}F(a)&=\int_0^\infty \frac{2(a+1)\left( 1+x^2\right) }{x^4+2ax^2+1 } \,dx\\
&=2(a+1)\int_0^\infty \frac{\left(1+\frac{1}{x^2}\right)}{x^2+\frac{1}{x^2}+2a } \,dx\\
&=2(a+1)\int_0^\infty \frac{\left(1+\frac{1}{x^2}\right)}{\left(x-\frac{1}{x}\right)^2+2(a+1) } \,dx\\
\end{align}
Perform the change of variable $y=x-\dfrac{1}{x}$,
\begin{align}F(a)&= 2(a+1)\int_{-\infty}^{+\infty}\frac{1}{x^2+2(a+1)}\,dx\\
&=4(a+1)\int_{0}^{+\infty}\frac{1}{x^2+2(a+1)}\,dx\\
&=\left[2\sqrt{2(a+1)}\arctan\left( \frac{x}{\sqrt{2(a+1)}} \right)\right]_0^\infty\\
&=\boxed{\pi\sqrt{2(1+a)}}
\end{align}
Observe that, $J(\theta)=F\big(-\cos(2\theta)\big)$.
\begin{align} 2(1-\cos(2\theta))&=2(1-\cos^2(\theta)+\sin^2 (\theta))\\
&=2\times 2\sin^2 (\theta)\\
&=4\times \sin^2 (\theta)\\
\end{align} 
Since, for $\theta \in [0;\pi],\sin(\theta)\geq 0$ then $\sqrt{2(1-\cos(2\theta))}=2\sin(\theta)$
Therefore,
\begin{align}\boxed{J(\theta)=2\pi \sin(\theta)}\end{align}
