The value of the definite integral The value of the definite integral $\displaystyle\int\limits_0^\infty \frac{\ln x}{x^2+4} \, dx$ is
(A) $\dfrac{\pi \ln3}{2}$   (B) $\dfrac{\pi \ln2}{3}$  (C) $\dfrac{\pi \ln2}{4}$  (D) $\dfrac{\pi \ln4}{3}$
I tried using integration by parts,
\begin{align}
& \int_0^\infty \frac{\ln x}{x^2+4}dx = \ln x\int_0^\infty \frac{1}{x^2+4}dx-\int_0^\infty \left(\frac{d}{dx}\ln x\int_0^\infty \frac{1}{x^2+4}\right) \, dx \\[10pt]
= {} & \left[\ln x \frac{1}{2}\tan^{-1}\frac{x}{2}\right]-\int_0^\infty \frac{1}{x}\frac{1}{2}\tan^{-1}\frac{x}{2} \, dx
\end{align}
I could not move ahead. Can someone help me to get final answer?
 A: Using the substitution $\displaystyle \theta=\frac{1}{2}\arctan\left(\frac{x}{2}\right)$ so $\displaystyle \text{d}\theta=\frac{1}{x^2+4} \text{d}x$ and $\displaystyle x=2\tan(2\theta)$ we get $$\int_{0}^{\infty}\frac{\ln(x)}{x^2+4}\text{d}x=\int_{0}^{\frac{\pi}{4}}\ln\left(2\tan(2\theta)\right)\text{d}\theta= \\ =\int_{0}^{\frac{\pi}{4}}\ln(2)\text{d}\theta+\int_{0}^{\frac{\pi}{4}}\ln\sin(2\theta)\text{d}\theta-\int_{0}^{\frac{\pi}{4}}\ln\cos(2\theta)\text{d}\theta $$
Last two integrals cancel each other, so we get $$\int_{0}^{\infty}\frac{\ln(x)}{x^2+4}\text{d}x=\int_{0}^{\frac{\pi}{4}}\ln(2)\text{d}\theta=\frac{\pi \ln(2)}{4}$$

