I want to plot the integral $$I(\phi) = \int_0^{\phi} \frac{\mathrm{d} \theta}{\sqrt{1 +\sin(\theta)^2}}$$
In Mathematica notation, it is a case of an elliptic integral of the first kind with $m=-1$,
$F(\phi| m) = \int_0^{\theta} \frac{\mathrm{d} \theta}{\sqrt{1-m \sin(\theta)^2}}$, so I have $I(\phi) = F(\phi| -1)$.
In Maple notation, it is a case of an elliptic integral of the first kind with $k = i$,
$F(\sin(\phi), k) = \int_0^{\theta} \frac{\mathrm{d} \theta}{\sqrt{1-k^2 \sin(\theta)^2}}$, so I have $I(\phi) = F(\sin(\phi), i)$.
Upon plotting $I(\phi)$ and $F(\phi| -1)$ in Mathematica I find perfect agreement.
Upon plotting $I(\phi)$ (in red) and $F(\sin(\phi), i)$ (in green) in Maple I get the result below:
How can such a difference arise?
EDIT:
Code for Mathematica:
F1 = Integrate[1/Sqrt[1 + Sin[p]^2], {p, 0, phi}]
F2 = EllipticF[phi, -1]
Code for Maple:
F1:= int(1/sqrt(1+sin(theta)^2), theta=0..phi)
F2:= EllipticF(sin(phi), I)
Re@EllipticF[ArcSin[Sin@\[Theta]], I]
-- as Louis implies, no one can be sure about the problem with your code, if you don't share it. $\endgroup$ – Michael E2 Apr 17 '16 at 17:41EllipticF[z, k]
is equivalent toEllipticF[ArcSin[z], k^2]
in Mathematica, in which case the problem is due to the periodicity of sine and the branch cuts of arc sine. $\endgroup$ – Michael E2 Apr 17 '16 at 18:26EllipticF()
is in fact directly equivalent to Mathematica'sInverseJacobiSN[]
.EllipticF[]
uses a different argument convention, and is built so as not to have unneeded branch cuts. $\endgroup$ – J. M.'s ennui♦ Apr 20 '16 at 0:39