# Evaluating $\int_0^1 \log \log \left(\frac{1}{x}\right) \frac{dx}{1+x^2}$

Show that $\displaystyle{\int_0^1 \log \log \left(\frac{1}{x}\right) \frac{dx}{1+x^2} = \frac{\pi}{2}\log \left(\sqrt{2\pi} \Gamma\left(\frac{3}{4}\right) / \Gamma\left(\frac{1}{4}\right)\right)}$

This question was posted as part of this question:

Solve the integral $S_k = (-1)^k \int_0^1 (\log(\sin \pi x))^k dx$

I cannot think of a change of variable nor other integrating methods. May be there is a known method that I am missing.

• @PeterT.off: That isn't true at all. – Eric Naslund Mar 18 '12 at 12:18
• For some variants of this integral see C.J. Malmsten. – Raymond Manzoni Mar 9 '14 at 19:30

By the substitution $x = e^{-t}$, we find that

\begin{align*} \int_{0}^{1} \frac{(\log (1/x))^s}{1+x^2} \; dx &= \int_{0}^{\infty} \frac{t^s e^{-t}}{1 + e^{-2t}} \; dt \\ &= \int_{0}^{\infty} \sum_{n=0}^{\infty} (-1)^n t^s e^{-(2n+1)t} \; dt \\ &= \sum_{n=0}^{\infty} (-1)^n \, \frac{\Gamma(s+1)}{(2n+1)^{s+1}} \\ &= \Gamma(s+1)L(s+1, \chi_4), \end{align*}

where $L(s, \chi_4)$ is the Dirichlet L-function of the unique non-principal character $\chi_4$ to the modulus 4. Often it is denoted as $\beta(s)$ and called the Dirichlet beta function. Thus differentiating both sides with respect to $s$ and plugging $s = 0$, we obtain a representation formula

$$\int_{0}^{1} \frac{\log \log (1/x)}{1+x^2} \; dx = \psi_0(1) \beta(1) + \beta'(1),$$

and the problem reduces to find the value of $\beta(1)$ and $\beta'(1)$. Note that $\beta(1) = \frac{\pi}{4}$ is just the Gregory series. For $\beta'(1)$, we first notice that the following functional equation holds.

$$\beta(s)=\left(\frac{\pi}{2}\right)^{s-1} \Gamma(1-s) \cos \left( \frac{\pi s}{2} \right)\,\beta(1-s).$$

This follows from the general theory of Dirichlet L-functions, and one can consult with any analytic number theory textbook to find its proof. Therefore it is sufficient to calculate $\beta'(0)$. For $0 < s$, we have

\begin{align*} -\beta'(s) &= \sum_{n=1}^{\infty} \left[ \frac{\log(4n+1)}{(4n+1)^s} - \frac{\log(4n-1)}{(4n-1)^s} \right] \\ &= \sum_{n=1}^{\infty} \frac{1}{(4n)^s} \left[ \log \left( \frac{4n+1}{4n-1} \right) - \frac{1}{2n} \right] + 2^{-2s-1}\zeta(s+1) \\ & \qquad + \sum_{n=1}^{\infty} \left( \frac{1}{(4n+1)^s} - \frac{1}{(4n)^s} \right) \log (4n+1) \\ & \qquad + \sum_{n=1}^{\infty} \left( \frac{1}{(4n)^s} - \frac{1}{(4n-1)^s} \right) \log (4n-1) \\ & =: A(s) + 2^{-2s-1}\zeta(s+1) + B(s) + C(s). \end{align*}

We first estimate $B(s)$. As $n \to \infty$, we have

$$\log \left( \frac{4n}{4n+1} \right) = -\frac{1}{4n} + O\left( \frac{1}{n^2} \right), \quad \log \left( \frac{4n}{4n-1} \right) = \frac{1}{4n} + O\left( \frac{1}{n^2} \right).$$

Thus when $s \to 0$,

