# Double integral changing the limits

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.

• en.wikipedia.org/wiki/… Sep 16, 2014 at 14:27
• @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 Sep 16, 2014 at 14:33
• 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. Sep 16, 2014 at 14:37

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}] 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 Integrate[1/(E^((a - c)^2 + (b - c)^2)),
Element[{c, b}, region]]


also unevaluated 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]] 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]] The results from integrating over a region appear unreliable.

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] + Erf[(a + b)/Sqrt]), {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}]

• The same for complex values of a. Apr 12 at 18:00