How to compute $\int_0^\infty \frac{\log(2+x^2)}{4+x^2}\,\mathrm dx$ Evaluate the integral
$$\int_0^\infty \frac{\log(2+x^2)}{4+x^2}dx$$
--
I started by stating that the integral from 0 to infinity should be the same as half the integral from $-\infty$ to $\infty$, that is:
$$\int_0^\infty \frac{\log(2+x^2)}{4+x^2}dx = \frac{1}{2}\int_{-\infty}^\infty \frac{\log(2+x^2)}{4+x^2}dx$$
and then by stating that this must be equal to 
$$\pi i \cdot \sum(\text{residues in upper plane})$$
noting that there is a singularity at $z=2i$ in the upper half plane, and an "issue" (I don't know if it's strictly a singularity) with the log function at $z=\sqrt{2}i$.
The residue at $z=2i$ is easily dealt with, but when I try to deal with the log issue, I can't make any headway. I decided to make my branch cut between $z=\sqrt{2}i$ and $z=-\sqrt{2}i$, and form a contour that goes around this cut and the point, but it doesn't seem to be working out for me. 
Suggestions would be appreciated! 
 A: Using Feynman's trick works:
For $a\geq0$, let $$G(a)=\int_0^\infty \frac{\ln(2+ ax^2)}{4+x^2}\,\mathrm dx.$$ 
Then the Leibniz rule implies that for $a>0$, $$G'(a)=\int_0^\infty \frac{x^2}{\left(x^2+4\right) \left(a x^2+2\right)}\,\mathrm dx.$$ The last integrand is a rational function and thus has a closed form anti-derivative that can be computed algortihmically. Namely,
$$G'(a)=\left. \frac{\frac{\sqrt{2} \tan ^{-1}\left(\frac{\sqrt{a} x}{\sqrt{2}}\right)}{\sqrt{a}}+2 \tan
   ^{-1}\left(\frac{2}{x}\right)}{2-4 a}\right|_{x=0}^{x=\infty}=\dots=\frac{\pi}{2\sqrt2(1+\sqrt2\sqrt a)\sqrt a}.$$
We know that $G(a)=G(0)+\int_0^a G'(b)\,\mathrm db$. Indeed, $$\int_0^a G'(b)\,\mathrm db = \frac{\pi}{2\sqrt2} \int_0^a \frac1{(1+\sqrt{2}\sqrt b)\sqrt b}\,\mathrm db=\frac\pi2\ln(1+\sqrt2\sqrt a).$$
Also, $$G(0)=\ln(2)\int_0^\infty \frac{1}{4+x^2}\,\mathrm dx=\frac{\ln(2)\pi}4.$$
Hence,
$$\bbox[15px,border:1px groove navy]{
\int_0^\infty \frac{\ln(2+ x^2)}{4+x^2}\,\mathrm dx
=G(1)=\frac{\pi}2\left(\frac{\ln(2)}2+\ln(1+\sqrt2)\right).
}$$
A: $$I=\int_{0}^{\infty} \frac{\log(2+x^2)}{4+x^2}dx=\int_{0}^{\infty} \frac{\log(a^2+x^2)}{4+x^2}dx=I(a)$$
$$\implies \frac{dI}{da}=2a \int_{0}^{\infty} \frac{dx}{(a^2+x^2)(4+x^2)]}=
\frac{2a}{4-a^2}\int_{0}^{\infty} \left( \frac{1}{a^2+x^2}-\frac{1}{4+x^2}\right) dx$$
$$\frac{dI}{da}=\frac{2a}{4-a^2}[\frac{\pi}{2a}-\frac{\pi}{4}]=\frac{\pi}{2(a+2)} \implies I(a)=\frac{\pi}{2} \ln (a+2)+C~~~~(*)$$
$$I(0)=2\int_{0}^{\infty}  \frac{\ln x}{x^2+4}dx=J~~~~(1)$$
Let $x=1/t \implies dx=-dt/t^2$ in $J$, the 
$$J=2\int_{0}^{\infty} \frac{-\ln t}{t^2+4}dt=2\int_{0}^{\infty} \frac{-\ln x}{x^2+4}dx~~~~(2)$$
Adding (1) and (2), we get $J=0=I(0)$, from (*) we get $C=-\frac{\pi}{2}\ln 2$
Thus, $$I(a)=\frac{\pi}{2} \ln (a+2)-\frac{\pi}{2} \ln 2= \frac{\pi}{2}\ln\frac{a+2}{2}=\frac{\pi}{2}\ln (1+\frac{1}{\sqrt{2}}),~ as ~a=\sqrt{2}.$$
A: Without residues.
$$ \frac{\log(2+x^2)}{4+x^2}=\frac{\log(x+i\sqrt2)+\log(x-i\sqrt2)}{(x+2i)(x-2i)}$$
$$\frac{1}{(x+2i)(x-2i)}=\frac{i}{4}\left(\frac{1}{x+2 i}-\frac{1}{x-2 i}\right)$$ So, we face four integrals looking like
$$\int \frac{\log(x+a)}{x+b}\,dx=\text{Li}_2\left(\frac{x+a}{a-b}\right)+\log (x+a) \log \left(\frac{b+x}{b-a}\right)$$
