The integral is: $$\int_{-\infty}^\infty dx\ dy \ |x-y|\ e^{-\frac{x^2}{2}} e^{-\frac{y^2}{2}} $$ I have come across an integral of this form before and I think a substitution of the form:

$u=\frac{(x-y)}{2}$ and $v=\frac{(x+y)}{2}$

should be used. But the above doesn't work

Here is how I did it:

With the above substitution:




so that the integral becomes:

$$\int_{-\infty}^\infty (du+dv)\ (dv-du) \ |2u|\ e^{-u^2} e^{-v^2}$$

I don't know how to proceed after this.


In order to calculate the pre-factor to integrand after the change of variables I calculate the Jacobian as follows: $$J=\frac{\partial u}{\partial x}\frac{\partial v}{\partial y}-\frac{\partial v}{\partial x}\frac{\partial u}{\partial y}=\frac{1}{4}-(-\frac{1}{4})=\frac{1}{2}$$

which transforms the integral to:

$$(1/2)\int_{-\infty}^\infty du\ dv \ |2u|\ e^{-u^2} e^{-v^2} = 2\sqrt\pi$$

which differs from the answer of Jack.

Where am I wrong?

  • 1
    $\begingroup$ Ah, I see what you did wrong. Alternatively, your integral is $2\pi\Bbb E|X-Y|$ for independent $N(0,\,1)$ variables $X-Y$. Defining $Z:=(X-Y)/\sqrt{2}\sim N(0,\,1)$, this is $2\pi\sqrt{2}\Bbb E|Z|$, which lets you avoid using double integrals. $\endgroup$
    – J.G.
    Jun 23 at 9:58
  • $\begingroup$ Thanks! Please check the edit $\endgroup$
    – Lost
    Jun 23 at 11:41
  • 1
    $\begingroup$ You have $2$ errors that obscure each other. For one, $dxdy=\frac{dudv}{u_xv_y-u_yv_x}$ as opposed to $dxdy=dudv(u_xv_y-u_yv_x)$, so where you halved you should have doubled, so you need another factor of $4$. The other error is an erroneous factor of $2$, which is why the correct answer is twice what you got. Where this factor of $2$ occurred is unclear unless you make more explicit your work on$$\int_{-\infty}^\infty|2u|e^{-u^2}du=\int_0^\infty4ue^{-u^2}du=2.$$ $\endgroup$
    – J.G.
    Jun 23 at 12:04

1 Answer 1


By a rotation of $45^\circ$ and Fubini's theorem $$ \iint_{\mathbb{R}^2}|x-y|e^{-\frac{x^2+y^2}{2}}\,dx\,dy = \sqrt{2}\iint_{\mathbb{R}^2}|u|e^{-u^2/2}e^{-v^2/2}\,du\,dv=4\sqrt{\pi}\int_{0}^{+\infty}u e^{-u^2/2}\,du=\color{red}{4\sqrt{\pi}}. $$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.