Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15056 > unrolled thread

Complex path integral wrong

Started by"Dr. Wolfgang Hintze" <weh@snafu.de>
First post2013-06-30 07:26 +0000
Last post2013-07-03 08:50 +0000
Articles 7 — 4 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Complex path integral wrong "Dr. Wolfgang Hintze" <weh@snafu.de> - 2013-06-30 07:26 +0000
    Re: Complex path integral wrong "Kevin J. McCann" <kjm@KevinMcCann.com> - 2013-07-01 09:44 +0000
    Re: Complex path integral wrong "Kevin J. McCann" <kjm@KevinMcCann.com> - 2013-07-01 09:45 +0000
      Re: Complex path integral wrong "Dr. Wolfgang Hintze" <weh@snafu.de> - 2013-07-02 04:30 +0000
    Re: Complex path integral wrong Murray Eisenberg <murray@math.umass.edu> - 2013-07-02 04:30 +0000
    Re: Complex path integral wrong danl@wolfram.com - 2013-07-02 04:34 +0000
    Re: Complex path integral wrong "Dr. Wolfgang Hintze" <weh@snafu.de> - 2013-07-03 08:50 +0000

#15056 — Complex path integral wrong

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2013-06-30 07:26 +0000
SubjectComplex path integral wrong
Message-ID<kqomj6$p76$1@smc.vnet.net>
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

[toc] | [next] | [standalone]


#15070

From"Kevin J. McCann" <kjm@KevinMcCann.com>
Date2013-07-01 09:44 +0000
Message-ID<kqrj18$4b8$1@smc.vnet.net>
In reply to#15056
If you change Integrate to NIntegrate, you get the answer you expect 
from the residue. So, this is a bug.

Kevin


On 6/30/2013 3:26 AM, Dr. Wolfgang Hintze 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
>

[toc] | [prev] | [next] | [standalone]


#15077

From"Kevin J. McCann" <kjm@KevinMcCann.com>
Date2013-07-01 09:45 +0000
Message-ID<kqrj4e$4bn$1@smc.vnet.net>
In reply to#15056
A followup on my earlier reply.

If I compare the analytical and numerical results from Mathematica, the 
discrepancy occurs on the first leg of the integration
(1+I -> 1+I R). It is clear that the numerical integration is correct.

Could this be some kind of branch cut issue with the hypergeometric 
function evaluation?

Kevin

On 6/30/2013 3:26 AM, Dr. Wolfgang Hintze 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
>

[toc] | [prev] | [next] | [standalone]


#15080

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2013-07-02 04:30 +0000
Message-ID<kqtl1l$ask$1@smc.vnet.net>
In reply to#15077
Am Montag, 1. Juli 2013 11:45:50 UTC+2 schrieb Kevin J. McCann:
> A followup on my earlier reply.
>
>
>
> If I compare the analytical and numerical results from Mathematica, the
>
> discrepancy occurs on the first leg of the integration
>
> (1+I -> 1+I R). It is clear that the numerical integration is correct.
>
>
>
> Could this be some kind of branch cut issue with the hypergeometric
>
> function evaluation?
>
>
>
> Kevin
>
>
>
> On 6/30/2013 3:26 AM, Dr. Wolfgang Hintze 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
>
> >

Kevin,

I think you are right, the branch cut might be the reason.

Indeed there seem to be some deeper difficulties with the hypergeometric function 2F1(a,b,c;z) (and/or with branch cuts) in Mathematica.

Because this function appears frequently as a result of indefinite integration which Mathematica transforms into definite integrals by taking limits, it deserves a somewhat closer look.

The function 2F1[a,b,c,z] as a function of z (if it doesn't reduce to a polynomial in z) has a branch cut in the complex z-plane ranging from +1 to +oo.

Let us investigate the behaviour on both side of the cut with an example.

We have

In[280]:= i0 = Simplify[TrigToExp[Integrate[Sin[s]/(Exp[s] - 1), s]]]

Out[280]= 1/2 E^(-I s) (Hypergeometric2F1[-I, 1, 1 - I, E^s] +
   E^(2 I s) Hypergeometric2F1[I, 1, 1 + I, E^s])

Now, let's take the first part only

In[296]:= f = Hypergeometric2F1[-I, 1, 1 - I, E^s];

We now compute the values of f on both side of the cut with different methods

1) replacement with a numerical values close to -0 and +0

In[298]:= f /. {s -> 2 + I*y} /. y -> -0.001

Out[298]= -0.07641223288902461 - 0.0652022010883159*I

In[299]:= f /. {s -> 2 + I*y} /. y -> Plus[0.001]

Out[299]= -2.6886865517869416 + 5.642501876662279*I

2) Limit to the same numerical values as in 1)
This leads to the same results as in 1)

In[300]:= Limit[f /. {s -> 2 + I*y}, y -> -0.001]

Out[300]= -0.07641223288902478 - 0.06520220108831606*I

In[301]:= Limit[f /. {s -> 2 + I*y}, y -> Plus[0.001]]

Out[301]= -2.688686551786946 + 5.642501876662289*I

3) Limit to exactly y=0 making the distinction using Direction

In[305]:= Limit[f /. {s -> 2 + I*y}, y -> 0, Direction -> -1];
N[%]

Out[306]= -0.07649229821994431 - 0.06513712192483992*I

