Solution (source code)

= Solution

Use $u=1/x$, so $dx=-du/u^2$ and $\ln x=-\ln u$. Reversing the integration bounds gives, without evaluating either side,
$$
\boxed{\int_1^\infty\frac{\ln x}{x^2}dx=-\int_0^1\ln u\,du.}
$$
For $J=\int_0^\infty\ln x/(1+x^2)dx$, the same <change of variables> gives
$$
J=-\int_0^\infty\frac{\ln u}{1+u^2}du=-J,
$$
so $\boxed{J=0}$. These are legitimate transformations of <improper integrals>: $|\ln x|$ is integrable near zero, and $(\ln x)/x^2$ is integrable at infinity. In particular $J$ is absolutely convergent, so no cancellation of divergent endpoints is being assumed.