# A daunting double integral with a simple closed form

In the following, I'll present a curious double integral that despite its daunting look has a very nice closed form,

$$\int _0^{\pi/2}\int _0^{\pi/2}\cot (x) \csc ^2(y) \log (\cos (y)) \log \left(1-2 \sin (x)+\sin ^2(x) \csc ^2(y)\right)\textrm{d}x \textrm{d}y$$ $$=\frac{\pi^3}{6}-\pi.$$

The integral was recently proposed by C. I. Valean. He exploited a new double integral representation of the Dilogarithm he recently derived and presented in The Dilogarithm: A New Representation in Terms of a Double Integral. The solution flow (in large steps) is as follows:

Exploiting that $$\displaystyle \operatorname{Li}_2(u)=-\frac{1}{\pi}\int _0^{\pi/2}\int _0^{\pi/2}\frac{(1-u)\log \left(1-2 \sin (x)+ \csc ^2(y) \sin ^2(x)\right)}{\tan (x) \left(\cos ^2(y)+(1-u)^2 \sin ^2(y)\right)}\textrm{d}x \textrm{d}y, \ u<1$$, if we multiply both sides by $$\pi$$ and then integrate from $$u=0$$ to $$u=1$$, we have $$\small \int _0^{\pi/2}\left(\int _0^{\pi/2}\cot(x)\log \left(1-2 \sin (x)+ \csc ^2(y) \sin ^2(x)\right)\left(-\int_0^1\frac{(1-u)}{\cos ^2(y)+(1-u)^2 \sin ^2(y)}\textrm{d}u\right)\textrm{d}x\right)\textrm{d}y$$ $$\small =\frac{1}{2}\int _0^{\pi/2}\left(\int _0^{\pi/2}\cot(x)\log \left(1-2 \sin (x)+ \csc ^2(y) \sin ^2(x)\right)\csc^2(y) \log(\cos^2(y)+(1-u)^2 \sin^2(y)\biggr|_{u=0}^{u=1}\textrm{d}x\right)\textrm{d}y$$ $$\small =\int _0^{\pi/2}\left(\int _0^{\pi/2}\cot (x) \csc ^2(y) \log (\cos (y)) \log \left(1-2 \sin (x)+\sin ^2(x) \csc ^2(y)\right)\textrm{d}x\right)\textrm{d}y$$ $$=\pi \int_0^1 \operatorname{Li}_2(u) \textrm{d}u=\pi \int_0^1 u' \operatorname{Li}_2(u) \textrm{d}u=\pi \underbrace{u\operatorname{Li}_2(u)\biggr|_{u=0}^{u=1}}_{\displaystyle \pi^2/6} +\pi \underbrace{\int_0^1 \log(1-u)\textrm{d}u}_{\displaystyle -1}$$ $$=\frac{\pi^3}{6}-\pi.$$ I would enjoy a lot to see different approaches (possibly without using the Dilogarithm). Given the simplicity of the closed form one might be tempted to ponder over the possibility of getting other elegant ways of performing the calculations.

EDIT_1: Cornel says the double integral representation of $$\operatorname{Li}_2$$ exploited in the solution can be reduced to the following (fascinating) integral in one variable:

$$\operatorname{Li}_2(u)=\frac{\pi ^2}{6}-\frac{1}{\pi }\int_0^{\pi/2} \arctan((1-u) \tan (x)) (\pi+2 \cot (x) \log (\cot (x))) \operatorname{d}x,$$ which, if you ask me, looks too beautiful to be true (how can such a beautiful thing exist?). The solution is straightforward at this point if we differentiate with respect to $$u$$.

EDIT_2: The transformation from the double integral representation of $$\operatorname{Li}_2$$ to the single integral representation above takes place by proving and using that

$$\int _0^{\pi/2}\cot (x) \log \left(1-2 \sin (x)+\sin ^2(x) \csc ^2(y)\right)\textrm{d}x$$ $$=-\frac{\pi ^2}{3}+\int_y^{\pi/2} (\pi +2 \cot (x) \log (\cot (x)) ) \textrm{d}x,$$

and at the same time, this fact can also be employed separately and directly to the main integral to get a second solution.

EDIT_3: Here is another example where the given double integral representation of $$\operatorname{Li}_2$$ plays a crucial part and immediately allows us to connect the integral with known resulting integrals:

$$\int _0^{\pi/2}\int _0^{\pi/2} \operatorname{arctanh}(\sin(y))\csc (y)\cot (x) \log \left(1-2 \sin (x)+\sin ^2(x) \csc ^2(y)\right)\textrm{d}x \textrm{d}y$$ $$=2\log(2)\pi G-\frac{9}{8}\log^2(2)\pi^2-\frac{\pi^3}{6}-\frac{17}{96}\pi^4+12 \pi \Im\biggr\{\operatorname{Li}_3\left(\frac{1+i}{2}\right)\biggr\}.$$

EDIT_4: More generally, we have the following polylogarithmic representation, $$n\ge0$$, $$\operatorname{Li}_{n+2}(u)$$ $$\small =(-1)^{n-1}\frac{1}{\pi}\frac{1}{n!}\int _0^{\pi/2}\int _0^{\pi/2}\frac{(1-u)\log^n(\sin(x))\log \left(1-2 \sin (x)+ \csc ^2(y) \sin ^2(x)\right)}{\tan (x) \left(\cos ^2(y)+(1-u)^2 \sin ^2(y)\right)}\textrm{d}x \textrm{d}y, \ u<1.$$

EDIT_5: In view of the generalization above, which can be proved by exploiting a similar idea to the one stated at EDIT_2, we obtain a double integral very similar to the initial one, and so nice:

$$\small \int _0^{\pi/2}\int _0^{\pi/2}\cot (x) \csc ^2(y) \log(\sin(x))\log (\cos (y)) \log \left(1-2 \sin (x)+\sin ^2(x) \csc ^2(y)\right)\textrm{d}x \textrm{d}y$$ $$=\frac{\pi^3}{6}-\pi-\pi \zeta(3).$$

EDIT_6: The Trilogarithmic version can also be approached like the Dilogarithm version, presented in the link attached in the beginning. Essentially, we combine $$\int_0^1 \frac{\log \left(\csc ^2(x) t^2 -2 t+1\right)\log(t)}{t} \textrm{d}t$$ $$=-\sum_{n=1}^{\infty} \left(\frac{H_n^2}{n}+\frac{H_n^{(2)}}{n}+2\frac{H_n\overline{H}_n}{n}+2\frac{\overline{H}_n^{(2)}}{n}-2\frac{1}{n}\sum_{k=1}^n (-1)^{k-1}\frac{H_k}{k}\right)\cos(2 n x)$$ $$= -\sum_{n=1}^{\infty}\left(\frac{H_n^2}{n}+\frac{H_n^{(2)}}{n}+2\frac{1}{n}\sum_{k=1}^n\frac{\overline{H}_k}{k}\right)\cos(2 n x)$$ and $$-\operatorname{Li}_3\left(\frac{2x}{x-1}\right)$$ $$= \sum_{n=1}^{\infty} x^n\left(\frac{1}{2}\frac{H_n^2}{n}+\frac{1}{2}\frac{H_n^{(2)}}{n}+\frac{1}{n}\sum_{k=1}^n\frac{\overline{H}_k}{k}\right)$$ $$=\sum_{n=1}^{\infty} x^n\left(\frac{1}{2}\frac{H_n^2}{n}+\frac{1}{2}\frac{H_n^{(2)}}{n}+\frac{H_n\overline{H}_n}{n}+\frac{\overline{H}_n^{(2)}}{n}-\frac{1}{n}\sum_{k=1}^n (-1)^{k-1}\frac{H_k}{k}\right)$$,

EDIT_7: Cornel says that we can perfectly consider and exploit the ideas in the paper The Dilogarithm: A New Representation in Terms of a Double Integral (for the Polylogarithm version) where the dilogarithmic version is proved. For higher order when the complicated coefficients of the key powers series and Fourier series pop up, we can write them generically by using say, $$a_n$$ and $$c_n \cdot b_n$$, and this is enough (of course, they turn out to be complicated as we consider polylogarithms of higher orders). These details will be explained later in another paper.

EDIT_8: Such strategies are very powerful in deriving difficult results, as we may see in More (Almost) Impossible Integrals, Sums, and Series: A New Collection of Fiendish Problems and Surprising Solutions (2023), pages 73-74 $$\int_0^{\pi/2}\frac{\log^4(\cos(\theta))}{\cos^2(\theta)+y^2 \sin^2(\theta)}\textrm{d}\theta=\frac{1}{16}\int_0^{\infty} \frac{\log^4(1+x^2)}{1+y^2 x^2}\textrm{d}x$$ $$= \frac{\pi}{96}(7\pi^4+24 \log^2(2)\pi^2+48\log^4(2)-288\log(2)\zeta(3))\frac{1}{y}$$ $$-\frac{1}{2}\log(2)\pi(4\log^2(2)+3\pi^2)\frac{1}{y}\log\left(\frac{2y}{1+y}\right)+\frac{\pi^3}{2}\frac{1}{y}\log^2\left(\frac{2y}{1+y}\right)$$ $$-3\log(2)\pi \frac{\log(y)}{y}\log^2\left(\frac{2y}{1+y}\right)+3\log(2)\pi \frac{\log(1-y)}{y}\log^2\left(\frac{2y}{1+y}\right)$$ $$+\frac{3}{2}\log(2)\pi \frac{1}{y}\log^3\left(\frac{2y}{1+y}\right)+\frac{\pi}{2}\frac{\log(y)}{y}\log^3\left(\frac{2y}{1+y}\right)-\frac{\pi}{2}\frac{\log(1-y)}{y}\log^3\left(\frac{2y}{1+y}\right)$$ $$-\frac{\pi}{8}\frac{1}{y}\log^4\left(\frac{2y}{1+y}\right)+\frac{\pi}{4}(12\log^2(2)+\pi^2)\frac{1}{y}\operatorname{Li}_2\left(\frac{1-y}{1+y}\right)+3\log(2)\pi \frac{1}{y}\operatorname{Li}_3\left(\frac{1-y}{1+y}\right)$$ $$+6\log(2)\pi \frac{1}{y}\operatorname{Li}_3\left(\frac{2y}{1+y}\right)-\frac{3}{2}\pi\frac{1}{y} \operatorname{Li}_4\left(\frac{1-y}{1+y}\right)-3\pi\frac{1}{y} \operatorname{Li}_4\left(\frac{2y}{1+y}\right)$$ $$-3\pi \frac{1}{y} \operatorname{Li}_4\left(\frac{y-1}{2y}\right), \ y>0.$$

EDIT_9: probably the final edit. Thanks Cornel for sharing fantastic calculations.

• What's the question here? Sep 27, 2023 at 20:40
• Substituting $(u,v)=(\sin x,\cot y)$ and integrating w.r.t. $u$, I was able to reduce this to$$\Re\int_0^\infty\operatorname{Li}_2(1+iv)\log\left(1+\frac1{v^2}\right)\,dv$$but no further... Sep 27, 2023 at 21:42
• Not sure if you're aware of those integrals - however, KStarGamer, made use of a very similar identity to yours (from Edit_6), namely: $$\frac{(-1)^{n-1}}{n!}\int_{0}^{1}\frac{\ln(t)^n\ln\left|1-2t+t^2(1-x^2)\right|}{t}\, dt = \Re\left(\operatorname{Li}_{n+2}\left(1+x\right)+\operatorname{Li}_{n+2}\left(1-x\right)\right)$$ Perhaps one can obtain even more interesting integrals by taking inspiration from there and combine it with the identity from this post. Sep 28, 2023 at 13:28
• @Zacky Thanks for sharing, and these are good to know. Absolutely not aware of these ones so far. Sep 28, 2023 at 13:33
• @user170231 Did you try IBP? Sep 28, 2023 at 14:04

$$\int_0^\frac{\pi}{2}\int_0^\frac{\pi}{2}\cot x \csc^2 y\ln(\cos y)\ln(1-2\sin x+\sin^2 x\csc^2y)dxdy$$ $$\overset{\large \sin x\to x \atop \large \cot y \to y}=-\frac12\int_0^\infty \int_0^1 \frac{\color{blue}{\ln\left(1+\frac{1}{y^2}\right)}\ln((1-x)^2+x^2y^2)}{x}dxdy$$ $$=-\frac{\color{blue}{2}}{2}\int_0^\infty\int_0^1\color{blue}{\int_0^1}\frac{\color{blue}{t}\ln((1-x)^2+x^2y^2)}{x\color{blue}{(t^2+y^2)}}\color{blue}{dt}dxdy$$ $$\overset{y\to ty}=-\int_0^1\frac{1}{x}\int_0^1\color{red}{\int_0^\infty\frac{\ln((1-x)^2+x^2t^2y^2)}{1+y^2}dy}dtdx$$ $$=-\color{red}{\pi}\int_0^1\frac{1}{x}\int_0^1 \color{red}{\ln(1-x+xt)}dtdx$$ $$=\pi\underbrace{\int_0^1 \left(\frac1x+\frac{\ln(1-x)}{x^2}\right)dx}_{\large -1}-\pi\underbrace{\int_0^1\frac{\ln(1-x)}{x}dx}_{\large -\frac{\pi^2}{6}}=\boxed{\frac{\pi^3}{6}-\pi}$$

• (+1) This one is nice. :-) Sep 28, 2023 at 13:03
• Thank you! $\$ Sep 28, 2023 at 13:15
• This strategy should also work to prove the generalization of the Polylogarithm representation, since $\displaystyle \operatorname{Li}_{n+2}(z)=(-1)^{n-1}\frac{1}{n!} \int_0^1 \frac{\log(1-z t) \log^n(t)}{t} \textrm{d}t, \ n\ge 0$. Sep 28, 2023 at 13:24
• (+1) Nice approach! Just saw this question now and was about to write up an answer like this but then saw yours haha beat me to it. Sep 30, 2023 at 19:48
• Haha, thank you! Sep 30, 2023 at 21:35

