2
$\begingroup$

This integral does not evaluate:

Integrate[
  Integrate[1/(E^((a - c)^2 + (b - c)^2) ), {c, 0, 1}], 
 {b, -Infinity, Infinity}]

However, reversing the integrals order yields a result:

Integrate[
  Integrate[1/(E^((a - c)^2 + (b - c)^2) ), {b, -Infinity, Infinity}], 
 {c, 0, 1}]

Are these equivalent? Is it incorrect to use the result of the second integral when I actually need the first?

I tried specifying the assumptions (a,b,c reals), but that did not change anything.

$\endgroup$
3
  • $\begingroup$ en.wikipedia.org/wiki/… $\endgroup$ Sep 16, 2014 at 14:27
  • $\begingroup$ @belisarius thank you very much! I was actually looking at that very exact page before posting here. I was just surprised that mathematica could not handle these integrals, so I doubted the assumption about the equality of these integrals $\endgroup$
    – user19754
    Sep 16, 2014 at 14:33
  • $\begingroup$ In this case you don't get a different result, but no result at all in the first case. If you pick a value for a and use NIntegrate on the outer integral for the first case you can show that you get the same answer, ie. they are equivalent, mathematica just cant do it in the one order. $\endgroup$
    – george2079
    Sep 16, 2014 at 14:37

2 Answers 2

4
$\begingroup$

UPDATE: version 10.0.1 on a Mac produces the same behavior.

An extended comment and observation.

$Version

"10.0 for Mac OS X x86 (64-bit) (June 29, 2014)"

The double integral evaluates only with integration over c as the outer integral

int1 = Integrate[1/(E^((a - c)^2 + (b - c)^2)),
  {c, 0, 1}, {b, -Infinity, Infinity}]

enter image description here

Investigating the version 10 integration over a region

With the region defined by

region = ImplicitRegion[
   0 <= c <= 1 && -Infinity < b < Infinity,
   {b, c}];

Neither of these integrals evaluate

Integrate[1/(E^((a - c)^2 + (b - c)^2)),
 Element[{b, c}, region]]

returns unevaluated

enter image description here

Integrate[1/(E^((a - c)^2 + (b - c)^2)),
 Element[{c, b}, region]]

also unevaluated

enter image description here

However, interchanging the variables in the definition of the region

region = ImplicitRegion[
   0 <= c <= 1 && -Infinity < b < Infinity,
   {c, b}];

Integrating as follows gives the same result as the double integral, int1

int2 = Integrate[1/(E^((a - c)^2 + (b - c)^2)),
  Element[{c, b}, region]]

enter image description here

int1 == int2

True

Whereas, interchanging the order of region variables in Element evaluates with a different result

int3 = Integrate[1/(E^((a - c)^2 + (b - c)^2)),
  Element[{b, c}, region]]

enter image description here

The results from integrating over a region appear unreliable.

$\endgroup$
0
$\begingroup$

In version 13 on Windows 10

Integrate[1/(E^((a - c)^2 + (b - c)^2)), {c, 0, 1}, {b, -Infinity, Infinity}, Assumptions -> a > -Infinity]

1/2 \[Pi] (Erf[1 - a] + Erf[a])

Another iterated integration

Integrate[1/(E^((a - c)^2 + (b - c)^2)), {b, -Infinity, Infinity}, {c, 0, 1}, Assumptions -> a > -Infinity]

Integrate[1/2 E^(-(1/2) (a - b)^2) Sqrt[\[Pi]/ 2] (-Erf[(-2 + a + b)/Sqrt[2]] + Erf[(a + b)/Sqrt[2]]), {b, -\[Infinity], \[Infinity]}, Assumptions -> a > -\[Infinity]]

returns the result of the first integration. Such behavior is quite common for iterated integrals. It is clear the double integral exists for each real value of a. Numeric integrations confirm 1/2 \[Pi] (Erf[1 - a] + Erf[a]), e.g.

1/2 \[Pi] (Erf[1 - a] + Erf[a]) /. a -> 0.5

1.6352

The same value is produced by

NIntegrate[1/(E^((a - c)^2 + (b - c)^2)) /. a -> 0.5, {b, -Infinity,Infinity}, {c, 0, 1}]

and

NIntegrate[1/(E^((a - c)^2 + (b - c)^2)) /. a -> 0.5, {c, 0, 1}, {b, -Infinity,  Infinity}]
$\endgroup$
1
  • $\begingroup$ The same for complex values of a. $\endgroup$
    – user64494
    Apr 12 at 18:00

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.