7.28 bug in ellipticf(z, k), maple v.5 to maple 8 (30.6.02)

7.28.1 Vladimir Bondarenko

According to Maple Help

The incomplete elliptic integral EllipticF is defined by

        EllipticF(z,k) = int(1/sqrt(1-t^2)/sqrt(1-k^2*t^2),t=0..z)

Translation into Mathematica yields

        EllipticF[ArcSin[z], k^2]

Therefore, we can make the following comparison.

Maple 8                            Mathematica 4.2 
EllipticF(z,k)                     EllipticF[ArcSin[z], k^2]

Let us substitute concrete values.

These outputs coinside:

evalf(EllipticF(1/2,1/2),20);      N[EllipticF[ArcSin[1/2], 1/4], 20] 
.52942862705190581774              0.52942862705190581774

Another perfect agreement:

evalf(EllipticF(I,1/2),20);        N[EllipticF[ArcSin[I], 1/4], 20] 
0.+.85122374907118540906*I         0.85122374907118540906 I

Yet another perfect agreement:

evalf(EllipticF(1,I),20);          N[EllipticF[ArcSin[1], -1], 20] 
1.3110287771460599052              1.3110287771460599052

However, these outputs differ

evalf(EllipticF(I,I),20);          N[EllipticF[ArcSin[I], -1], 20] 
0.+1.3085903338656260177*I         1.3110287771460599052 I

Question 1) Which of them is correct? (my idea is, the Mathematica’s one)

Question 2) How to prove your answer to 1) in an easy and elegant way? Naturally, one can use the AGM idea but this looks somewhat tedious (me, lazy...)

7.28.2 Robert Israel (4.7.02)

Yes, Mathematica is correct. Note this:

> restart; 
          0.+1.3006012664935504810 I 
          0.+1.30348862004180028836030832586 I

So Maple isn’t even consistent with itself. It seems that whatever numerical method Maple is using for EllipticF works very poorly in this case, which is right on the circle of convergence of the power series. Note that EllipticF(I*t,I) should be I*EllipticF(t,I) for |t| <= 1: I think they are different for |t| > 1 because different branches are chosen.

7.28.3 Christian Hoffmann (5.7.02)

Just a quick hint:

Have look at the arithmetic-geometric mean (AGM) and its connection to elliptic integrals. Certain elliptic integrals obey an invariance relation involving the AGM. A good book on this is

Borwein, J.M., Borwein, P.B., 1987. Pi and the AGM: A study in analytic number theory and computational complexity. Wiley, New York. 414p. (SAM ETHZ) 
Borwein, J.M., Borwein, P.B., 1984. The arithmetric-geometric mean and fast computation of elementary functions. SIAM review 26,3: 351-366.

7.28.4 Carl Devore (9.7.02)

I trust Maple’s numerical integration; I think that is the most well-written part of Maple. We can define the EllipticF function so that it is numerically evaluated via numerical integration:

> EllF:= (z,k)-> evalf(Int(1/sqrt(1-t^2)/sqrt(1-k^2*t^2), t= 0..z);

Now EllF(I,I) will correspond with the Mathematica answer, so I think the Mathematica is correct.

7.28.5 Jim FitzSimons (23.7.02)

This is my correct answer. Using Bill Carlson’s methods.

1.3110287771460599052 I

I think Maple is wrong.