Computing $\int_0^\infty \frac{\ln x}{(x^2+1)^2}dx$ I'm trying to compute
$$I=\int_0^\infty \frac{\ln x}{(x^2+1)^2}dx$$

The following is my effort,
$$I(a)=\int_0^\infty\frac{\ln x}{x^2+a^2}dx$$
Let $x=a^2/y$ so that $dx=-(a^2/y^2)dy$ which leads to
$$I(a)=\int_0^\infty \frac{\ln(a/y)}{a^2+y^2}dy=\int_0^\infty\frac{\ln a}{y^2+a^2}dy-I(a)$$
$$I(a)=\frac{1}{2}\int_0^\infty\frac{\ln a}{y^2+a^2}dy=\frac{1}{2}\frac{\ln a}{a}\arctan\left( \frac{y}{a}\right)_0^\infty=\frac{\ln a}{a}\frac{\pi }{4}$$
Differentiating with respect to $a$ then
$$\frac{dI(a)}{a}=-2aI'(a)=\frac{\pi}{4}\left( \frac{1}{a^2}-\frac{\ln a}{a^2}\right)$$
where $$I'(a)=\int_0^\infty \frac{\ln y}{(y^2+a^2)^2}dx$$
$$I'(a)=\frac{\pi}{-8a}\left( \frac{1}{a^2}-\frac{\ln a}{a^2}\right)$$
$$I'(a=1)=-\frac{\pi}{8}$$
But the correct answer is $-\pi/4$.

Can you help me figure where I mistake? Please give some method if there is which is much better than what I have done?

$$\begin{align*}
I &= \int_0^\infty \frac{\ln x}{(x^2+1)^2} \, dx \\[1ex]
&= \int_0^1 \frac{\ln x}{(x^2+1)^2} \, dx + \int_1^\infty \frac{\ln x}{(x^2+1)^2} \, dx \\[1ex]
&= \int_0^1 \frac{1-x^2}{(x^2+1)^2} \ln(x) \, dx \tag{1} \\[1ex]
&= 2 \int_0^1 \frac{\ln(x)}{(x^2+1)^2} \, dx - \int_0^1 \frac{\ln(x)}{x^2+1} \, dx \tag{2} \\[1ex]
&= 2 \sum_{n=0}^\infty (-1)^n (n+1) \int_0^1 x^{2n} \ln(x) \, dx - \sum_{n=0}^\infty (-1)^n \int_0^1 x^{2n} \ln(x) \, dx \tag{3} \\[1ex]
&= \sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)^2} - 2 \sum_{n=0}^\infty \frac{(-1)^n(n+1)}{(2n+1)^2} \tag{4} \\[1ex]
&= \sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)^2} - \sum_{n=0}^\infty (-1)^n \left(\frac1{2n+1} + \frac1{(2n+1)^2}\right) \tag{5} \\[1ex]
&= - \sum_{n=0}^\infty \frac{(-1)^n}{2n+1} \\[1ex]
&= -\arctan(1) = \boxed{-\frac\pi4} \tag{6}
\end{align*}$$


*

*$(1)$ : substitute $x\mapsto\frac 1x$ in the latter integral

*$(2)$ : polynomial division

*$(3)$ : exploit the Maclaurin series of $\frac1{1-x}$

*$(4)$ : integrate by parts

*$(5)$ : partial fractions

*$(6)$ : recognize the Maclaurin series of $\arctan(x)$ evaluated at $x=1$
