The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: wrong result when computing a definite integral
Replies: 4   Last Post: Jan 14, 2013 12:01 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Murray Eisenberg

Posts: 2,105
Registered: 12/6/04
Re: wrong result when computing a definite integral
Posted: Jan 12, 2013 9:51 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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[3]*y]], {x, -2*Pi, 2*Pi},
{y, -Pi, Pi}]
b = Integrate[ComplexExpand[Exp[I*Sqrt[3]*y]], {y, -Pi, Pi}, {x,
-2*Pi, 2*Pi}]

then you obtain the same result:

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

On Jan 11, 2013, at 10:22 PM, Alex Krasnov <> wrote:

> Integrate takes the integration variables in prefix order, so perhaps you
> meant the following:
> In: Integrate[Exp[I*Sqrt[3]*y], {y, -Pi, Pi}, {x, -2*Pi, 2*Pi}]
> Out: (8*Pi*Sin[Sqrt[3]*Pi])/Sqrt[3]
> 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:
>> 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[3] y], {x, -2 Pi, 2 Pi}, {y, -Pi, Pi}] -> -((4 I (-1 + E^(2 I Sqrt[3] Pi)) Pi)/Sqrt[3])
>> from some trial and error it seems the result is also incorrect for non-integer factors in the exponential.

Murray Eisenberg
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

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.