\begin{align*} B(s) &= \sum_{n=1}^{\infty} \frac{1}{(4n)^s} \left[ \exp\left( s \log \left( \frac{4n}{4n+1} \right) \right) - 1 \right] \left[ \log (4n) - \log \left(\frac{4n}{4n+1} \right) \right] \\ &= \sum_{n=1}^{\infty} \frac{1}{(4n)^s} \left[ - \frac{s}{4n} + O \left(\frac{s^2}{n^2} \right) \right] \left[ \log (4n) + O \left(\frac{1}{n} \right) \right] \\ &= -s 2^{-2s-2} \sum_{n=1}^{\infty} \frac{1}{n^{s+1}} \log (4n) + O(s) \\ &= s 2^{-2s-2} \left[ \zeta'(s+1) - \zeta(s+1) \log 4 \right] + O(s). \end{align*}

Similar consideration also shows that

$$C(s) = s 2^{-2s-2} \left[ \zeta'(s+1) - \zeta(s+1) \log 4 \right] + O(s).$$

Thus we have

$$2^{-2s-1}\zeta(s+1) + B(s) + C(s) = 2^{-2s-1} \left[ \zeta(s+1) + s \zeta'(s+1) - s \zeta(s+1) \log 4 \right] + O(s).$$

But since

$$\zeta(1+s) = \frac{1}{s} + \gamma + O(s),$$

we have

$$\lim_{s\downarrow 0} \left( 2^{-2s-1}\zeta(s+1) + B(s) + C(s) \right) = \frac{\gamma}{2} - \log 2.$$

For $A(s)$, the summands are positive with possible finite exceptional terms. Thus the Monotone Convergence Theorem guarantees that

$$\lim_{s\downarrow 0} A(s) = \sum_{n=1}^{\infty} \left[ \log \left( \frac{4n+1}{4n-1} \right) - \frac{1}{2n} \right].$$

Let $L$ denote this limit. Then by Stirling's formula,

\begin{align*} e^{L} & \stackrel{N\to\infty}{\sim} \prod_{n=1}^{N} \left( \frac{4n+1}{4n-1} \right) e^{-1/2n} \sim \frac{e^{-\gamma/2}}{\sqrt{N}} \prod_{n=1}^{N} \left( \frac{n+(1/4)}{n-(1/4)} \right) \\ & \sim \frac{e^{-\gamma/2}}{\sqrt{N}} \frac{\Gamma\left(\frac{3}{4}\right)}{\Gamma\left(\frac{5}{4}\right)} \frac{\Gamma\left(N+\frac{5}{4}\right)}{\Gamma\left(N+\frac{3}{4}\right)} \sim \frac{e^{-\gamma/2}}{\sqrt{N}} \frac{\Gamma\left(\frac{3}{4}\right)}{\Gamma\left(\frac{5}{4}\right)} \frac{\left( \frac{N + (5/4)}{e} \right)^{N+\frac{5}{4}}}{\left( \frac{N + (3/4)}{e} \right)^{N+\frac{3}{4}}} \\ & \sim e^{-\gamma/2} \frac{\Gamma\left(\frac{3}{4}\right)}{\Gamma\left(\frac{5}{4}\right)} = 4 e^{-\gamma/2} \frac{\pi \sqrt{2}}{\Gamma\left(\frac{1}{4}\right)^2}, \end{align*}

where we have used the Euler's reflection formula in the last line. Combining all the efforts, we obtain

$$-\beta'(0) = \log (2 \pi \sqrt{2}) - 2 \log \Gamma\left(\frac{1}{4}\right) .$$

Now taking logarithmic differntiation to the functional equation, we have

$$\frac{\beta'(s)}{\beta(s)} = \log\left(\frac{\pi}{2}\right) - \psi_0 (1-s) - \frac{\pi}{2} \tan \left( \frac{\pi s}{2} \right) - \frac{\beta'(1-s)}{\beta(1-s)}.$$

Taking $s = 0$, we have

$$\frac{\beta'(0)}{\beta(0)} = \log\left(\frac{\pi}{2}\right) + \gamma - \frac{\beta'(1)}{\beta(1)} \quad \Longrightarrow \quad \beta'(1) = \beta(1) \left[ \log\left(\frac{\pi}{2}\right) + \gamma - \frac{\beta'(0)}{\beta(0)} \right].$$

But again by the functional equation, we have $\beta(0) = \frac{1}{2}$. Therefore

$$\beta'(1) = \frac{\pi}{4} \left[ \gamma + 2 \log 2 + 3 \log \pi - 4 \log \Gamma\left(\frac{1}{4}\right) \right],$$

and hence

$$\int_{0}^{1} \frac{\log \log (1/x)}{1+x^2} \; dx = \frac{\pi}{4} \left[ 2 \log 2 + 3 \log \pi - 4 \log \Gamma\left(\frac{1}{4}\right) \right],$$

which is identical to the proposed answer.

• Excellent answer. I was trying to figure out how to evaluate $\beta^'(1)$, but couldn't get very far. – Eric Naslund Mar 18 '12 at 12:18
• Ahhh, a small typo. Each of the zeta terms should be of the form $\zeta(s+1)$, specifically it should be $2^{-2s-1}\zeta(s+1)$ instead of $2^{-2s-1}\zeta(s)$. Otherwise in the line where you take $s\rightarrow 0$, the pole from $s\zeta^'(s+1)$ will not cancel out with anything. ($\zeta^'(s+1)$ has a double pole) – Eric Naslund Mar 18 '12 at 12:29
• @EricNaslund, thanks for pointing out typos! I will fix it right now. – Sangchul Lee Mar 18 '12 at 12:32
• @sos440, I just wanted to add, this is one of my favorite proofs I have read so far on Math Stack Exchange. – Eric Naslund Apr 14 '12 at 9:33
• This is nuts, man. – Pedro Tamaroff Oct 21 '12 at 18:49

