# How to find ${\large\int}_1^\infty\frac{1-x+\ln x}{x \left(1+x^2\right) \ln^2 x} \mathrm dx$? [closed]

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.

• I feel like it's becoming a trend to ask questions about practically impossible integrals... – Shahar Aug 22 '14 at 1:41
• Hint: Consider the integral $~J(n)=\displaystyle\int_1^\infty\frac{1-x+\ln x}{x\left(1+x^2\right)}x^n~dx$, and notice that $I=J^{^{(-2)}}(0)$. With or without the substitution $x=\dfrac1t$ , express this integral as a linear combination of the polygamma functions $\psi_{_0}$ and $\psi_{_1}$ whose arguments are linear expressions in n. – Lucian Aug 22 '14 at 6:43
• Which book did you find this question in ? – Saikat Jul 7 '16 at 6:41
• Why try to close this beautiful topic. What happens here? – Michael Rozenberg Jul 23 '19 at 8:08
• Delete voters, would this site really be better off without this question and its answers? – Gerry Myerson Aug 8 '19 at 23:26

Here is another Feynman's way to evaluate the integral. Set $x=\frac1t$, then $$\int_1^\infty\frac{1-x+\ln x}{x \left(1+x^2\right) \ln^2 x}\ dx=\int_0^1\frac{t-1-t\ln t}{(1+t^2)\ln^2t}\ dt.$$ Now consider $$\mathcal{I}(\alpha)=\int_0^1t^\alpha\cdot\frac{t-1-t\ln t}{(1+t^2)\ln^2t}\ dt.$$ Hence \begin{align} \frac{d^2\mathcal{I}}{d\alpha^2}&=\int_0^1\frac{t^\alpha}{1+t^2}(t-1-t\ln t)\ dt\\ &=\int_0^1\sum_{n=0}^\infty(-1)^nt^{2n+\alpha}(t-1-t\ln t)\ dt\\ &=\sum_{n=0}^\infty(-1)^n\int_0^1\left(t^{2n+\alpha+1}-t^{2n+\alpha}-t^{2n+\alpha+1}\ln t\right)\ dt\tag1\\ &=\sum_{n=0}^\infty(-1)^n\left[\frac{1}{2n+\alpha+2}-\frac{1}{2n+\alpha+1}+\frac{1}{(2n+\alpha+2)^2}\right]\tag2\\ &=-\frac14\left[\psi\left(\frac{\alpha+2}{4}\right)-\psi\left(\frac{\alpha+4}{4}\right)\right]+\frac14\left[\psi\left(\frac{\alpha+1}{4}\right)-\psi\left(\frac{\alpha+3}{4}\right)\right]\\ &\quad+\frac1{16}\left[\psi_1\left(\frac{\alpha+2}{4}\right)-\psi_1\left(\frac{\alpha+4}{4}\right)\right]\tag3\\ \frac{d\mathcal{I}}{d\alpha}&=-\ln\Gamma\left(\frac{\alpha+2}{4}\right)+\ln\Gamma\left(\frac{\alpha+4}{4}\right)+\ln\Gamma\left(\frac{\alpha+1}{4}\right)-\ln\Gamma\left(\frac{\alpha+3}{4}\right)\\ &\quad+\frac14\left[\psi\left(\frac{\alpha+2}{4}\right)-\psi\left(\frac{\alpha+4}{4}\right)\right]\tag4\\ &=\ln\Gamma\left[\frac{(\alpha+1)(\alpha+4)}{(\alpha+2)(\alpha+3)}\right]+\frac14\left[\psi\left(\frac{\alpha+2}{4}\right)-\psi\left(\frac{\alpha+4}{4}\right)\right]\tag5\\ \mathcal{I}(\alpha)&=\int\ln\Gamma\left[\frac{(\alpha+1)(\alpha+4)}{(\alpha+2)(\alpha+3)}\right]\ d\alpha+\ln\Gamma\left(\frac{\alpha+2}{4}\right)-\ln\Gamma\left(\frac{\alpha+4}{4}\right). \end{align} Since $0<t<1$, then as $\alpha\to\infty$, implying $\mathcal{I}(\alpha)\to0$ and $\mathcal{I}'(\alpha)\to0$. Thus