In[307]:= Limit[f /. {s -> 2 + I*y}, y -> 0, Direction -> Plus[1]];
N[%]

Out[308]= -0.07649229821994431 - 0.06513712192483992*I

Obviously, the result here is independent of Direction, and it is (approximately) equal to the approximation from the negative side (y<0).

I would consider this indifference with respect to Direction a bug.

And this might well be a cause of some of the difficulties in Integrate.
I'm not sure because I don't know which limiting procedure is used by Mathematica in order to create definite integrals out of indefinite ones.

Maybe others who know more can clarify the situation.

PS: By the way, you can easily check that Mathematica behaves correctly with other functions with a similar branch cut, e.g. the function g[z_] := Sqrt[1 - z] at z=2+Iy, so it seems that there is a particular difficulty with the hypergeometric function. Which is especially unpleasant in view of the importance of this type of function in Mathematica's integration algorithm.

Best regards,
Wolfgang

[toc] | [prev] | [next] | [standalone]


#15078

FromMurray Eisenberg <murray@math.umass.edu>
Date2013-07-02 04:30 +0000
Message-ID<kqtl0d$asg$1@smc.vnet.net>
In reply to#15056
Hmm.. Documentation Center page on Hypergeometric2F1 says:

  "Hypergeometric2F1[a, b, c, z] has a branch cut discontinuity
   in the complex z plane running from 1 to Infinity."

Page 
http://functions.wolfram.com/HypergeometricFunctions/Hypergeometric2F1/04/02/
says:
 
  "[Hypergeometric2F1[a, b, c, z]] is an analytical function of a, b, c, and z
   which is defined on C^4"

Hence for fixed a, b, and c, that implies it is analytic as a function of z on the complex plane.

Which is it?

On Jul 1, 2013, at 5:52 AM, Kevin J. McCann <kjm@kevinmccann.com> wrote:

> A followup on my earlier reply.
>
> If I compare the analytical and numerical results from Mathematica, the
> discrepancy occurs on the first leg of the integration
> (1+I -> 1+I R). It is clear that the numerical integration is correct.
>
> Could this be some kind of branch cut issue with the hypergeometric
> function evaluation?
>
> Kevin
>
> On 6/30/2013 3:26 AM, Dr. Wolfgang Hintze 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





[toc] | [prev] | [next] | [standalone]


#15089

Fromdanl@wolfram.com
Date2013-07-02 04:34 +0000
Message-ID<kqtl99$atk$1@smc.vnet.net>
In reply to#15056
On Sunday, June 30, 2013 2:26:30 AM UTC-5, Dr. Wolfgang Hintze 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

The problem can be isolated to the first segment of the graph. Some further analysis indicates that a path singularity is not found at s=1+2*Pi*I. I looked into this and learned the following.

(1) The Integrate code notes that that is a point of interest for the antiderivative.

(2) Taking Limit from both sides of approach on that path gives the same result.

(3) This in turn is because the expansions from Series agree even when we give an assumption on s.

The upshot is that there is a bug probably in Series that causes the error in this path integral. I will file a bug report about that.

Daniel Lichtblau
Wolfram Research


[toc] | [prev] | [next] | [standalone]


#15107

From"Dr. Wolfgang Hintze" <weh@snafu.de>
Date2013-07-03 08:50 +0000
Message-ID<kr0ojr$3e6$1@smc.vnet.net>
In reply to#15056
Am Dienstag, 2. Juli 2013 06:30:05 UTC+2 schrieb Murray Eisenberg:
> Hmm.. Documentation Center page on Hypergeometric2F1 says:
> 
> 
> 
>   "Hypergeometric2F1[a, b, c, z] has a branch cut discontinuity
> 
>    in the complex z plane running from 1 to Infinity."
> 
> 
> 
> Page 
> 
> http://functions.wolfram.com/HypergeometricFunctions/Hypergeometric2F1/04/02/
> 
> says:
> 
>  
> 
>   "[Hypergeometric2F1[a, b, c, z]] is an analytical function of a, b, c, and z
> 
>    which is defined on C^4"
> 
> 
> 
> Hence for fixed a, b, and c, that implies it is analytic as a function of z on the complex plane.
> 
> 
> 
> Which is it?
> 
> 
> 
> On Jul 1, 2013, at 5:52 AM, Kevin J. McCann <kjm@kevinmccann.com> wrote:
> 
> 
> 
> > A followup on my earlier reply.
> 
> >
> 
> > If I compare the analytical and numerical results from Mathematica, the
> 
> > discrepancy occurs on the first leg of the integration
> 
> > (1+I -> 1+I R). It is clear that the numerical integration is correct.
> 
> >
> 
> > Could this be some kind of branch cut issue with the hypergeometric
> 
> > function evaluation?
> 
> >
> 
> > Kevin
> 
> >
> 
> > On 6/30/2013 3:26 AM, Dr. Wolfgang Hintze 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

A plot reveals that Mathematica's Hypergeometric2F1 in general has is a cut on the real axis from +1 to +oo as it should be:

f = Hypergeometric2F1[1/2, 1/2, 1, z];
Plot3D[Re[f /. {z -> x + I y}], {x, 0, 2}, {y, -1, 1}]
Plot3D[Im[f /. {z -> x + I y}], {x, 0, 2}, {y, -1, 1}]

Best regards,
Wolfgang

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web