5

I am calculating the incomplete elliptic integral of the third kind in Mathematica 11.3 using EllipticPi. Since my range of phi goes beyond Pi/2 I tested my calculations before and realised that Mathematica evaluates EllipticPi[3,3*Pi/4,0.6] as EllipticPi[3,3*Pi/4-Pi,0.6]. However, if phi=m*Pi/2, where $m \in \{1,2,3,4,5,6,\dots\}$, I always obtain the correct result EllipticPi[3,m*Pi/2,0.6]=m*EllipticPi[3,Pi/2,0.6]. So I would like to ask if somebody could confirm that this is a bug (which I strongly suspect) or Mathematica simply uses a different way of calculating EllipticPi?

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
  • 1
    EllipticPi[] admittedly has not a few branch cut problems, but for $n > 1$ and $0<m<1$ there is the quasiperiodicity relation EllipticPi[n, z, m] == (-1)^Round[Mod[z + π/2, π]/π - 1/2] EllipticPi[n, Mod[z + π/2, π] - π/2, m] + 2 Round[Mod[z + π/2, π]/π - 1/2] EllipticPi[n, m]. Exactly what "correct result(s)" did you have in mind? – J. M.'s missing motivation Mar 23 '20 at 04:47
  • 1
    I just checked the expression you wrote and although I am not hundred percent sure, I think the second Round[]-term is responsible for the problem. When I have pi/2<z<3pi/2 I get Mod[z+pi/2,pi]=z-pi/2 and then Round[Mod[z+pi/2,pi]/pi-1/2]=0. Thus the second term vanishes while it should be 2EllipticPi[n,m]. Similarly for 3pi/2<z<5pi/2 I get Mod[z+pi/2,pi]=z-3pi/2 and then Round[Mod[z+pi/2,pi]/pi-1/2]=0. Again the second term vanishes while it should be 4EllipticPi[n,m]. I just checked for some positive terms but I suspect this problem always occurs. – Torben Frost Mar 27 '20 at 13:43
  • Just to check if I understood your examples correctly, let's consider the following specific case: With[{n = 3, z = 3 π/2 + π/6, m = 3/5}, N[{EllipticPi[n, z, m], (-1)^Round[Mod[z + π/2, π]/π - 1/2] EllipticPi[n, Mod[z + π/2, π] - π/2, m] + 2 Round[Mod[z + π/2, π]/π - 1/2]}, 20]]. Altho these two expressions agree, you claim that there is a missing 4 EllipticPi[n, m] additional term. Did I get it? – J. M.'s missing motivation Mar 27 '20 at 13:49
  • With that being said, I did my own comparisons using (apologies for the self-promotion) my own package for Carlson integrals, and using the functions in there to compute the incomplete elliptic integral of the third kind seems to support your claim. – J. M.'s missing motivation Mar 27 '20 at 13:56
  • 1
    Yes. I suggest you to evaluate both terms without the N[] term. Then Mathematica gives for the first term EllipticPi[3,5pi/3,3/5] and for the second EllipticPi[3,-pi/3,3/5]. Of course they could be the same, however, using simple mathematical formulas one can show that there is something missing. Since I am more comfortable with mathematical notations this is what I did from the beginning. Maybe this is why I found this problem in the first place. – Torben Frost Mar 27 '20 at 13:59
  • In the meantime, I think this is worth reporting to Support. – J. M.'s missing motivation Mar 27 '20 at 14:05
  • Ok. Shall I report it or would you prefer to report it? Since you have more experience with Mathematica you might be able to describe the problem more efficiently than I would be. – Torben Frost Mar 27 '20 at 14:08
  • It's good to have multiple confirmatory reports, so you should also send a report even if I make one too. It would be helpful if you can tack on your analytic proof that Mathematica's quasiperiodicity relation is mistaken. – J. M.'s missing motivation Mar 27 '20 at 14:11

0 Answers0