Conjectured value of $\int_{0}^{\infty}\left(\frac{x-1}{\ln^2 x}-\frac{1}{\ln x}\right)\frac{\mathrm{d}x}{x^2+1}$

I was curious whether this integral has a closed form expression :

$$\int_{0}^{\infty}\left(\frac{x-1}{\ln^2 x}-\frac{1}{\ln x}\right)\frac{\mathrm{d}x}{x^2+1}$$

The integrand has a singularity at $x=1$, but it's removable. And as $x \to \infty$, the integrand behaves like $\frac{1}{x \ln^{2}x}$. So the integral clearly converges.

Although I have not been able to derive its closed form, I think, by reverse symbolic calculators, up to 20 digits it could be

$$I=\frac{4G}{\pi}$$

where $G$ is Catalan's constant. Is it true or is it completely fabulous?

EDIT. NOTE :

For better search to this integral I have renamed the title from Conjectured value of logarithmic definite integral, which is ambiguous and did not say anything, to the current one with integral explicitly written.


It is not necessary to exploit any symmetries of the integrand. Setting $x=e^y$

$$ I=\int_{-\infty}^{\infty}\underbrace{e^y\left(\frac{e^y-1}{y^2}-\frac{1}{y}\right)\frac{1}{e^{2y}+1}}_{f(y)}\,dy $$

Integrating around a big semicircle in the UHP (exercise: show convergence in this domain of the complex plane) we obtain

$$ I=2 \pi i \sum_{n=0}^{\infty}\text{Res}(f(z),z=z_n) $$ here $z_n=\frac{i\pi}2(2n+1)$. This is easily rewritten as

$$ I=2 \pi i\left(\left(\frac{1}{\pi}\color{blue}{\sum_{n=0}^{\infty}\frac{(-1)^n}{2n+1}}-\frac{2}{\pi^2}\color{red}{\sum_{n=0}^{\infty}\frac{1}{(2n+1)^2}}\right) -\frac{2i}{\pi^2}\color{green}{\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)^2}}\right) $$

since $\color{blue}{\sum_{n=0}^{\infty}\frac{(-1)^n}{2n+1}=\frac{\pi}{4}}$ and $\color{red}{\sum_{n=0}^{\infty}\frac{1}{(2n+1)^2}=\frac{\pi^2}{8}}$ the imaginary parts cancel and we are left with

$$ I= \frac{4}{\pi}\color{green}{\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)^2}}=\frac{4\color{green}{K}}{\pi} $$


Our integral equals

$$ I=\int_{-\infty}^{+\infty}\left(\frac{e^t-1-t}{t^2}\right)\frac{e^t}{e^{2t}+1}\,dt $$ that by exploiting symmetry becomes $$ I = \int_{0}^{+\infty}\frac{e^{t}+e^{-t}-2}{t^2(e^{t}+e^{-t})}\,dt =\int_{0}^{+\infty}\frac{\cosh(t)-1}{t^2\cosh(t)}\,dt$$ The last integral is straightforward to compute trough the residue theorem. Since $$ \text{Res}\left(\frac{\cosh(t)-1}{t^2\cosh(t)},t=\frac{\pi(2k+1)}{2}i\right)= (-1)^{k+1}\frac{4i}{\pi^2(2k+1)^2}$$ we have: $$\boxed{ I = \frac{4}{\pi}\sum_{k\geq 0}\frac{(-1)^k}{(2k+1)^2}=\color{red}{\frac{4G}{\pi}}}$$

as conjectured.


Here is yet another approach. We first note that we can write $\frac{x-1}{\log(x)}$ as

$$\frac{x-1}{\log(x)}=\int_0^1 x^t\,dt$$

Therefore, we can write

