Search All of the Math Forum:

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

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

Topic: Complex path integral wrong
Replies: 2   Last Post: Jul 2, 2013 12:33 AM

 Messages: [ Previous | Next ]
 Dr. Wolfgang Hintze Posts: 195 Registered: 12/8/04
Re: Complex path integral wrong
Posted: Jul 2, 2013 12:33 AM

Am Montag, 1. Juli 2013 11:40:25 UTC+2 schrieb Murray Eisenberg:
> I don't think this is a bug -- at least with the currently implemented
>
> and documented Mathematica functionality.
>
>
>
> If in the second argument of Integrate one uses something of the form
>
>
>
> {var, val1, val2, . . ., valn}
>
>
>
> where n > 2, evidently all Mathematica does is separately calculate the
>
> integral along each segment -- finding an indefinite integral on the
>
> segment and evaluating at endpoints. And that has nothing to do, really,
>
> with evaluating a contour integral around a closed curve -- at least
>
> such a closed curve that includes singularities.
>
>
>
> If you look up Integrate in the Documentation Center, I don't think
>
> you'll even find mention of, or example of, this extended kind of 2nd
>
> argument. So while Mathematica lets one use this extended form, it's
>
> obviously still dangerous to do so.
>
>
>
> And so for a contour integral, one must resort to the Residue Theorem,
>
> as you have done, when the function is not holomorphic on the complex
>
> domain.
>
>
>
>
>
> On Jun 30, 2013, at 3:29 AM, Dr. Wolfgang Hintze <weh@snafu.de> wrote:
>
>
>

> > I suspect this is a bug
>
> > In[361]:= \$Version
>
> > Out[361]= "8.0 for Microsoft Windows (64-bit) (October 7, 2011)"
>
> >
>
> > The follwing path integral comes out wrong:
>
> >
>
> > R = 3 \[Pi] ;
>
> > Integrate[Exp[I s]/(
>
> > Exp[s] - 1 ), {s, 1 + I, 1 + I R, -1 + I R, -1 + I, 1 + I}] // FullSimplify
>
> >
>
> > Out[351]= 0
>
> >
>
> > It should have the value
>
> >
>
> > In[356]:= (2 \[Pi] I) Residue[Exp[I s]/(Exp[s] - 1 ), {s, 2 \[Pi] I}]
>
> >
>
> > Out[356]= (2 \[Pi] I) E^(-2 \[Pi])
>
> >
>
> > Without applying FullSimplify the result of the integration is
>
> >
>
> > In[357]:= R = 3*Pi;
>
> > Integrate[
>
> > Exp[I*s]/(Exp[s] - 1), {s, 1 + I, 1 + I*R, -1 + I*R, -1 + I, 1 + I}]
>
> >
>
> > Out[358]=
>
> > I*E^((-1 - I) - 3*Pi)*((-E)*Hypergeometric2F1[I, 1, 1 + I, -(1/E)] +
>
> > E^(3*Pi)*Hypergeometric2F1[I, 1, 1 + I, E^(-1 + I)]) +
>
> > I*E^(-I - 3*Pi)*(Hypergeometric2F1[I, 1, 1 + I, -(1/E)] -
>
> > E^(2*I)*Hypergeometric2F1[I, 1, 1 + I, -E]) +
>
> > I*E^I*(Hypergeometric2F1[I, 1, 1 + I, -E]/E^(3*Pi) -
>
> > Hypergeometric2F1[I, 1, 1 + I, E^(1 + I)]/E) +
>
> > I*E^(-1 - I)*(-Hypergeometric2F1[I, 1, 1 + I, E^(-1 + I)] +
>
> > E^(2*I)*Hypergeometric2F1[I, 1, 1 + I, E^(1 + I)])
>
> >
>
> > which, numerically, is
>
> >
>
> > In[359]:= N[%]
>
> >
>
> > Out[359]= -2.7755575615628914*^-17 + 2.7755575615628914*^-17*I
>
> >
>
> > i.e. zero.
>
> >
>
> > On simpler functions like 1, s and s^2 (instead of Exp[I s]) it works out fine, but not so with e.g. Sin[s] in which case we get 0 again (instead of Sinh[2 \[Pi]]).
>
> >
>
> > The integration topic seems to be full of pitfalls in Mathematica...
>
> >
>
> > Best regards,
>
> > Wolfgang
>
>
>
> ---
>
> Murray Eisenberg murray@math.umass.edu
>
> Mathematics & Statistics Dept.
>
> Lederle Graduate Research Tower phone 413 549-1020 (H)
>
> University of Massachusetts 413 545-2838 (W)
>
> 710 North Pleasant Street fax 413 545-1801
>
> Amherst, MA 01003-9305

Murray,

strictly speaking you are right.

So thank you for pointing out that "contour integral" is not a documented functionalty (I couldn't find it in the documentations center). But I was surprised because I have been using this funcionality for many years (starting in version 5.2) without problems.

Also there are nice examples in Wolfram Demonstrations Projects, e.g. http://demonstrations.wolfram.com/ContourIntegration/.

Other relevant links can be found in Google, including contributions from Paul Abbott and Michael Trott.

So I would say it is at least misleading if a function is available and even has intuitive syntax but is not really meant to work correctly.

As I mentioned it seems to work fine for many integrands (e.g. for s^k/(E^s-1), k=0,1,2,...) but there are exceptions (e.g. Sin[s]/(E^s-1)).

Regards,
Wolfgang

Date Subject Author
7/1/13 Murray Eisenberg
7/2/13 Dr. Wolfgang Hintze