# Double Integral $\int_0^\infty \int_0^\infty \frac{\log x \log y}{\sqrt {xy}}\cos(x+y)\,dx\,dy=(\gamma+2\log 2)\pi^2$

Hi I am trying to solve this double integral $$I:=\int_0^\infty \int_0^\infty \frac{\log x \log y}{\sqrt {xy}}\cos(x+y)\,dx\,dy=(\gamma+2\log 2)\pi^2.$$ Thank you.

The constant in the result is given by $\gamma\approx .577$, and is known as the Euler-Mascheroni constant. I was thinking to write $$I=\Re \bigg[\int_0^\infty \int_0^\infty \frac{\log x \log y}{\sqrt{xy}}\, e^{i(x+y)}\, dx\, dy\bigg]$$ and using Leibniz's rule for differentiation under the integral sign to write $$I(\eta, \xi)=\Re\bigg[ \int_0^\infty \int_0^\infty \ \frac{\log (\eta x)\log(\xi y)}{\sqrt{xy}} e^{i(x+y)}dx\,dy. \bigg]\\$$ After taking the derivatives it became obvious that I need to try another method since the x,y constants cancel out. How can we solve this integral I? Thanks.

Using the identity

$$\cos(x+y)=\cos(x)\cos(y)-\sin(x)\sin(y)$$

The integral can be written $$I=\int_0^\infty \int_0^\infty \frac{\log x \log y}{\sqrt {xy}}\left(\cos(x)\cos(y)-\sin(x)\sin(y)\right)\,dx\,dy$$

Now by splitting the integrals

$$\int_0^\infty \int_0^\infty \frac{\log x \log y}{\sqrt {xy}}\cos(x)\cos(y)\,dx\,dy-\int_0^\infty \int_0^\infty \frac{\log x \log y}{\sqrt {xy}}\sin(x)\sin(y)\,dx\,dy$$

Notice by symmetry of the integrals we have

$$\left(\int^\infty_0 \frac{\log x }{\sqrt {x}}\cos(x)\,dx \right)^2-\left(\int^\infty_0 \frac{\log x }{\sqrt {x}}\sin(x)\,dx \right)^2$$

Both inegrals are solvable by using the mellin transforms

$$\int^\infty_0 x^{s-1}\sin(x)\,dx = \Gamma (s) \sin\left( \frac{\pi s}{2} \right)$$

$$\int^\infty_0 x^{s-1}\cos(x)\,dx = \Gamma (s) \cos\left( \frac{\pi s}{2} \right)$$

By differentiation under the integral sign and using $s=\frac{1}{2}$.

$$\int^\infty_0 \frac{\log x }{\sqrt {x}}\cos(x)\,dx =-\frac{1}{2} \sqrt{\frac{π}{2}} \left(2 \gamma +π+\log(16) \right)$$

$$\int^\infty_0 \frac{\log x }{\sqrt {x}}\sin(x)\,dx=\frac{1}{2} \sqrt{\frac{π}{2}} (-2 \gamma +π- \log(16))$$

Collecting the results together we have

$$I=(\gamma+2\log 2)\pi^2$$

Consider

$$\int_0^{\infty} dx \, x^{\alpha} e^{i x}$$

We know from Cauchy's theorem that this integral is equal to (when it converges)

$$i \, e^{i \pi \alpha/2} \int_0^{\infty} du \, u^{\alpha} \, e^{-u} = i \, e^{i \pi \alpha/2} \, \Gamma(\alpha+1)$$

Differentiating both sides with respect to $\alpha$, we get

$$\int_0^{\infty} dx \, x^{\alpha} e^{i x}\, \log{x} = \Gamma(\alpha+1) e^{i \pi \alpha/2} \left [i \, \psi(\alpha+1)-\frac{\pi}{2} \right ]$$

Square both sides:

\begin{align}\int_0^{\infty} dx \, x^{\alpha} e^{i x}\, \log{x} \int_0^{\infty} dy \, y^{\alpha} e^{i y}\, \log{y} &= \Gamma(\alpha+1)^2 e^{i \pi \alpha} \left [\frac{\pi^2 }{4}-\psi(\alpha+1)^2-i \pi \psi(\alpha+1) \right ] \end{align}