$$\begin{align} \int_0^\infty \left(\frac{x-1}{\log^2(x)}-\frac{1}{\log(x)}\right)\frac{1}{1+x^2}\,dx&=\int_0^\infty \int_0^1 \frac{x^t-1}{\log(x)}\,\frac{1}{1+x^2}\,dt\,dx\\\\ &=\int_0^1 \int_0^\infty \frac{x^t-1}{\log(x)}\,\frac{1}{1+x^2}\,dx\,dt\tag1 \end{align}$$

Let $I(t)$ represent the inner integral of the right-hand side of $(1)$. Then, differentiating, we find that

$$\begin{align} I'(t)&=\int_0^\infty \frac{x^t}{1+x^2}\,dx\\\\ &=\frac{\pi}{2\cos(\pi t/2)}\tag 2 \end{align}$$

where I derived the right-hand side of $(2)$ in THIS ANSWER. Alternatively, using real analysis only, we have

$$\begin{align} \int_0^\infty \frac{x^t}{1+x^2}\,dx&=\frac12 B\left(\frac{1+t}{2},\frac{1-t}{2}\right)\\\\ &=\frac12 \Gamma\left(\frac{1+t}{2}\right)\Gamma\left(\frac{1-t}{2}\right)\\\\ &=\frac12\frac{\pi}{\sin\left(\pi\frac{1+t}{2}\right)}\\\\ &=\frac{\pi}{2\cos(\pi t/2)} \end{align}$$

Integrating $(2)$ and using $I(0)=0$ reveals

