1
$\begingroup$

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.

$\endgroup$
3
  • 1
    $\begingroup$ It’s an infinite region on which the integral diverges, no? $\endgroup$
    – Michael E2
    Commented Jul 5, 2020 at 3:56
  • $\begingroup$ @MichaelE2 Thank you. I've changed to a convergent integrand. $\endgroup$ Commented Jul 5, 2020 at 4:27
  • 1
    $\begingroup$ 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}] $\endgroup$
    – Michael E2
    Commented Jul 5, 2020 at 10:29

1 Answer 1

3
$\begingroup$

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] *)
$\endgroup$
3
  • 2
    $\begingroup$ 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 $\endgroup$
    – yarchik
    Commented Jul 6, 2020 at 17:36
  • 1
    $\begingroup$ @yarchik interesting - I tried assumptions for z on x+y<=z but I didn't get anywhere. $\endgroup$
    – flinty
    Commented Jul 6, 2020 at 17:37
  • 2
    $\begingroup$ Yes, it does not help in this case... $\endgroup$
    – yarchik
    Commented Jul 6, 2020 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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