$$\mathcal{I}(0)=\int_1^\infty\frac{1-x+\ln x}{x \left(1+x^2\right) \ln^2 x}\ dx=\color{blue}{\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.

Notes :

$\displaystyle(1)\ \ \int_0^1 x^\alpha \ln^n x\ dx=\frac{(-1)^n n!}{(\alpha+1)^{n+1}}, \qquad\text{for }\ n=0,1,2,\ldots$

$\displaystyle(2)\ \ \sum_{k=0}^\infty\frac{(-1)^{k}}{(z+k)^{m+1}}=\frac1{(-2)^{m+1}m!}\left[\psi_{m}\left(\frac{z}{2}\right)-\psi_{m}\left(\frac{z+1}{2}\right)\right]$

$\displaystyle(3)\ \ \psi_{m}(z) := \frac{d^m}{dz^m} \psi(z) = \frac{d^{m+1}}{dz^{m+1}} \ln\Gamma(z)$

$\qquad$where $\text{G}(\cdot)$ is the Barnes G-function and $C$ is a constant of integration. Also for $a,b>0$ $$\int\ln\Gamma\left(\frac{x+a}{b}\right)\ dx=b\ \psi^{(-2)}\left(\frac{x+a}{b}\right)+C.$$

$\displaystyle(5)\ \$As $\alpha\to\infty$, both of sides tend to $0$, hence the constant of integration is $0$.

$$I=\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.

• Could you explain how to arrive to this beautiful result ? – Claude Leibovici Aug 22 '14 at 5:45
• I had a look at some of your answers to tough integrals. From your profile it looks you are somewhat inspired by Ramanujan's style of giving results without proof. The sad part is that Ramanujan did not have bare minimum finance to get paper to write his proofs. If he had the luxury of publishing then may be he would have written a much better masterpiece than Berndt's Ramanujan's Notebooks. Ramanujan's once said "I don't want my methods to die with me" and sadly it has been true to some extent. I don't see any purpose served in not showing your methods. – Paramanand Singh Aug 23 '14 at 17:14
• Stop whining about her terse style please. She has her reasons for that. – Jostein Trondal Mar 15 '15 at 14:30
• @ParamanandSingh Her profile mentions she has a medical condition that prevents her from elaborating. I'm guessing she's forced to use a gaze tracker and virtual keyboard. I encourage you to try writing a long proof at ten characters per minute sometime. – Zaaier Oct 9 '15 at 20:23
• @Zaaier: when I wrote my comment her profile had no mention about her medical condition. – Paramanand Singh Oct 10 '15 at 2:51

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.$$

• This is a good and nice answer ! Thanks. – Claude Leibovici Aug 22 '14 at 10:15
• @ClaudeLeibovici Thank you for the kind words. – Olivier Oloa Aug 22 '14 at 10:22
• Be sure that my words are not kind ! They are just sincere. What you gave us here is an answer and not just a result. "Dont give a child a fish but show him how to fish” said Mao Tse-tung. – Claude Leibovici Aug 22 '14 at 10:26
• This was my favourite answer thanks to your detailed exposition. – Saikat Jul 7 '16 at 6:51


In this answer, I'll show a $\ds{\ \ul{quite\ short\ path} }$ to an integration in terms of $\ds{\ \ul{just\ a\ pair}\ }$ of Digamma's functions.

Sooner or later, I'll need the following integral:

\begin{align} &\begin{array}{|c|}\hline\\ \ds{\quad\left.\int_{0}^{1}{x^{t} \over 1 + x^{2}}\,\dd x\, \right\vert_{\ \Re\pars{t}\ >\ -1}\quad} \\ \\ \hline \end{array} = \int_{0}^{1}{x^{t} - x^{t + 2} \over 1 - x^{4}}\,\dd x \\[3mm] = &\ {1 \over 4}\int_{0}^{1}{x^{\pars{t - 3}/4} - x^{\pars{t - 1}/4} \over 1 - x}\,\dd x = {1 \over 4}\bracks{\int_{0}^{1}{1 - x^{\pars{t - 1}/4} \over 1 - x}\,\dd x - \int_{0}^{1}{1 - x^{\pars{t - 3}/4} \over 1 - x}\,\dd x} \\[3mm] = &\ \begin{array}{|c|}\hline \\ \ds{\quad{1 \over 4}\bracks{% \Psi\pars{t + 3 \over 4} - \Psi\pars{t + 1 \over 4}}\quad} \\ \\ \hline \end{array}\tag{1} \\& \end{align} where $\ds{\Psi}$ is the Digamma Function and we used the standard integral representation of it. Namely, $\ds{\left.\vphantom{\huge A}\Psi\pars{z}\,\right\vert_{\ \Re\pars{z}\ >\ 0}\ =\ -\gamma + \int_{0}^{1}{1 - t^{z - 1} \over 1 - t}\,\dd t.\ }$ $\ds{\gamma}$ is the Euler-Mascheroni Constant.

\begin{align} \color{#f00}{I} & \equiv \int_{1}^{\infty}{1 - x + \ln\pars{x} \over x \pars{1 + x^{2}}\ln^{2}\pars{x}} \,\dd x\ \stackrel{x\ \mapsto\ 1/x}{=}\ \int_{0}^{1}{x - 1 - x\ln\pars{x} \over \pars{1 + x^{2}}\ln^{2}\pars{x}}\,\dd x \\[3mm] & = -\int_{0}^{1}\underbrace{% \bracks{{x \over \ln\pars{x}} + {1 - x \over \ln^{2}\pars{x}}}} _{\ds{\vphantom{\Large A}\color{#f00}{?}}}\ \,{\dd x \over 1 + x^{2}}\tag{2} \end{align}

$$\mbox{Note that}\quad\ \overbrace{{x \over \ln\pars{x}} + {1 - x \over \ln^{2}\pars{x}}} ^{\ds{\color{#f00}{\vphantom{\Large A}?}}}\ =\ \int_{0}^{1}t\,x^{t}\,\dd t\tag{3}$$ This identity can be straightforward derived by performing two successive integration by parts with the identity $\ds{x^{t} = {1 \over \ln\pars{x}}\,\partiald{x^{t}}{t}}$

By replacing $\pars{3}$ in $\pars{2}$: \begin{align} \color{#f00}{I} & = -\int_{0}^{1}t\int_{0}^{1}{x^{t} \over 1 + x^{2}}\,\dd x\,\dd t = -\,{1 \over 4}\int_{0}^{1}t\bracks{\Psi\pars{t + 3 \over 4} - \Psi\pars{t + 1 \over 4}}\,\dd t\quad \pars{~\mbox{see}\ \pars{1}~} \\[3mm] & = -\,{1 \over 4}\int_{0}^{1}t\,\partiald{}{t} \ln\pars{\Gamma^{\,4}\pars{\bracks{t + 3}/4} \over \Gamma^{\,4}\pars{\bracks{t + 1}/4}}\,\dd t \\[3mm] & = -\,{1 \over 4} \ln\pars{\Gamma^{\,4}\pars{1} \over \Gamma^{\,4}\pars{1/2}} + \int_{0}^{1}\ln\pars{\Gamma\pars{t + 3 \over 4}}\,\dd t - \int_{0}^{1}\ln\pars{\Gamma\pars{t + 1 \over 4}}\,\dd t \\[3mm] & = \half\,\ln\pars{\pi} + 4\int_{-1/4}^{0}\ln\pars{\Gamma\pars{t + 1}}\,\dd t - 4\int_{-3/4}^{-1/2}\ln\pars{\Gamma\pars{t + 1}}\,\dd t \\[8mm] & = \half\,\ln\pars{\pi} \\[3mm] & - 4\int_{0}^{-1/4}\ln\pars{\Gamma\pars{t + 1}}\,\dd t - 4\int_{0}^{-1/2}\ln\pars{\Gamma\pars{t + 1}}\,\dd t + 4\int_{0}^{-3/4}\ln\pars{\Gamma\pars{t + 1}}\,\dd t\tag{4} \end{align} I'll use the well know identity ( $\ds{\mathrm{G}}$ is the Barnes $\mathrm{G}$-Function or/and Double Gamma Function  ) \begin{align} &\int_{0}^{z}\ln\pars{\Gamma\pars{t + 1}}\,\dd t \\[3mm] = &\ \half\,z\ln\pars{2\pi} - \half\,z\pars{z + 1} + z\ln\pars{\Gamma\pars{z + 1}} - \ln\pars{\mathrm{G}\pars{z + 1}} \end{align} which, for $\ds{\ul{z \in \mathbb{R}}}$, is conveniently written as $$\int_{0}^{z}\ln\pars{\Gamma\pars{t + 1}}\,\dd t = \half\,z\ln\pars{2\pi} - \ln\pars{\exp\pars{z\pars{z + 1} \over 2} \Gamma^{\, -z}\pars{z + 1}\,\mathrm{G}\pars{z + 1}}$$ It leads to explicit expressions for the integrals in $\ds{\pars{4}}$: $$\left\lbrace\begin{array}{rcl} \ds{\int_{0}^{-1/4}\ln\pars{\Gamma\pars{t + 1}}\,\dd t} & \ds{=} & \ds{-\,{1 \over 8}\,\ln\pars{2\pi} - \ln\pars{\expo{-3/32}\ \Gamma^{1/4}\pars{3 \over 4}\mathrm{G}\pars{3 \over 4}}} \\[3mm] \ds{\int_{0}^{-1/2}\ln\pars{\Gamma\pars{t + 1}}\,\dd t} & \ds{=} & \ds{-\,{1 \over 4}\,\ln\pars{2\pi} - \ln\pars{\expo{-1/8}\ \Gamma^{1/2}\pars{\half}\mathrm{G}\pars{\half}}} \\[3mm] \ds{\int_{0}^{-3/4}\ln\pars{\Gamma\pars{t + 1}}\,\dd t} & \ds{=} & \ds{-\,{3 \over 8}\,\ln\pars{2\pi} - \ln\pars{\expo{-3/32}\ \Gamma^{3/4}\pars{1 \over 4}\mathrm{G}\pars{1 \over 4}}} \end{array}\right.\tag{5}$$ Fortunately, in terms of the Glaisher-Kinkelin Constant $\ds{A}$ and the Catalan Constant $\ds{K}$, the above $\ds{\ul{\ln\mbox{-arguments}}}$ are given in the MathWorld G-Barnes Function page as formulas $\ds{\pars{17}}$, $\ds{\pars{19}}$ and $\ds{\vphantom{\Large A}\pars{16}}$, respectively: \begin{align} \left\lbrace\begin{array}{rcl} \ds{\expo{-3/32}\ \Gamma^{1/4}\pars{3 \over 4}\mathrm{G}\pars{3 \over 4}} & \ds{=} & \ds{A^{-9/8}\ \expo{K/\pars{4\pi}}} \\[3mm] \ds{\expo{-1/8}\ \Gamma^{1/2}\pars{\half}\mathrm{G}\pars{\half}} & \ds{=} & \ds{A^{-3/2\,\,2^{1/24}}} \\[3mm] \ds{\expo{-3/32}\ \Gamma^{3/4}\pars{1 \over 4}\mathrm{G}\pars{1 \over 4}} & \ds{=} & \ds{A^{-9/8}\ \expo{-K/\pars{4\pi}}} \end{array}\right. \end{align} The integrals in expressions $\ds{\pars{5}}$ become: $$\left\lbrace\begin{array}{rcl} \ds{\int_{0}^{-1/4}\ln\pars{\Gamma\pars{t + 1}}\,\dd t} & \ds{=} & \ds{-\,{1 \over 8}\,\ln\pars{2\pi} + {9 \over 8}\,\ln\pars{A} - {K \over 4\pi} \approx -0.0228} \\[3mm] \ds{\int_{0}^{-1/2}\ln\pars{\Gamma\pars{t + 1}}\,\dd t} & \ds{=} & \ds{-\,{1 \over 4}\,\ln\pars{2\pi} + {3 \over 2}\,\ln\pars{A} - {1 \over 24}\,\ln\pars{2} \approx -0.1152} \\[3mm] \ds{\int_{0}^{-3/4}\ln\pars{\Gamma\pars{t + 1}}\,\dd t} & \ds{=} & \ds{-\,{3 \over 8}\,\ln\pars{2\pi} + {9 \over 8}\,\ln\pars{A} + {K \over 4\pi} \approx -0.3365} \end{array}\right.\tag{6}$$
The final result is given by inserting these expressions into result $\ds{\pars{4}}$: $$\begin{array}{|c|}\hline\ \\ \ds{\quad\color{#f00}{I} = \int_{1}^{\infty}{1 - x + \ln\pars{x} \over x\pars{1 + x^{2}}\ln^{2}\pars{x}}\,\dd x = \color{#f00}{% {2K \over \pi} - 6\ln\pars{A} + \half\,\ln\pars{\pi} + {1 \over 6}\,\ln\pars{2}} \approx -0.2215\quad} \\ \ \\ \hline \end{array}$$