$$I(t)=\int_0^t \frac{\pi}{2\cos(\pi t'/2)}\,dt' \tag 3$$

Substituting $(3)$ into $(1)$ yields

$$\begin{align} \int_0^\infty \left(\frac{x-1}{\log^2(x)}-\frac{1}{\log(x)}\right)\frac{1}{1+x^2}\,dx&=\frac{\pi}{2}\int_0^1 \int_0^t \sec(\pi t'/2)\,dt'\,dt \tag 4\\\\ &=\frac{\pi}{2}\int_0^1 (1-t)\sec(\pi t/2)\,dt \tag5\\\\ &=\frac{\pi}{2}\int_0^1 t\csc(\pi t/2)\,dt \tag 6\\\\ &=\frac{1}{\pi}\int_{-\pi/2}^{\pi/2}\frac{t}{\sin(t)}\,dt \tag 7\\\\ &=\frac{4G}{\pi} \tag 8 \end{align}$$

as was to be shown!


NOTES:

In going from $(4)$ to $(5)$, we changed the order of integration and carried out the inner integral.

In going from $(5)$ to $(6)$, we enforced the substitution $t \to 1-t$.

In going from $(6)$ to $(7)$, we enforced the substitution $t \to 2t/\pi$ and exploited the evenness of the integrand.

In going from $(7)$ to $(8)$, we made use of one of the integral identities for Catalan's Constant as found HERE.


ALTERNATIVE DEVELOPMENT

Note that we can write $(3)$ as

$$I(t)=\log\left(\cot\left(\frac{\pi}{4}(1-t)\right)\right) \tag 9$$

Then, substituting $(9)$ into $(1)$ yields

$$\begin{align} \int_0^\infty \left(\frac{x-1}{\log^2(x)}-\frac{1}{\log(x)}\right)\frac{1}{1+x^2}\,dx&=\int_0^1 \log\left(\cot\left(\frac{\pi}{4}(1-t)\right)\right)\,dt \\\\ &=\frac{4}{\pi}\int_0^{\pi/4} \log(\cot(t))\,dt \tag 9\\\\ &=\frac{4G}{\pi} \end{align}$$

which uses another well-known integral identity for $G$ as found HERE.

Note that if we enforce the substitution $t\to \text{arccot}(t)$ in $(9)$, we find the result in terms of the series representation of $G$ as

$$\begin{align} \int_0^\infty \left(\frac{x-1}{\log^2(x)}-\frac{1}{\log(x)}\right)\frac{1}{1+x^2}\,dx&=\frac{4}{\pi}\int_0^{\pi/4} \log(\cot(t))\,dt \\\\ &=\frac{4}{\pi}\int_1^{\infty}\frac{\log(t)}{1+t^2}\,dt\\\\ &=-\frac{4}{\pi}\int_0^1 \frac{\log(t)}{1+t^2}\,dt\\\\ &=-\frac{4}{\pi}\sum_{n=0}^\infty(-1)^n \int_0^1 t^{2n}\log(t)\,dt\\\\ &=\frac{4}{\pi}\sum_{n=0}^\infty(-1)^n \int_0^1 \frac{t^{2n}}{2n+1}\,dt\\\\ &=\frac{4}{\pi}\sum_{n=0}^\infty(-1)^n \frac{1}{(2n+1)^2}\\\\ &=\frac{4G}{\pi} \end{align}$$

as expected once again!


Though using the residue method is somewhat straightforward, but not everyone can understand it. So, here is a residue-free method:

Split the integral into two terms where each term is in the interval $0<x<1$ and $1<x<\infty$, then use the substitution $x\mapsto\frac{1}{x}$ to the second term. We will get $$ \left[\int_{0}^{1}+\int_{1}^{\infty}\right]\left(\frac{x-1}{\ln^2 x}-\frac{1}{\ln x}\right)\frac{\mathrm{d}x}{x^2+1}=\int_{0}^{1}\frac{(x-1)^2}{x\ln^2 x}\cdot\frac{\mathrm{d}x}{x^2+1}\tag1 $$ Now, for $a\ge-1$ , one may consider the following integral $$ I(a)=\int_{0}^{1}x^a\cdot\frac{(x-1)^2}{\ln^2 x}\cdot\frac{\mathrm{d}x}{1+x^2}\tag2 $$ and the desired integral is $I(-1)$. Since $0<x<1$, one may observe that $I(\infty)\to0$ as $a\to\infty$. \begin{align} I''(a)&=\int_{0}^{1}\frac{x^a(x-1)^2}{1+x^2}\ \mathrm{d}x\\[10pt] &=\int_{0}^{1}\sum_{k=0}^\infty(-1)^k\ x^{2k+a}\ (x^2-2x+1)\ \mathrm{d}x\\[10pt] &=\sum_{k=0}^\infty(-1)^k\left(\frac{1}{2k+a+3}-\frac{2}{2k+a+2}+\frac{1}{2k+a+1}\right)\\[10pt] &=\frac{1}{4}\left[\psi\left(\frac{a+5}{4}\right)-2\psi\left(\frac{a+4}{4}\right)+2\psi\left(\frac{a+2}{4}\right)-\psi\left(\frac{a+1}{4}\right)\right]\\[10pt] I'(a)&=\ln\Gamma\left(\frac{a+5}{4}\right)-\ln\Gamma\left(\frac{a+1}{4}\right)+2\ln\Gamma\left(\frac{a+2}{4}\right)-2\ln\Gamma\left(\frac{a+4}{4}\right)\\[10pt] I(a)&=4\left[\psi\left(-2,\frac{a+5}{4}\right)-\psi\left(-2,\frac{a+1}{4}\right)+2\psi\left(-2,\frac{a+2}{4}\right)-2\psi\left(-2,\frac{a+4}{4}\right)\right]\tag3\\[10pt] \end{align} Hence $$ I(-1)=4\left[\psi\left(-2,1\right)-\psi\left(-2,0\right)+2\psi\left(-2,\frac{1}{4}\right)-2\psi\left(-2,\frac{3}{4}\right)\right]=\frac{4G}{\pi} $$ Wolfram Alpha confirms it. One may also use the special values of generalized polygamma function and its related relation with derivative of Hurwitz Zeta Function: $$\psi(-2,x)=\zeta'(-1,x)-\frac{x^2}{2}+\frac{x}{2}-\frac{1}{12}$$