\begin{align*} & \int_0^{\pi/2} \int_0^{\pi/2} \cot (x) \csc ^2(y) \log (\cos (y)) \log \left(1-2 \sin (x)+\sin ^2(x) \csc ^2(y)\right) \, dx \, dy \\ &= -\int_0^\infty \int_0^1 \frac{\log\left(1+\frac1{v^2}\right) \log\left(1-2u+\left(1+v^2\right)u^2\right)}{2u} \, du \, dv \tag1 \\ &= \frac12 \int_0^\infty \left(\operatorname{Li}_2(1+iv) + \operatorname{Li}_2(1-iv)\right) \, \log\left(1+\frac1{v^2}\right) \, dv \tag2 \\ &= \Re \int_0^\infty \operatorname{Li}_2(1+iv) \log\left(1+\frac1{v^2}\right) \, dv \\ &= \frac{\pi^3}6 + \int_0^\infty \frac{\frac\pi2+v\log v}{1+v^2} \left(v \log\left(1+\frac1{v^2}\right) - 2\cot^{-1}v\right) \, dv \tag3 \\ &= \frac{\pi^3}6 + \frac\pi2 \underbrace{\int_0^\infty \frac{\log\left(1+v^2\right)}{v\left(1+v^2\right)}\,dv}_{=\tfrac{\pi^2}{12}} - \underbrace{\int_0^\infty \frac{\log v\log\left(1+v^2\right)}{v^2\left(1+v^2\right)}\,dv}_{=:J} \\ &\qquad - \pi \underbrace{\int_0^\infty \frac{\tan^{-1}v}{1+v^2} \, dv}_{=\tfrac{\pi^2}8} + 2 \underbrace{\int_0^\infty \frac{\log v \tan^{-1} v}{v\left(1+v^2\right)}}_{=:K} \, dv \tag4 \\ &= \frac{\pi^3}6 - \frac{\pi^3}{12} + \left(\frac{\pi^3}8-\pi\right) + 2\left(-\frac{\pi^3}{48}\right) = \boxed{\frac{\pi^3}6 - \pi} \tag5 \end{align*}

