# Series Expansion of EllipticNomeQ differs from older Mathematica Version

I am trying to follow the numerical approach on how to calculate EllipticE and EllipticK following this paper. In there on approach uses the EllipticNomeQ, namely

$$q(m) = \exp\left({{ -\pi K(m)}\over{ K(1 - m) }}\right)$$

but with

$$\lambda(m) = { {1 - \sqrt{k'}} \over { 1 + \sqrt{k'}}}$$

and

$$k' = \sqrt{1 - m}$$

what is required is a series expansion of $$q(m(\lambda))$$ with respect to $$\lambda$$. The paper suggests to use

Series[ EllipticNomeQ[ 1 - ((1 - 2x) / (1 + 2x))^4 ], {x, 0, 30}]


Unfortunately, this does not provide useful coefficients. For the expansion to order 1 it provides

SeriesData[x, 0, { InverseSeries[0, 0]^4, 64 InverseSeries[0, 0]^3 Derivative[0, 1][InverseSeries][ 0, 0]}, 0, 2, 1]


Obviously, it was working in 2012 which also can be seen on the OEIS. Fortunately, the OEIS provides code to calculate the coefficients directly, but the fact that the expansion is not working is unsatisfying.

The expected result (see OEIS) is $$x + 2 x^5 + 15 x^9 + 150 x^{13} + 1707 x^{17} + \mathcal{O}(x^{21})$$

Which trick am I missing?

• I get the expected result in V13.0.1. (I'm confused about which version you're using and which is the older one referred to in the title, assuming "Mathematic" is a typo for "Mathematica".) Commented Jun 14, 2022 at 14:29
• I also get the expected result in version 13; this might have been a bug that got fixed. Commented Jun 14, 2022 at 15:21
• V11.3.0 also gives the correct result. Commented Jun 14, 2022 at 15:53
• @MichaelE2 lol, changed the title. By old version I am referring to the version that was used at the time the paper was written. 2011 it was likely version 8 and most likely working. Commented Jun 15, 2022 at 6:17
• @J.M. I checked at home on version 13.0.1 for Linux ARM and it works as well. So It might be a "bug" similar to the one linked above Commented Jun 15, 2022 at 6:21

Clear["Global*"]
$Version (* "13.0.1 for Mac OS X x86 (64-bit) (January 28, 2022)" *) f[x_] = EllipticNomeQ[1 - ((1 - 2 x)/(1 + 2 x))^4]; f2[x_] = Series[f[x], {x, 0, 30}] // Normal (* x + 2 x^5 + 15 x^9 + 150 x^13 + 1707 x^17 + 20910 x^21 + 268616 x^25 + 3567400 x^29 *) Plot[{f[x], f2[x]}, {x, -.75, .75}, PlotStyle -> {Automatic, Dashed}, PlotLegends -> Placed["Expressions", {.8, .2}]]  • Sorry, my mistake from fiddling around with the problem (copied some intermediate stuff). Series is actually around 0 not 1. Changed the post accordingly Commented Jun 14, 2022 at 14:23 • In 13 on Windows 10 Series[EllipticNomeQ[1 - ((1 - 2 x)/(1 + 2 x))^4], {x, 0, 30}] results in $$x+2 x^5+15 x^9+150 x^{13}+1707 x^{17}+20910 x^{21}+268616 x^{25}+3567400 x^{29}+O\left(x^{31}\right) .$$ Commented Jun 14, 2022 at 14:34 • I have $Version ->"11.1.1 for Microsoft Windows (64-bit) (April 18, 2017)"...putting your code I get the InverseSeries[0,0]` stuff from above. Well, screams for an update. I'll check on my Pi4 at home. :) Commented Jun 14, 2022 at 14:47