Solve $\int_0^\infty \frac{\ln x}{x^2+4} \,\mathrm{d}x$ (Stanford Math Tournament 2012 #8)
I tried rewriting the denominator as $4\left(\frac{x}{2}^2 + 1\right)$ and then integrating by parts, but that got me nowhere...
I then tried the substitution $x = 2\tan u$, which resulted in the integral being $$\frac{1}{2} \int_0^\frac{\pi}{2} \ln (2\tan u) \,\mathrm{d}u.$$
And from this point on I got stuck.
I would appreciate any and all advice on how finish the problem.
Thanks
A
 A: $$\begin{align}\frac{1}{2} \int\limits_0^\frac{\pi}{2} \ln (2\tan u) \,\mathrm{d}u & =  \frac{1}{2} \int\limits_0^\frac{\pi}{2} \ln (2) \,\mathrm{d}u + \frac{1}{2} \int\limits_0^\frac{\pi}{2} \ln (\tan u) \,\mathrm{d}u\\~\\&= \dfrac{\pi \ln 2}{4} +  \frac{1}{2} \int\limits_0^\frac{\pi}{2} \ln (\tan u) \end{align}$$

Now notice below to conclude that the remaining integral evaluates to $0$ : 
$$I = \int\limits_0^\frac{\pi}{2} \ln (\tan u)du =  \int\limits_0^\frac{\pi}{2} \ln (\tan(\frac{\pi}{2}- u))du= \int\limits_0^\frac{\pi}{2} \ln (\cot u) du= -I$$
A: I should also add that this integral may be evaluated using the Residue theorem by considering
$$\oint_C dz \frac{\log^2{z}}{z^2+4} $$
where $C$ is a keyhole contour of outer radius $R$ and inner radius $\epsilon$.  In the limits as $R \to \infty$ and $\epsilon \to 0$, the contour integral is equal to
$$-i 4 \pi \int_0^{\infty} dx \frac{\log{x}}{x^2+4} + 4 \pi^2 \int_0^{\infty} \frac{dx}{x^2+4} $$
The contour integral is also equal to $i 2 \pi$ times the sum of the residues at the poles $z_+=2 e^{i \pi/2}$ and $z_-=2 e^{i 3 \pi/2}$:
$$i 2 \pi \left [\frac{\left (\log{2}+i \pi/2 \right )^2}{i 4} + \frac{\left (\log{2}+i 3 \pi/2 \right )^2}{-i 4}\right ] = \frac{\pi}{2} \left (2 \pi^2 - i 2 \pi \log{2} \right )$$
Now,
$$\int_0^{\infty} \frac{dx}{x^2+4} = \frac{\pi}{4}$$
Therefore,
$$ \int_0^{\infty} dx \frac{\log{x}}{x^2+4} = \frac{\pi}{4} \log{2}$$
A: $$A=\int_0^{\infty}\frac{\ln x}{x^2+4}dx\stackrel{x\to 2u}{=}\frac{1}{2}\left (\int_0^{\infty}\frac{\ln 2}{u^2+1}du+\int_0^{\infty}\frac{\ln u}{u^2+1}du\right )$$
the first integral you can use $u=\tan v$
the second one $\int_0^{\infty}=\int_0^{1}+\int_1^{\infty}=I_1+I_2$
for $I_2=\int_1^{\infty}$ use $v\to 1/v$  then you get $I_2=-I_1$
so our integral equal to $$\int_0^{\infty}\frac{\ln x}{x^2+4}dx\stackrel{x\to 2u}{=}\frac{1}{2}\int_0^{\infty}\frac{\ln 2}{u^2+1}du=\frac{\ln 2}{2}\int_0^{\pi/2}dv$$
A: Hint: If you had $1$ instead of $4$ in the denominator, what would the value be ? You could try a change of variable that's relevant both for $\ln x$ and ${\rm d}x/(1+x^2)$.
A: 
$$I(k)~=~\int_0^\infty\frac{x^{k-1}}{x^n+a^n}dx~=~a^{k-n}\cdot\frac\pi n\cdot\csc\bigg(k\cdot\frac\pi n\bigg)$$

The above identity can easily be proven by letting $x=at$ and $u=\dfrac1{1+t^n}$ , then recognizing the expression of the beta function in the new integral, and using Euler's reflection formula to simplify the final result. Now all that's left to do is evaluating $I'(1)$.
