<s>[INST] How to find ${\large\int}_1^\infty\frac{1-x+\ln x}{x \left(1+x^2\right) \ln^2 x} \mathrm dx$? Please help me to find a closed form for this integral:
$$
I=\int_1^\infty\frac{1-x+\ln x}{x \left(1+x^2\right) \ln^2 x} \mathrm dx
$$
Routine textbook methods for this complicated integral fail. 
 [/INST] Let's give a (sketch of the) proof of the following closed form evaluation.

$$
I=\int_1^\infty\frac{1-x+\ln x}{x \left(1+x^2\right) \ln^2 x} \mathrm dx=\frac{\ln2}6+\frac{\ln\pi}2-6\ln A+\frac2\pi G,
$$

where $A$ is the Glaisher–Kinkelin constant and $G$ is the Catalan constant.
Observe that, by the change of variable $\displaystyle u=\frac 1x$, we have
$$
I=\int_0^1\frac{u-1-u\ln u}{\left(1+u^2\right) \ln^2 u} \mathrm du=\int_0^1\frac{(1-u^2)(u-1-u\ln u)}{\left(1-u^4\right) \ln^2 u} \mathrm du.
$$
We set
$$
I(s):=\int_0^1u^s\frac{(1-u^2)(u-1-u\ln u)}{\left(1-u^4\right) \ln^2 u} \mathrm du, \quad s\geq0.
$$
We are allowed to differentiate $I(s)$  twice to obtain
$$
I''(s)=\int_0^1u^s\frac{(1-u^2)(u-1-u\ln u)}{\left(1-u^4\right)} \mathrm du. 
$$
Using the standard expansion $\displaystyle \frac{1}{1-u^4}=\sum_{k=0}^{\infty}u^{4k}, \, |u|<1,$ and performing the termwise integration, 
$$
\begin{align}
I''(s)=\sum_{k=0}^{\infty}\int_0^1u^{s+4k}(1-u^2)(u-1-u\ln u) \mathrm du
\end{align}
$$ 
gives
$$
\begin{align}
I''(s)=\sum_{k=0}^{\infty}\left(\frac{1}{(4k+2+s)^2}-\frac{1}{(4k+4+s)^2}+\frac{1}{(4k+2+s)}-\frac{1}{(4k+1+s)}\right).
\end{align}
$$ 
Now, recall the following series representation of the digamma function $\displaystyle \psi : = \Gamma'/\Gamma$,
$$
\psi(u+1) = -\gamma + \sum_{k=1}^{\infty} \left( \frac{1}{k} - \frac{1}{u+k}  
\right), \quad u >-1, 
$$ where $\gamma$ is the Euler-Mascheroni constant and, by differentiation, giving$$
\psi'(u+1) = \sum_{k=1}^{\infty} \frac{1}{(u+k)^2}, \quad u>-1.
$$
Hence
$$
I''(s)=\frac{1}{16}\psi'\left(\frac{s+2}{4}\right)-\frac{1}{16}\psi'\left(\frac{s+4}{4}\right)+\frac{1}{4}\psi\left(\frac{s+4}{4}\right)+\frac{1}{4}\psi\left(\frac{s+1}{4}\right)-\frac{1}{4}\psi\left(\frac{s+3}{4}\right)-\frac{1}{4}\psi\left(\frac{s+2}{4}\right).
$$
We have, as $s \rightarrow +\infty$, $I(s) \rightarrow 0$ and $I'(s) \rightarrow 0$, leading to
$$
I(s)=\log \Gamma \left(\frac{s+2}{4}\right)-\log \Gamma \left(\frac{s+4}{4}\right) +  
 4 \left(\psi\left(-2, \frac{s+4}{4}\right) + \psi\left(-2, \frac{s+1}{4}\right) - 
    \psi\left(-2, \frac{s+2}{4}\right) - \psi\left(-2, \frac{s+3}{4}\right)\right),
$$
then, with the use of Wolfram Alpha, as $s \rightarrow 0$ we get
$$
I=I(0)=\frac{\ln2}6+\frac{\ln\pi}2-6\ln A+\frac2\pi G.
$$
</s>