• $$(1)$$ substitute $$(u,v)=(\sin x,\cot y)$$
• $$(2)$$ integrate by parts to compute the antiderivative w.r.t. $$u$$ $$\int -\frac{\log\left(1-2u+\left(1+v^2\right)u^2\right)}u \, du \\ = \log u \left(\arctan\frac{uv}{1-u} - \log\left(1-2u+\left(1+v^2\right)u^2\right)\right) + \operatorname{Li}_2\left(u(1-iv)\right) + \operatorname{Li}_2\left(u(1+iv)\right)$$
• $$(3)$$ integrate by parts again, assuming the principal branch of $$\log z$$ so that $$\log(-i)=-\dfrac{i\pi}2$$; IBP yields $$\Re \left(\frac{\pi^3}6 + i \int_0^\infty \frac{(1-iv)(\log(-i)+\log v)}{1+v^2} \left(v \log\left(1+\frac 1{v^2}\right) - 2\cot^{-1}v\right) \, dv\right)$$
• $$(4)$$ substitute $$v\mapsto\dfrac1v$$ and expand the integrand; IBP to calculate the indicated terms
• $$(5{\rm a})$$ evaluate $$J$$ as the limit of a second-order derivative of the beta function, \begin{align*} J &= \frac12 \lim_{(a,b)\to(1,1)} \frac{\partial^2}{\partial a\partial b} \int_0^\infty \frac{dv}{v^{2a}\left(1+v^2\right)^b} \\ &= \frac14 \lim_{(a,b)\to(1,1)} \frac{\partial^2}{\partial a\partial b} \operatorname{B}\left(-a+\frac12, a+b-\frac12\right) \\ &= \frac14 \operatorname{B}\left(-\frac12, \frac32\right) \left[\psi\left(-\frac12\right) \psi(1) - \psi\left(-\frac12\right) \psi\left(\frac32\right) - \psi(1) \psi\left(\frac32\right) \right. \\ &\qquad\qquad\qquad\qquad \left. + \psi^2\left(\frac32\right) + \psi'\left(\frac32\right)\right] \\ &= -\frac\pi4 \left(\frac{\pi^2}2 - 4\right) = \pi-\frac{\pi^3}8 \end{align*} where $$\psi$$ is the digamma function and $$\psi'$$ is trigamma; the reflection formula shows $$\psi\left(-\dfrac12\right)=\psi\left(\dfrac32\right)$$, and the surviving trigamma term has a known closed form
• $$(5{\rm b})$$ evaluate $$K$$ with the Feynman technique, \begin{align*} \mathcal K(a) &= \int_0^\infty \frac{\log v \tan^{-1}(av)}{v\left(1+v^2\right)} \, dv \\[1ex] \mathcal K'(a) &= \frac1{1-a^2} \underbrace{\int_0^\infty \frac{\log v}{1+v^2} \, dv}_{=0} + \frac{a^2}{a^2-1} \int_0^\infty \frac{\log v}{1+a^2v^2} \, dv \\ &= \frac{a}{a^2-1} \int_0^\infty \frac{\log v - \log a}{1+v^2} \, dv \\ &= \frac\pi2 \frac{a \log a}{1-a^2} \\[1ex] \mathcal K(a) &= \frac\pi2 \int_0^a \frac{b \log b}{1-b^2} \, db \\[1ex] \implies K = \lim_{a\to1^-} \mathcal K(a) &= -\frac{\pi^3}{48} \end{align*}
• (+1) Creative procedure (with a nice start). Sep 28, 2023 at 16:50
• Thank you! I think we can go on to find $K$ using a contour integral like here but I'm still hoping to find a less cumbersome solution. Sep 28, 2023 at 17:23

I tried a semi-experimental heuristic approach which led me to the announced simple (and beautiful!) result.

It consists of four steps

Let $$d$$ be the double integral in question.

Step 1: letting Mathematica do the $$x$$-integral

$$\int_0^{\frac{\pi }{2}} \cot (x) \csc ^2(y) \log (\cos (y)) \log \left(\sin ^2(x) \csc ^2(y)-2 \sin (x)+1\right) \, dx$$

leads to the following remaining $$y$$-integral

$$\int_0^{\frac{\pi }{2}} \csc ^2(y) (-\text{Li}_2(i \cot (y)+1)-\text{Li}_2(1-i \cot (y))) \log (\cos (y)) \, dy$$

Step 2: The transformation $$\cos(y) = t$$ gives

$$d =- \int_0^1 \frac{\left(\text{Li}_2\left(\frac{i t}{\sqrt{1-t^2}}+1\right)+\text{Li}_2\left(1-\frac{i t}{\sqrt{1-t^2}}\right)\right) \log (t)}{\left(1-t^2\right)^{3/2}} \, dt$$

Step 3: integration by parts

$$u=\int \frac{1}{\left(1-t^2\right)^{3/2}} \, dt=\frac{t}{\sqrt{1-t^2}}$$

$$v=\left(\text{Li}_2\left(\frac{i t}{\sqrt{1-t^2}}+1\right)+\text{Li}_2\left(1-\frac{i t}{\sqrt{1-t^2}}\right)\right) (-\log (t))$$

Happily, as I found numerically,

$$u v |_{t\to 1} =u v |_{t\to 0} = 0$$

so that the reamining integral becomes

$$d = - \int_{0}^{1} u v'\,dt = i_1 + i_2$$

where

$$i_1 =-\int_0^1 \frac{t \log (t)}{\left(1-t^2\right)^{3/2}} \left(\left(t+i \sqrt{1-t^2}\right) \log \left(-\frac{i t}{\sqrt{1-t^2}}\right)\\ +\left(t-i \sqrt{1-t^2}\right) \log \left(\frac{i t}{\sqrt{1-t^2}}\right)\right) \, dt$$

$$i_2 = \int_0^1 \frac{\text{Li}_2\left(\frac{i t}{\sqrt{1-t^2}}+1\right)+\text{Li}_2\left(1-\frac{i t}{\sqrt{1-t^2}}\right)}{\sqrt{1-t^2}} \, dt$$

Again we are lucky: surprisingly $$i_2$$ vanishes, as I discovered numerically, and we get rid of the polylogs.

Step 4: doing the integral $$i_1$$

Expanding the logarithm

$$\log \left(-\frac{i t}{\sqrt{1-t^2}}\right)=-\frac{1}{2} \log \left(1-t^2\right)+\log (t)+\log (-i)$$

and collecting all real parts leads to these three integrals which can be easily done

$$2 \int_0^1 \left\{-\frac{\left(t^2 \log (t)\right) \log (t)}{\left(1-t^2\right)^{3/2}},-\frac{\left(t^2 \log (t)\right) \left(-\log \left(1-t^2\right)\right)}{2 \left(1-t^2\right)^{3/2}},-\frac{\pi t \log (t)}{2 \left(1-t^2\right)}\right\} \, dt\\=\left\{\frac{\pi ^3}{12}+\frac{1}{4} \pi \log ^2(4)-\pi \log (4),\frac{\pi ^3}{24}-\pi -\frac{1}{4} \pi \log ^2(4)+\pi \log (4),\frac{\pi ^3}{24}\right\}$$

The sum of these gives the beautiful result announced in the OP

$$d = \frac{\pi ^3}{6}-\pi$$

Calculations

§1. Why does integral $$i_2$$ vanish?

(to be completed soon)

Substituting $$t -> \sin(s)$$ we have

$$i_2 = \int_0^{\frac{\pi }{2}} (\text{Li}_2(i \tan (s)+1)+\text{Li}_2(1-i \tan (s))) \, ds$$

Replacing

$$\text{Li}_2(s) = \int_0^1 -\frac{\log (1-s x)}{x} \, dx$$

For $$0 \le x \le 1$$ we have

$$\int_0^{\frac{\pi }{2}} \frac{\log \left(x^2 \tan ^2(s)+(x-1)^2\right)}{x} \, ds =0$$

Discussion

In hindsight I would have preferred not to know the result in advance, but just that it exists. But, honestly, would I have had enough patience?

As announced in the beginning, there were some experimental steps involved in this derivation, partly CAS-integration, partly numerical. One might wish to prove some of the results obtained numerically. But actually we were on a heuristic trip, i.e. looking for a result. Once we have found it the method is justified just by the fact that that we have found it (Heureka!).

• (+1) for the efforts. Interesting approach. Sep 28, 2023 at 13:04
• @user97357329 Thank you very much. Sep 28, 2023 at 13:08