Now plug in $\alpha=-1/2$ and consolidate; use the fact that $\Gamma(1/2)=\sqrt{\pi}$ and $\psi(1/2)=-\gamma-2 \log{2}$:

$$\int_0^{\infty} dx \, \int_0^{\infty} dy \frac{\log{x} \log{y}}{\sqrt{x y}} e^{i (x+y)} = -i \pi \left [\frac{\pi^2}{16} - (\gamma+2 \log{2})^2 + i \pi (\gamma+2 \log{2}) \right ]$$

Take the real part of both sides, and get

$$\int_0^{\infty} dx \, \int_0^{\infty} dy \frac{\log{x} \log{y}}{\sqrt{x y}} \cos{(x+y)} = \pi^2 (\gamma+2 \log{2})$$

as was to be shown.

• +1, Of course, assuming that the considered integral does converge and we have the right to use Fubini's theorem. – Omran Kouba May 12 '14 at 8:39
• @OmranKouba: Yes, I should have at least mentioned this. Very good point. Thankfully, it does. – Ron Gordon May 12 '14 at 8:41
• Do you have proof that the the integral converges? YOu say "when it converges" – Jeff Faraci May 13 '14 at 20:17
• @Integrals: it converges for certain $\alpha$ by Cauchy's theorem, i.e., $\operatorname{Re}{\alpha} \gt -1$. – Ron Gordon May 13 '14 at 20:22

The integral is $$I=\Re\left(\left(\int_0^{\infty} \frac{\ln x}{\sqrt{x}}e^{ix}\,dx\right)^2\right)$$ Evaluating the definite integral first: $$J=\int_0^{\infty} \frac{\ln x}{\sqrt{x}}e^{ix}\,dx$$ Use the substitution $\sqrt{x}=e^{i\pi/4}t$ to obtain: $$J=2e^{i\pi/4}\int_0^{\infty} e^{-t^2}\ln(t^2e^{i\pi/2})\,dt=2e^{i\pi/4}\int_0^{\infty} \left(2\ln te^{-t^2}+\frac{i\pi}{2}e^{-t^2}\right)\,dt$$ Using the following results: $$\int_0^{\infty} e^{-t^2}\ln t\,dt=-\frac{\sqrt{\pi}}{4}(\gamma+2\ln2)$$ $$\int_0^{\infty} e^{-t^2}\,dt=\frac{\sqrt{\pi}}{2}$$ ....we obtain: $$J=2e^{i\pi/4}\left(-\frac{\sqrt{\pi}}{2}(\gamma+2\ln 2)+\frac{i\pi}{2}\frac{\sqrt{\pi}}{2}\right)$$ $$\Rightarrow e^{i\pi/4}\sqrt{\pi}\left(\frac{i\pi}{2}-(\gamma+2\ln 2)\right)$$ Squaring $J$ and taking the real part, $$I=\pi^2(\gamma+2\ln 2)$$

• +1 and checked off as answer since you do not use any special functions! Thanks Pranav. However, do you have proof of $$\int_0^{\infty} e^{-t^2}\ln t\,dt=-\frac{\sqrt{\pi}}{4}(\gamma+2\ln2)$$ – Jeff Faraci May 12 '14 at 15:36
• Honestly, I am not sure about its proof. I found it in the list of integral representations for the constant here: mathworld.wolfram.com/Euler-MascheroniConstant.html . I did found a method to prove it though but it relies on gamma and digamma functions which I haven't yet learned. I first evaluated the integral $\int_0^{\infty} x^{n}e^{-x^2}\,dx$ using wolfram alpha. It came out to be $\frac{\Gamma((n+1)/2)}{2}$. Differentiate with respect to $n$ and substitute $n=0$ to obtain the definite integral. I have no idea about how much work it takes to do the above steps by hand. – Pranav Arora May 12 '14 at 16:02
• Now I feel that it looks exactly like Ron Gordon's method, I suggest marking his solution as the answer. – Pranav Arora May 12 '14 at 16:04
• @integrals, the solution must use a special function to get the euler constant . – Zaid Alyafeai May 12 '14 at 22:24
• @ZaidAlyafeai Good point! Thank you Pranav, but your solution is still OK. However, i marked the other solution. – Jeff Faraci May 13 '14 at 14:13


