Solve $\int_{0}^{\infty}\frac{\ln(2x)}{4+x^2}dx$ by contour integration I'm a little stuck with this one. I've found the singularities to be at $\pm 2i$ and $0$ (branch point). So far, using a branch cut at $2\pi$ I've found that
$$\int_{0}^{\infty}\frac{\ln(2r)}{4+r^2}dr+\int_{0}^{\infty}\frac{\ln(2r)+2\pi i}{4+r^2}dr = 2I+\int_{0}^{\infty}\frac{2\pi i}{4+r^2}dr$$
And 
$$\int_{0}^{\infty}\frac{2\pi i}{4+r^2}dr = \text{Res}(r=2i) \\ = -2\pi^2\lim_{r\to2i}\frac{r-2i}{(r-2i)(r+2i)} = \frac{i}{2}\pi^2$$
My problem is that the answer I found is completely imaginary, and I'm not sure how that's possible given that the original function is real. Any help is appreciated.


METHODOLOGY $1$:  COMPLEX ANALYSIS

As already established in the answer left by @ZaidAlyafeai, the classical approach begins by analyzing the contour integral 
$$I=\oint_C \frac{\log^2(2z)}{z^2+4}\,dz$$
where $C$ is the "keyhole" contour with the keyhole taken along the positive real axis.  In that case $0\le \arg(z)<2\pi$.  Then, we have
$$\begin{align}
\color{blue}{\int_0^\infty \frac{\log^2(2x)}{x^2+4}\,dx-\int_0^\infty\frac{(\log(2x)+i2\pi)^2}{x^2+4}\,dx}&=\color{red}{2\pi i \text{Res}\left(\frac{\log^2(2z)}{z^2+4}, z=\pm i2\right)}\\\\
&=\color{red}{2\pi i\left(\frac{\log^2(4i)}{4i}+\frac{\log^2(-4i)}{-4i}\right)}\\\\
&=\color{red}{\frac{\pi}{2}\left((\log(4)+i\pi/2)^2-(\log(4)+i3\pi/2)^2\right)}\\\\
\color{blue}{4\pi^2\int_0^\infty\frac{1}{x^2+4}\,dx-i4\pi\int_0^\infty\frac{\log(2x)}{x^2+4}\,dx}&=\color{red}{\frac{\pi}{2}\left(2\pi^2-i2\pi\log(4)\right)}\tag 1
\end{align}$$
where we find by setting real and imaginary parts of $(1)$ equal
$$\int_0^\infty \frac{1}{x^2+4}\,dx=\frac{\pi}{4}$$
and

$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty\frac{\log(2x)}{x^2+4}\,dx=\frac{\pi\log(2)}{2}} \tag 2$$



METHODOLOGY $2$:  REAL ANALYSIS
I thought it might be instructive to present an approach that relies on real analysis only. 

To proceed, we begin by enforcing the substitution $x\to 4/x$.  Then, we have
$$\begin{align}
\int_0^\infty \frac{\log(2x)}{x^2+4}\,dx&=\int_0^\infty \frac{\log(8/x)}{(4/x)^2+4}\,\frac{4}{x^2}\,dx\\\\
&=4\log(2)\int_0^\infty\frac{1}{x^2+4}\,dx-\int_0^\infty \frac{\log(2x)}{x^2+4}\\\\
2\int_0^\infty \frac{\log(2x)}{x^2+4}\,dx&=4\log(2)\int_0^\infty\frac{1}{x^2+4}\,dx\\\\
\int_0^\infty \frac{\log(2x)}{x^2+4}\,dx&=2\log(2)\int_0^\infty\frac{1}{x^2+4}\,dx\\\\
&=\frac{\pi\log(2)}{2}
\end{align}$$
agreeing with the result in $(2)$ as expected!
