# Incomplete elliptic integral of the second kind with negative parameter

Abramowitz & Stegun 17.4.18 gives the following formula for $E(u, -m)$:

$$E(u,-m) = (1+m)^{1/2} \{E(u(1+m)^{1/2},m(m+1)^{-1}) - m(1+m)^{-1/2} \mathrm{sn}(u(1+m)^{1/2}, m(1+m)^{-1})\; \mathrm{cd}(u(1+m)^{1/2}, m(1+m)^{-1}) \}.$$

However, a quick Mathematica test does not seem to verify this relationship:

u = RandomReal[]; m = RandomReal[]; a = u Sqrt[1 + m]; b = m / (m + 1);

Sqrt[1 + m] (EllipticE[a, b] - m / Sqrt[1 + m] JacobiSN[a, b] JacobiCD[a, b])
EllipticE[u, -m]

>>> 0.136459
>>> 0.214315 + 0. I


Does anyone know the correct equation, or have I made an error somewhere?

• Common mistake with Mathematica Elliptic functions. The first argument to EllipticE is $\phi$. So to get $E(u,m)$ you need to use $\texttt{EllipticE[JacobiAmplitude[u,m],m]}$. – Somos Oct 7 '17 at 18:54
• @Somos, thanks for the reply. I still can't get it working, however; do you have a MWE that I could use? – emprice Oct 7 '17 at 19:00
• Compare with NIST 19.7.5 equation for $E(\phi,ik)$ – Somos Oct 7 '17 at 19:31

test[u_,m_] := Module[{s, a, b}, s = Sqrt[1 + m]; a = u s; b = m/(1 + m);

• Thanks! I think you stumbled on a correction to the formula at the same time as showing me the difference between $u$ and $\phi$... The whole thing would have been multiplied by $s$ according to what's in the book, but this way actually works. – emprice Oct 7 '17 at 19:12