# How to calculate the double integral of the integral area related to the parameter

I know that the Integrate function of MMA can compute double integrals.

Integrate[x*y, {x, y} ∈ Disk[]]


Now I want to use MMA to calculate the result of this integral:

$$\iint_{x+y<=z}{\mathrm{e} ^{-\frac{x^2}{2} }\mathrm{e} ^{-\frac{y^2}{2} }}\mathrm{d}x \mathrm{d}y$$

The integral area of this double integral is related to the parameter z, so the result of this double integral is related to the parameter z. I know that the calculation of the above double integral according to the convolution formula is as follows:

    Integrate[
Integrate[
E^(-(x^2/2)) (E^(-((z - x)^2/
2))), {x, -∞, +∞}], {z, -∞, z}]
(*π (erf(z/2)+1)*)


But I can't get results when I execute his equivalent code:

    reg = ImplicitRegion[x + y <= z, {x, y}];
Integrate[E^(-(x^2/2)) E^(-(y^2/2)), {x, y} ∈ reg]


I want to know how to use Mathematica to calculate this type of double integral.

In addition, I don't want to use extra mathematical skills to calculate this kind of double integral.

• It’s an infinite region on which the integral diverges, no? – Michael E2 Jul 5 at 3:56
• @MichaelE2 Thank you. I've changed to a convergent integrand. – A little mouse on the pampas Jul 5 at 4:27
• This suggests there's a stumbling block (taking z = 1): Integrate[E^(-(x^2/2)) E^(-(y^2/2)), {x, -Infinity, Infinity}, {y, -Infinity, 1 - x}] – Michael E2 Jul 5 at 10:29

Don't use ImplicitRegion with a symbolic z that isn't part of the coordinate list - it won't work for some reason and Wolfram should probably document this in the Possible Issues section in the help. Consider this incorrect example too:

disk = ImplicitRegion[x^2 + y^2 <= r^2, {x, y}]
Area[disk]
(* returns: 0 *)


Instead, use an equivalent explicit region such as HalfPlane[{{z, 0}, {0, z}}, {-1, -1}];:

reg2 = HalfPlane[{{z, 0}, {0, z}}, {-1, -1}];
Integrate[Exp[-x^2/2] Exp[-y^2/2], {x, y} ∈ reg2]

(* result: ConditionalExpression[π (1 + Erf[z/2]), (z | z) ∈ Reals] *)

• Wow, ImplicitRegion is so buggy! By the way, using your first example, I am getting the correct answer imposing assumptions disk = ImplicitRegion[x^2 + y^2 <= r^2, {x, y}]; Assuming[r>0,Area[disk]]. I have MA12.1 – yarchik Jul 6 at 17:36
• @yarchik interesting - I tried assumptions for z on x+y<=z but I didn't get anywhere. – flinty Jul 6 at 17:37
• Yes, it does not help in this case... – yarchik Jul 6 at 17:39