Re: Polylogarithm Integration - Bis

*To*: mathgroup at smc.vnet.net*Subject*: [mg46202] Re: Polylogarithm Integration - Bis*From*: Bill Rowe <readnewsciv at earthlink.net>*Date*: Tue, 10 Feb 2004 00:06:59 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

On 2/9/04 at 5:54 AM, DWCantrell at sigmaxi.org (David W. Cantrell) wrote: >Bill Rowe <readnewsciv at earthlink.net> wrote: >>On 2/6/04 at 4:15 AM, D at D.gov (D) wrote: >>>Some more example for the integral: >>>Integrate[PolyLog[2, Exp[I*(x - y)]], {y, 0, 2*Pi}] >>>with x=5/2, I get 0 as expected. But with x=2.5 I get >>>19.634954084936204 + I*1.7763568394002505`*^-15 >>>which is not close to zero! >>When you use x = 5/2 you are asking Mathematica to use exact >>numbers. So, Integrate returns the correct exact result of 0. But >>when you use 2.5 you are asking Mathematica to use machine >>precision numbers. Integrate does not seem to be coded to avoid >>problems with loss of precision that occurs with machine precision >>numbers. >You miss the point. Such a huge discrepancy cannot be explained in >this simple manner. See below. >Unfortunately you snipped the part where D had said: >"With x=-2.5 I get >44.964016795241896 + I*1.7763568394002505`*^-15 Yes. It didn't occur to me to check both values. >So now consider the following, obtained using version 5.0: >In[1]:= Integrate[PolyLog[2, Exp[I*(x - y)]], {y, 0, 2*Pi}] >Out[1]= If[x >= 2*Pi || x <= 0, Pi^3 - Pi*Log[-E^((-I)*x)]^2 + >2*I*Pi^2*Log[1 - E^((-I)*x)] - 2*I*Pi^2*Log[1 - E^(I*x)], >Integrate[PolyLog[2, E^(I*(x - y))], {y, 0, 2*Pi}, Assumptions -> >!(x >= 2*Pi || x <= 0)]] >In[2]:= % /. x -> -5/2 >Out[2]= Pi^3 - 2*I*Pi^2*Log[1 - E^(-((5*I)/2))] + 2*I*Pi^2*Log[1 - >E^((5*I)/2)] - Pi*Log[-E^((5*I)/2)]^2 >In[3]:= FullSimplify[%] >Out[3]= (1/4)*(5 - 4*Pi)^2*Pi >The above is essentially the same result as D got, but using exact >numbers. >In[4]:= N[%] >Out[4]= 44.964016795241896 >But the answer should presumably be 0 instead: >In[5]:= Integrate[PolyLog[2, Exp[I*(-5/2 - y)]], {y, 0, 2*Pi}] >Out[5]= 0 >So I must agree with D that there is indeed a bug somewhere here. There does seem to be a bug somewhere. By inspection it is clear (1/4)*(5 - 4*Pi)^2*Pi is not zero. But it isn't obvious the preceding expression should reduce to this when FullSimplify is applied. But I am not convinced the explanation I gave is substantially wrong, although I might have worded it more carefully. I said it was a problem with the coding of Integrate but to be more precise I should have said using N to convert the output of Integrate to a numerical answer isn't guaranteed to not lose numerical precision. And as a consequence, applying N to the results of Integrate can get results that are quite inaccurate. In any case, I still think when a numerical answer is desired it is far better to use NIntegrate rather than apply N to the results of Integrate. And I note with x = -2.5, NIntegrate gives me the same warning regarding the integral coverging to slowly. -- To reply via email subtract one hundred and four

**Re: Re: Find last NZ in list**

**Re: Find last NZ in list**

**Re: Polylogarithm Integration - Bis**

**Re: Polylogarithm Integration - Bis**