Of course, we can generalize and compute $\displaystyle \int_{0}^{\infty}\frac{\ln(x)}{x^2+k^2}\text{d}x$.
Using the substitution $\displaystyle \theta=\frac{1}{k}\arctan\left(\frac{x}{k}\right)$ we get $\displaystyle \text{d}\theta=\frac{1}{x^2+k^2}\text{d}x \ , \ x=k\tan(k\theta)$, hence $$\int_{0}^{\infty}\frac{\ln(x)}{x^2+k^2}\text{d}x=\int_{0}^{\Large \frac{\pi}{2k}}\ln(k\tan(k\theta))\text{d}\theta= \\ =\int_{0}^{\Large \frac{\pi}{2k}}\ln(k)\text{d}\theta+\int_{0}^{\Large \frac{\pi}{2k}}\ln(\sin(k\theta))\text{d}\theta-\int_{0}^{\Large \frac{\pi}{2k}}\ln(\cos(k\theta))\text{d}\theta$$
Now, we prove that $\displaystyle I=\int_{0}^{\Large \frac{\pi}{2k}}\ln(\sin(k\theta))\text{d}\theta-\int_{0}^{\Large \frac{\pi}{2k}}\ln(\cos(k\theta))\text{d}\theta=0$.
For the first integral we use the substitution $\displaystyle u=\frac{\pi}{2}-k\theta$ and for the second integral we use the substitution $\displaystyle u=k\theta$, hence $$I=-\frac{1}{k}\int_{\Large \frac{\pi}{2}}^{0}\ln(\cos(u))\text{d}u-\frac{1}{k}\int_{0}^{\Large \frac{\pi}{2}}\ln(\cos(u))\text{du}=0$$
Eventually, $\displaystyle \boxed{\color{#2E2EFE}{\int_{0}^{\infty}\frac{\ln(x)}{x^2+k^2}\text{d}x=\int_{0}^{\Large \frac{\pi}{2k}}\ln(k)\text{d}\theta =\frac{\pi}{2k}\ln(k)}}$.
A: $\bf{My\; Solution::}$ Let  $\displaystyle I = \int_{0}^{\infty}\frac{\ln(x)}{x^2+4}dx\;,$ Now Let $x=2t\;,$ Then $dx = 2dt$
and Changing Limits, we get
$$\displaystyle I = \int_{0}^{\infty}\frac{\ln(2t)}{4t^2+4}\times 2dt = \frac{1}{2}\int_{0}^{\infty}\frac{\ln(2t)}{t^2+1}dt=\frac{1}{2}\int_{0}^{\infty}\frac{\ln(2)}{t^2+1}dt+\frac{1}{2}\int_{0}^{\infty}\frac{\ln(t)}{t^2+1}dt$$
So $$\displaystyle I = \frac{\ln(2)}{2}\int_{0}^{\infty}\frac{1}{1+t^2}dt+\frac{1}{2}J = \frac{\ln(2)}{2}\cdot \frac{\pi}{2}+\frac{1}{2}J...........(1)$$
Now For Calculation of $$\displaystyle J = \frac{1}{2}\int_{0}^{\infty}\frac{\ln(t)}{t^2+1}dt\;,$$ Put $\displaystyle t=\frac{1}{u}$ and $\displaystyle dt = -\frac{1}{u^2}du$
and Changing Limits, We get $$\displaystyle J=-\frac{1}{2}\int_{0}^{\infty}\frac{\ln(u)}{1+u^2}du = -\frac{1}{2}\int_{0}^{\infty}\frac{\ln(t)}{1+t^2}dt = -J$$
So We get $J = -J\Rightarrow J=0\;,$ Now Put into $(1)$ equation, We get $$\displaystyle I=\int_{0}^{\infty}\frac{\ln(x)}{x^2+4}dx = \frac{\pi\cdot \ln(2)}{4}.$$
A: Let $$\displaystyle I = \int_{0}^{\infty}\frac{\ln x}{x^2+4}dx = \int_{0}^{2}\frac{\ln x}{x^2+4}dx+\underbrace{\int_{2}^{\infty}\frac{\ln x}{x^2+4}dx}_{J}$$
Now for Calculation of $$\displaystyle J = \int_{2}^{\infty}\frac{\ln x}{x^2+4}dx\;,$$ Now put $\displaystyle x=\frac{4}{y}\;,$ Then $\displaystyle dx = -\frac{4}{y^2}dy$
So we get $$\displaystyle J = -\int_{2}^{0}\left[\frac{\ln 4-\ln y}{y^2+4}\right]dy = \int_{0}^{2}\frac{\ln 4}{x^2+4}dy-\int_{0}^{\infty}\frac{\ln y}{x^2+4}dx$$
Above we have used $$\displaystyle \bullet\; \int_{a}^{b}f(y)dy = \int_{a}^{b}f(x)dx$$
And we also used  $$\displaystyle \bullet\; \int_{a}^{b}f(x)dx = -\int_{b}^{a}f(x)dx$$
Now Put value of $\displaystyle J$ in $\displaystyle I\;,$ So we get
$$\displaystyle I = \int_{0}^{2}\frac{\ln x}{x^2+4}dx+\int_{0}^{2}\frac{\ln 4}{x^2+4}dx-\int_{0}^{2}\frac{\ln x}{x^2+4}dx$$
So we get $$\displaystyle I = \ln 4\cdot \left[\tan^{-1}\left(\frac{x}{2}\right)\right]_{0}^{2} = \ln (4)\cdot \frac{1}{2}\cdot \frac{\pi}{4}= \frac{\ln (2)\cdot \pi}{4}$$
A: In General $$\int_0^{\infty}\frac{\ln(x)}{x^2+b^2}dx=\frac{\pi\ln(b)}{2b}$$ for $b>0, b\neq 1$
$\bf{Solution::}$ Let we introduce a parameter, say $a > 0$ as follows:
Set $$F(a) =  \int_{0}^{\infty} \frac{\ln ax}{x^2 + b^2} dx$$ 
So that we get $$\frac{dF}{da} = \frac{1}{a}\int_{0}^{\infty} \frac{1}{x^2 + b^2} dx = \frac{1}{a} \frac{\pi}{2b}$$.
On integrating with respect to $a$,
We get $$\displaystyle F(a) = \frac{\pi}{2b} \ln a + C$$ and plugging in $a = 1$ gives $C = 0$
So we get $$F(a) = \int_{0}^{\infty} \frac{\ln ax}{x^2 + b^2} dx=\frac{\pi}{2b} \ln a$$