\begin{align} I&=\Re\int_{0}^{\infty}\int_{0}^{\infty} {\ln\pars{x}\ln\pars{y} \over \root{xy}}\,\expo{\ic\pars{x + y}}\,\dd x\,\dd y =\Re\braces{\bracks{\color{#c00000}{\int_{0}^{\infty} {\ln\pars{x} \over \root{x}}\,\expo{\ic x}\,\dd x}}^{2}} \end{align}

\begin{align} &\color{#c00000}{\int_{0}^{\infty} {\ln\pars{x} \over \root{x}}\,\expo{\ic x}\,\dd x} =\lim_{\mu \to -1/2}\partiald{}{\mu}\ \overbrace{\int_{0}^{\infty}x^{\mu}\expo{\ic x}\,\dd x} ^{\ds{t\ \equiv\ -\ic x\ \imp\ x\ =\ \ic t}}\ \\[3mm]&=\lim_{\mu \to -1/2}\partiald{}{\mu} \int_{0}^{-\ic\infty}\expo{\ic\pi\mu/2}t^{\mu}\expo{-t}\,\ic\,\dd t \\[3mm]&=\ic\lim_{\mu \to -1/2}\partiald{}{\mu}\braces{\expo{\ic\pi\mu/2}\bracks{% \int_{0}^{\infty}t^{\mu}\expo{-t}\,\dd t -\overbrace{\left.\lim_{R \to \infty}\int_{-\pi/2}^{0}z^{\mu}\expo{-z}\,\dd z\, \right\vert_{z\ \equiv\ R\expo{\ic\theta}}}^{\ds{=\ 0}}}} \\[3mm]&=\ic\lim_{\mu \to -1/2}\partiald{}{\mu} \bracks{\expo{\ic\pi\mu/2}\Gamma\pars{\mu + 1}} \end{align} where $\ds{\Gamma\pars{z}}$ is the Gamma Function ${\bf\mbox{6.1.1}}$.

\begin{align} I&=\color{#c00000}{\int_{0}^{\infty}{% \ln\pars{x} \over \root{x}}\,\expo{\ic x}\,\dd x} =\ic\lim_{\mu \to -1/2} \bracks{\expo{\ic\pi\mu/2}\,{\ic\pi \over 2}\,\Gamma\pars{\mu + 1} +\expo{\ic\pi\mu/2}\Gamma\pars{\mu + 1}\Psi\pars{\mu + 1}} \end{align} where $\ds{\Psi\pars{z}}$ is the Digamma Function ${\bf\mbox{6.3.1}}$.

\begin{align} I&=\color{#c00000}{\int_{0}^{\infty}{% \ln\pars{x} \over \root{x}}\,\expo{\ic x}\,\dd x} =\ic\expo{-\ic\pi/4}\Gamma\pars{\half} \bracks{{\ic\pi \over 2} + \Psi\pars{\half}} \\[3mm]&=\root{\pi \over 2}\pars{1 + \ic}\bracks{{\ic\pi \over 2} - \gamma - 2\ln\pars{2}} \end{align} $\ds{\gamma}$ is the Euler-Mascheroni Constant ${\bf\mbox{6.1.3}}$ and we used the identities $\ds{\Gamma\pars{\half} = \root{\pi}}$ and $\ds{\Psi\pars{\half}=-\gamma - 2\ln\pars{2}}$.

\begin{align} I&=\Re\int_{0}^{\infty}\int_{0}^{\infty} {\ln\pars{x}\ln\pars{y} \over \root{xy}}\,\expo{\ic\pars{x + y}}\,\dd x\,\dd y \\[3mm]&=\Re\pars{\braces{\root{\pi \over 2}\pars{1 + \ic}\bracks{{\ic\pi \over 2} - \gamma - 2\ln\pars{2}}}^{2}} \\[3mm]&=\Re\pars{{\pi \over 2}\,2\ic\braces{\bracks{\gamma + 2\ln\pars{2}}^{2} - {\pi^{2} \over 4} - \ic\pi\bracks{\gamma + 2\ln\pars{2}}}} \end{align}

$$\color{#00f}{\large% I\equiv\int_{0}^{\infty}\int_{0}^{\infty} {\ln\pars{x}\ln\pars{y} \over \root{xy}}\,\cos\pars{x + y}\,\dd x\,\dd y =\bracks{\gamma + 2\ln\pars{2}}\pi^{2}}$$