$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle #1 \right\rangle} \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace} \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left( #1 \right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$ $\ds{\int_{0}^{1}\ln\pars{\ln\pars{1 \over x}}\,{\dd x \over 1 + x^{2}} ={\pi \over 2}\,\ln\pars{\root{\vphantom{\large A}2\pi}\, {\Gamma\pars{3/4} \over \Gamma\pars{1/4}}}:\ {\Large ?}}$

With $\ds{x \to 1/x}$: $$\color{#f00}{\int_{0}^{1}\ln\pars{\ln\pars{1 \over x}}\,{\dd x \over 1 + x^{2}}}= \int_{\infty}^{1}\ln\pars{\ln\pars{x}}\,\pars{-\,{\dd x/x^{2} \over 1 + 1/x^{2}}} =\int_{1}^{\infty}{\ln\pars{\ln\pars{x}} \over 1 + x^{2}}\,\dd x$$

With $x \equiv \expo{t}\quad\iff\quad t = \ln\pars{x}$: \begin{align} &\color{#f00}{\int_{0}^{1}\ln\pars{\ln\pars{1 \over x}}\,{\dd x \over 1 + x^{2}}}= \int_{0}^{\infty}{\ln\pars{t} \over 1 + \expo{2t}}\,\expo{t}\dd t =\int_{0}^{\infty}\ln\pars{t}\expo{-t}\,{1 \over 1 + \expo{-2t}}\,\dd t \\[3mm]&=\int_{0}^{\infty}\ln\pars{t}\expo{-t}\, \sum_{\ell = 0}^{\infty}\pars{-1}^{\ell}\expo{-2\ell t}\,\dd t =\sum_{\ell = 0}^{\infty}\pars{-1}^{\ell}\lim_{\mu \to 0}\partiald{}{\mu}\bracks{% \int_{0}^{\infty}t^{\mu}\expo{-\pars{2\ell + 1}t}\,\dd t} \\[3mm]&=\sum_{\ell = 0}^{\infty}\pars{-1}^{\ell}\lim_{\mu \to 0}\partiald{}{\mu}\bracks{% {1 \over \pars{2\ell + 1}^{\mu + 1}}\ \overbrace{\int_{0}^{\infty}t^{\mu}\expo{-t}\,\dd t}^{\ds{\Gamma\pars{\mu + 1}}}\ } \end{align} where $\Gamma\pars{z}$ is the Gamma Function.

\begin{align} &\color{#f00}{\int_{0}^{1}\ln\pars{\ln\pars{1 \over x}}\,{\dd x \over 1 + x^{2}}}= \sum_{\ell = 0}^{\infty}\pars{-1}^{\ell}\lim_{\mu \to 0}\partiald{}{\mu}\bracks{% {\Gamma\pars{\mu + 1} \over \pars{2\ell + 1}^{\mu + 1}}} \\[3mm]&= \lim_{\mu \to 0}\partiald{}{\mu}\bracks{% \Gamma\pars{\mu + 1}\sum_{\ell = 0}^{\infty} {\pars{-1}^{\ell}\over \pars{2\ell + 1}^{\mu + 1}}} \\[3mm]&= \lim_{\mu \to 0}\braces{% \Gamma'\pars{\mu + 1}\sum_{\ell = 0}^{\infty} {\pars{-1}^{\ell}\over \pars{2\ell + 1}^{\mu + 1}} +\Gamma\pars{\mu + 1}\partiald{}{\mu}\bracks{% \sum_{\ell = 0}^{\infty}{\pars{-1}^{\ell}\over \pars{2\ell + 1}^{\mu + 1}}}} \\[3mm]&=-\gamma\sum_{\ell = 0}^{\infty}{\pars{-1}^{\ell}\over 2\ell + 1} + \lim_{\mu \to 0}\partiald{}{\mu} \sum_{\ell = 0}^{\infty}{\pars{-1}^{\ell}\over \pars{2\ell + 1}^{\mu + 1}}\tag{1} \end{align} In this result, we used $\Psi\pars{1} = -\gamma$ and $\Gamma\pars{1} = 1$ where $\Psi\pars{z} \equiv \dd\ln\Gamma\pars{z}/\dd z$ is the Digamma Function and $\gamma$ is the Euler-Mascheroni constant.

The first $\ell$-sum in the right member of $\pars{1}$ is given by: \begin{align} &\sum_{\ell = 0}{\pars{-}^{\ell} \over 2\ell + 1}= \sum_{\ell = 0}\pars{{1 \over 4\ell + 1} - {1 \over 4\ell + 3}} ={1 \over 8}\sum_{\ell = 0}{1 \over \pars{\ell + 1/4}\pars{\ell + 3/4}} \\[3mm]&=-\,{1 \over 4}\bracks{\Psi\pars{1 \over 4} - \Psi\pars{3 \over 4}} = {\pi \over 4} \end{align} where we used the identities: \begin{align} \sum_{\ell = 0}^{\infty}{1 \over \pars{\ell + z_{0}}\pars{\ell + z_{1}}} &={\Psi\pars{z_{0}} - \Psi\pars{z_{1}} \over z_{0} - z_{1}}\tag{1.1} \\[3mm]\Psi\pars{z} - \Psi\pars{1 - z} &= -\pi\cot\pars{\pi z}\tag{1.2} \end{align} $$\mbox{Then,}\quad \color{#f00}{\int_{0}^{1}\ln\pars{\ln\pars{1 \over x}}\,{\dd x \over 1 + x^{2}}}= -\,{1 \over 4}\,\gamma\pi + \lim_{\mu \to 0}\partiald{}{\mu} \sum_{\ell = 0}^{\infty}{\pars{-1}^{\ell}\over \pars{2\ell + 1}^{\mu + 1}}\tag{2}$$ Also, \begin{align} \sum_{\ell = 0}^{\infty}{\pars{-1}^{\ell}\over \pars{2\ell + 1}^{\mu + 1}} &=\sum_{\ell = 0}^{\infty}{1 \over \bracks{2\pars{2\ell} + 1}^{\mu + 1}} -\sum_{\ell = 0}^{\infty}{1 \over \bracks{2\pars{2\ell + 1} + 1}^{\mu + 1}} \\[3mm]&=2^{-2\mu - 2}\bracks{% \sum_{\ell = 0}^{\infty}{1 \over \pars{\ell + 1/4}^{\mu + 1}} -\sum_{\ell = 0}^{\infty}{1 \over \pars{\ell + 3/4}^{\mu + 1}}} \\[3mm]&=2^{-2\mu - 2}\bracks{% \zeta\pars{\mu + 1,{1 \over 4}} - \zeta\pars{\mu + 1,{3 \over 4}}} \end{align} where $\ds{\zeta\pars{s,q} \equiv \sum_{n = 0}^{\infty}{1 \over \pars{q + n}^{s}}}$ with $\Re\pars{s} > 1$ and $\Re\pars{q} > 0$ i s the Hurwitz Zeta Function or/and Generalizated Zeta Funcion .

So, \begin{align} &\lim_{\mu \to 0}\partiald{}{\mu}\sum_{\ell = 0}^{\infty}{\pars{-1}^{\ell}\over \pars{2\ell + 1}^{\mu + 1}} \\[3mm]&=-\,{1 \over 4}\,\ln\pars{2}\ \underbrace{\overbrace{\sum_{\ell = 0}^{\infty}{1 \over \pars{\ell + 3/4}\pars{\ell + 1/4}}} ^{\ds{2\bracks{\Psi\pars{3/4} - \Psi\pars{1/4}} = 2\pi}}} _{\ds{\mbox{See}\ \pars{1.1}\ \mbox{and}\ \pars{1.2}}} +\ {1 \over 4}\ \overbrace{\partiald{}{\mu}\bracks{% \zeta\pars{\mu,{1 \over 4}} - \zeta\pars{\mu,{3 \over 4}}}_{\mu\ =\ 1}} ^{\ds{-\gamma_{1}\pars{1/4} + \gamma_{1}\pars{3/4}}} \end{align} where $\gamma_{n}\pars{z}$ is a Generalizated Stieltjes Constant .

With this result, $\pars{2}$ is reduced to: \begin{align} \color{#f00}{\int_{0}^{1}\ln\pars{\ln\pars{1 \over x}}\,{\dd x \over 1 + x^{2}}} &=-\,{1 \over 4}\,\braces{% \pi\bracks{% \gamma + 2\ln\pars{2}} + \gamma_{1}\pars{1 \over 4} - \gamma_{1}\pars{3 \over 4}} \tag{3} \end{align} The difference $\gamma_{1}\pars{1/4} - \gamma_{1}\pars{3/4}$ is evaluated with the 1846 Carl Malmsten identity : $$\gamma_{1}\pars{m \over n} - \gamma_{1}\pars{1 - {m \over n}} =-\pi\bracks{\gamma + \ln\pars{2\pi n}}\cot\pars{m\pi \over n} + 2\pi\sum_{\ell = 1}^{n - 1} \sin\pars{{2\pi m \over n}\,\ell}\ln\pars{\Gamma\pars{\ell \over n}}$$

With $m = 1$ and $n = 4$: \begin{align} &\gamma_{1}\pars{1 \over 4} - \gamma_{1}\pars{3 \over 4} \\[3mm]&=-\pi\bracks{\gamma + \ln\pars{8\pi}}\cot\pars{\pi \over 4} + 2\pi\sum_{\ell = 1}^{3}\sin\pars{\pi\,\ell \over 2} \ln\pars{\Gamma\pars{\ell \over 4}} \\[3mm]&=-\pi\bracks{\gamma + 2\ln\pars{2} + \ln\pars{2\pi}} \\[3mm]&\phantom{=} + 2\pi\bracks{\sin\pars{\pi \over 2}\ln\pars{\Gamma\pars{1 \over 4}} + \sin\pars{\pi}\ln\pars{\Gamma\pars{1 \over 2}} + \sin\pars{3\pi \over 2}\Gamma\pars{3 \over 4}} \\[3mm]&=-\pi\bracks{\gamma + 2\ln\pars{2} + \ln\pars{2\pi}} +2\pi\bracks{\ln\pars{\Gamma\pars{1 \over 4}} - \ln\pars{\Gamma\pars{3 \over 4}}} \\[3mm]&=-\pi\bracks{\gamma + 2\ln\pars{2}} - 2\pi\bracks{% \ln\pars{\root{2\pi}} +\ln\pars{\Gamma\pars{3 \over 4} \over \Gamma\pars{1 \over 4}}} \\[3mm]&=-\pi\bracks{\gamma + 2\ln\pars{2}} -2\pi\ln\pars{\root{2\pi}\,{\Gamma\pars{3 \over 4} \over \Gamma\pars{1 \over 4}}} \end{align}

By replacing this result in $\pars{3}$, we find: $$\color{#00f}{\large% \int_{0}^{1}\ln\pars{\ln\pars{1 \over x}}\,{\dd x \over 1 + x^{2}} ={\pi \over 2}\,\ln\pars{\root{\vphantom{\large A}2\pi}\, {\Gamma\pars{3/4} \over \Gamma\pars{1/4}}}}$$

As an 'extra-bonus' we can use the identity $\ds{\Gamma\pars{z} = {\pi \over \Gamma\pars{1 - z}\sin\pars{\pi z}}}$ to 'kill' one of the $\Gamma\,$'s functions: $\ds{\Gamma\pars{1 \over 4} = {\root{2}\pi \over \Gamma\pars{3/4}}}$ which yields: $$\int_{0}^{1}\ln\pars{\ln\pars{1 \over x}}\,{\dd x \over 1 + x^{2}} ={\pi \over 2}\,\ln\pars{\Gamma^{\,2}\pars{3/4} \over \root{\pi}}$$

See also V. Adamchik's formula $$\int_0^1 \frac{x^{p-1}}{1+x^n}\log \log \frac{1}{x}dx = \frac{\gamma+\log(2n)}{2n}(\psi(\frac{p}{2n})-\psi(\frac{n+p}{2n}))+\frac{1}{2n}(\zeta'(1,\frac{p}{2n})-\zeta'(1,\frac{n+p}{2n}))$$ in http://dx.doi.org/10.1145/258726.258736 .

The above integral was long-time known as the Vardi's integral. Quite recently, an interesting research work devoted to this integral was published by Iaroslav Blagouchine. It appears that this integral was first evaluated by Carl Malmsten in 1842 (and not by Ilan Vardi in 1988). Blagouchine describes two different methods for its evaluation: the original Malmsten's method and the contour integration method. In the same paper, numerous integrals similar to the above one are also treated, and it is shown that many of them may be evaluated by the contour integration methods.

More recent paper by Blagouchine (mentioned above in the context of Malmsten's formula derived in 1846) is also integersting, but it is less directly related to the integral in question than the first one.