       Re: wrong result when computing a definite integral

• To: mathgroup at smc.vnet.net
• Subject: [mg129427] Re: wrong result when computing a definite integral
• From: Murray Eisenberg <murray at math.umass.edu>
• Date: Sat, 12 Jan 2013 21:51:50 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-newout@smc.vnet.net
• Delivered-to: mathgroup-newsend@smc.vnet.net
• References: <20130111023916.C722668DD@smc.vnet.net> <20130112032244.54DBC691E@smc.vnet.net>

```Unless there's some issue of branches of complex functions involved that
I'm missing, it should not matter here which order of integration you
use -- since the limits of integration are constants. However, if you
wrap each integrand in ComplexExpand,

a = Integrate[ComplexExpand[Exp[I*Sqrt*y]], {x, -2*Pi, 2*Pi},
{y, -Pi, Pi}]
b = Integrate[ComplexExpand[Exp[I*Sqrt*y]], {y, -Pi, Pi}, {x,
-2*Pi, 2*Pi}]

then you obtain the same result:

{a, b} // InputForm
{(8*Pi*Sin[Sqrt*Pi])/Sqrt, (8*Pi*Sin[Sqrt*Pi])/Sqrt}
a == b
True

On Jan 11, 2013, at 10:22 PM, Alex Krasnov <akrasnov at eecs.berkeley.edu> wrote:

> Integrate takes the integration variables in prefix order, so perhaps you
> meant the following:
>
> In:	Integrate[Exp[I*Sqrt*y], {y, -Pi, Pi}, {x, -2*Pi, 2*Pi}]
> Out:	(8*Pi*Sin[Sqrt*Pi])/Sqrt
>
>  Thu, 10 Jan 2013, Dexter Filmore wrote:
>
>> i run into this problem today when giving a bunch of easy integrals to mathematica.
>> here's a wolfram alpha link to the problem:
>>
http://www.wolframalpha.com/input/?i=Integrate%5BExp%5BI+Sqrt%5B3%5Dy%5D%2C%7Bx%2C-2Pi%2C2Pi%7D%2C%7By%2C-Pi%2CPi%7D%5D#
>>
>> the integrand does not depend on the 'x' variable, the inner
integration should only result in a factor of 4Pi, and the correct
result is a real number, yet the below integral gives a complex number
which is far off from the correct value:
>> Integrate[Exp[I Sqrt y], {x, -2 Pi, 2 Pi}, {y, -Pi, Pi}] -> -((4 I (-1 + E^(2 I Sqrt Pi)) Pi)/Sqrt)
>>
>> from some trial and error it seems the result is also incorrect for non-integer factors in the exponential.

---
Murray Eisenberg                                    murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower            phone 413 549-1020 (H)
University of Massachusetts                               413 5 (W)
710 North Pleasant Street                         fax   413 545-1801
Amherst, MA 01003-9305

```

• Prev by Date: Re: Modern Differential Geometry for Mathematica 9
• Next by Date: Re: Mathematica and Lisp
• Previous by thread: Re: wrong result when computing a definite integral
• Next by thread: Re: wrong result when computing a definite integral