Ramanujan’s theories of elliptic functions to alternative bases — a symbolic excursion

FRANK G. GARVAN^{†}

†Department of Mathematics, University of Florida, Gainesville, FL 32611, U.S.A.

(Submitted 2 March 1994; Revised 16 December 2005)

Recently Berndt, Bhargava and Garvan were able to prove all of Ramanujan’s results in the notebooks on his theories of elliptic functions to alternative bases. In this paper we show how we used MAPLE to understand, prove and generalize some of Ramanujan’s results.

1. Introduction

We begin by recalling some of the classical results on elliptic integrals, hypergeometric series and Jacobi’s theta functions. Let 0 < k < 1, then the complete elliptic integral of the first kind is defined by

K(k) := ∫_{0}^{2π} \frac{dφ}{\sqrt{1 − k^{2} sin^{2} φ}}.  (1.1)

We let k′ := \sqrt{1 − k^{2}} and K′ := K(k′). The nome q = q(k) is defined by

q := exp(−πK′/K).  (1.2)

We define the Gaussian hypergeometric series

2F_{1}(a, b; c; z) = 1 + \frac{a · b}{1 · c}z + \frac{a(a + 1)b(b + 1)}{1 · 2 c(c + 1)}z^{2} + ⋯  (1.3)

= ∑_{n=0}^{∞} \frac{(a)_{n}(b)_{n}}{(c)_{n}n!} z^{n},

where (a)_{n} = a(a + 1) ⋯ (a + n − 1). If we write the integrand in (1.1) as a series and integrate term by term we find that

K(k) = \frac{π}{2}_{2}F_{1}(\frac{1}{2}, \frac{1}{2}; 1; k^{2}).  (1.4)

We have the following formula

2F_{1}(\frac{1}{2}, \frac{1}{2}; 1; k^{2}) = θ_{3}^{2}(q),  (1.5)

The author was supported in part by NSF Grant DMS-9208813.

where θ_{3}(q) := ∑_{n=−∞}^{∞} q^{n^{2}}. This may be written as

K(k) = \frac{π}{2} θ_{3}^{2}(q).  (1.6)

For a more detailed account of these classical results see Borwein and Borwein (1987). In Ramanujan’s theories of elliptic functions to alternative bases we replace q by

q_{r} := q_{r}(x) := exp (−π csc(π/r)\frac{_{2}F_{1}(\frac{1}{r}, \frac{r−1}{r}; 1; 1 − x)}{_{2}F_{1}(\frac{1}{r}, \frac{r−1}{r}; 1; x)}) ,  (1.7)

for r = 2, 3, 4, 6 and where 0 < x < 1. Here we follow Ramanujan in replacing k^{2} by x. The classical case corresponds to r = 2. In Berndt, Bhargava and Garvan (submitted) we prove all the results in the Ramanujan’s notebooks related to the alternative bases. These include results for modular equations, elliptic functions and hypergeometric transformations. In this paper, we show how we used MAPLE to understand and prove some of Ramanujan’s results.

The arithmetic-geometric mean iteration of Gauss (Borwein and Borwein, 1987, §1.1) can be parametrized in terms of theta functions and is related to the classical base r = 2. It is intimately connected with the quadratic transformation

2F_{1}(\frac{1}{2}, \frac{1}{2}; 1; (\frac{1 − x}{1 + x})^{2}) = (\frac{x + 1}{2})_{2}F_{1}(\frac{1}{2}, \frac{1}{2}; 1; 1 − x^{2})  (1.8)

which is a special case of Gauss’ transformation (Erdéyli, 1953, p.111, Eq.(5))

2F_{1}(a, b; 2b; 4z(1 + z)^{−2}) = (1 + z)^{2a}_{2}F_{1}(a, a − b + \frac{1}{2}; b + \frac{1}{2}; z^{2}).  (1.9)

Borwein and Borwein (1991) have found a cubic analog of the arithmetic-geometric mean iteration and were able to identify a parametrization in terms of q-series. The related hypergeometric transformation is

2F_{1}(\frac{1}{3}, \frac{2}{3}; 1; (\frac{1 − x}{1 + 2x})^{3}) = (\frac{1 + 2x}{3})_{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; 1 − x^{3}).  (1.10)

Berndt, Bhargava and Garvan (submitted) found the following generalization

2F_{1}(a, a + \frac{1}{3}, \frac{a}{2} + \frac{5}{6}; (\frac{1 − x}{1 + 2x})^{3}) = (\frac{1 + 2x}{3})^{3a} _{2}F_{1}(a, a + \frac{1}{3}; \frac{3a}{2} + \frac{1}{2}; 1 − x^{3}).(1.11)

In §2 we show how we used MAPLE to symbolically discover and prove (1.11). We also give generalizations of other higher order transformations related to Ramanujan’s results.

On page 96 of Ramanujan’s first notebook we find the following statement:

“ 1 + 2e^{− \frac{πy}{sin πh}} + 2e^{− \frac{4πy}{sin πh}} + ⋯  (1.12)

= u\sqrt{1 + \frac{h(1 − h)}{1 · 2}x + ⋯}

where y = \frac{1 + \frac{h(1−h)}{1·2}(1 − x) + ⋯}{1 + \frac{h(1−h)}{1·2}x + ⋯}

and u can be expressed in radicals in terms of x and h.” If this statement is interpreted in the obvious way then the claim concerning u is false. In Berndt, Bhargava and Garvan (submitted), we prove this but show that for h = \frac{1}{2}, \frac{1}{3} \frac{1}{4} \frac{1}{6} the claim concerning u is true. In §3 we show how we used MAPLE to solve for u in terms of radicals in the case h = \frac{1}{3}. In §4 we show how we used MAPLE to find a q-series proof for one of Ramanujan’s hypergeometric transformations.

For related recent work in this area see Borwein and Borwein (1991), Borwein, Borwein and Garvan (1994), Borwein, Borwein and Garvan (1993), Hirschhorn, Borwein and Garvan (1993), Shen (1994), Shen (manuscript) and Garvan (1994).

2. Hypergeometric Transformations

First we relate some more of the classical results on theta functions and K(k). With q defined by (1.2) we have the inversion formula

k = \frac{θ_{2}^{2}(q)}{θ_{3}^{2}(q)}.  (2.1)

Here

θ_{2}(q) = ∑_{n=−∞}^{∞} q^{(n+ \frac{1}{2} )^{2}},  (2.2)

and θ_{3}(q) is defined after (1.5). We will need

θ_{4}(q) = ∑_{n=−∞}^{∞}(−1)^{n}q^{n^{2}}.  (2.3)

Combining (1.5) and (2.1) gives

2F_{1}(\frac{1}{2}, \frac{1}{2}; 1; \frac{θ_{2}^{4}(q)}{θ_{3}^{4}(q)}) = θ_{3}^{2}(q).  (2.4)

Using the classical identity

θ_{3}^{4}(q) = θ_{4}^{4}(q) + θ_{2}^{4}(q)  (2.5)

we have

2F_{1}(\frac{1}{2}, \frac{1}{2}; 1; 1 − \frac{θ_{4}^{4}(q)}{θ_{3}^{4}(q)}) = θ_{3}^{2}(q).  (2.6)

The functions θ_{3}^{2}(q), θ_{4}^{2}(q), θ_{3}^{2}(q^{2}), θ_{4}^{2}(q^{2}), are all modular forms of weight one on a certain congruence subgroup. There exist algebraic relations between any 3 of these forms. This can be shown as follows. We choose three of these forms and denote them α(q), β(q), γ(q). Any homogeneous polynomial of degree k in these forms is a modular form of weight k. The dimension of the relevant space of modular forms of weight k ∼ c_{1}k, for some non-zero constant c_{1} (see Cohen and Oesterlé (1976)). The number of monomials α^{k_{1}}(q)β^{k_{2}}(q)γ^{k−k_{1}−k_{2}}(q) ∼ \frac{1}{2}k^{2}. It follows that there will be a relation for large enough k. In fact, we find that

θ_{3}^{2}(q^{2}) = \frac{θ_{3}^{2}(q) + θ_{4}^{2}(q)}{2},  (2.7)
θ_{4}^{2}(q^{2}) = \sqrt{θ_{3}^{2}(q)θ_{4}^{2}(q)}.  (2.8)

In (2.7), (2.8) we see the arithmetic-geometric mean. For more discussion see Borwein and Borwein (1987), and Garvan (1994). Equations (2.4), (2.7), (2.8) imply the quadratic transformation (1.8). In Borwein, Borwein and Garvan (1993) we showed how to discover and prove symbolically analogous results related to mean iterations associated with the alternative bases r = 2, 3, 4, 6.

We recall q_{r}(x) is defined in (1.7). It can be shown that

q_{2} (\frac{θ_{2}^{4}(q)}{θ_{3}^{4}(q)}) = q.  (2.9)

The analogous result for r = 3 is

q_{3} (\frac{c^{3}(q)}{a^{3}(q)}) = q,  (2.10)

where

a(q) := ∑_{n,m=−∞}^{∞} q^{m^{2}+mn+n^{2}},  (2.11)

b(q) := ∑_{n,m=−∞}^{∞} ω^{m−n}q^{m^{2}+mn+n^{2}}  (ω = exp(2πi/3)),  (2.12)

c(q) := ∑_{n,m=−∞}^{∞} q^{(m+ \frac{1}{3} )^{2}+(m+ \frac{1}{3} )(n+ \frac{1}{3} )+(n+ \frac{1}{3} )^{2}}.  (2.13)

The results analogous to (2.4), (2.6) are

2F_{1}(\frac{1}{3}, \frac{2}{3}; 1; \frac{c^{3}(q)}{a^{3}(q)}) = _{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; 1 − \frac{b^{3}(q)}{a^{3}(q)}) = a(q).  (2.14)

Here we have used the following analog of (2.5)

a^{3}(q) = b^{3}(q) + c^{3}(q).  (2.15)

The functions a(q), b(q), a(q^{3}), b(q^{3}) are modular forms of weight one on a certain congruence subgroup. As in the case of the theta functions there exist algebraic relations. Analogous to (2.7), (2.8) we find that

a(q^{3}) = \frac{a(q) + 2b(q)}{3},  (2.16)
b(q^{3}) = \sqrt{\frac{b(q)(a^{2}(q) + a(q)b(q) + b^{2}(q))}{3}}.  (2.17)

Equations (2.16), (2.17) lead to a cubically converging mean iteration. See Borwein and Borwein (1991), and Borwein, Borwein and Garvan (1994) for details. Equations (2.14), (2.16), (2.17) imply the cubic transformation (1.10). We now describe how we discovered and proved symbolically (1.11) our generalization of (1.10). We were led to believe some generalization might exist by observing the generalization (1.9) of (1.8) and by noting that Goursat (Erdéyli, 1953, p.114) has a list of cubic transformations with one free parameter. Our generalization (1.11) does not seem to follow from Goursat’s list. We considered the following question.

Question. When does

2F_{1}(A, B; C; (\frac{1 − x}{1 + 2x})^{3}) = (\frac{2x + 1}{3})^{d} _{2}F_{1}(a; b; c; 1 − x^{3}) ?  (2.18)

Our first idea was to use MAPLE to compute the Taylor series expansions about x = 1 of the left and right sides. Equating coefficients gives equations for A, B, C, a, b, c, d. However the complexity of these equations grows rapidly although we were able to find a solution with some heavy massaging. A better method involves using differential equations. It is well known that the hypergeometric function y = _{2}F_{1}(a, b; c, x) satisfies the second order linear differential equation

x(1 − x)\frac{d^{2}y}{dx^{2}} + (c − (a + b + 1)x)\frac{dy}{dx} − aby = 0.  (2.19)

We wrote two MAPLE procedures: one whose input was a second order linear differential equation satisfied by y(x) and whose output was the second order linear differential equation satisfied by y(g(x)), for a given function g(x); the other was a procedure with the same input but whose output was the second order linear differential equation satisfied by m(x)y(x), for a given function m(x). See the MAPLE procedures DE1 and DE2 given in Program 1 in the Appendix. We followed the following steps:

STEP 1. Use MAPLE to compute the second order linear differential equation for the left and right sides of (2.18):

L = L(a, b, c, d, A, B, C, x, y, y′, y′′) := α_{1}(x)y′′ + β_{1}(x)y′ + γ_{1}(x)y = 0;
R = R(a, b, c, d, A, B, C, x, y, y′, y′′) := α_{2}(x)y′′ + β_{2}(x)y′ + γ_{2}(x)y = 0.

STEP 2. We want \frac{α_{1}(x)}{α_{2}(x)} = \frac{β_{1}(x)}{β_{2}(x)} = \frac{γ_{1}(x)}{γ_{2}(x)}. So in MAPLE we factor the following:

β_{2}(x)\frac{α_{1}(x)}{α_{2}(x)} − β_{1}(x),  (1)

and

γ_{2}(x)\frac{α_{1}(x)}{α_{2}(x)} − γ_{1}(x).  (2)

STEP 3. We find that the numerator of each expression (1), (2) above is a polynomial in x with coefficients that are linear in a, b, c, d, A, B, C for (1) and quadratic for (2). Thus we have five linear and five quadratic equations that we solve in MAPLE.

STEP 4. We reset a, b, c, d, A, B, C in terms of the solution found in STEP 3 and verify that \frac{L}{R} is independent of y, y′ and y′′. This guarantees that both the left and right sides of (2.18) satisfy the same differential equation.

STEP 5. Check that x = 1 is a regular singular point for the differential equation and that the values of y(1), y′(1) agree for both sides of (2.18).

We have carried out STEPS 1–5 in MAPLE and found and proved our generalization (1.11). The MAPLE program for doing STEPS 1–3 is given in Program 1 in the Appendix. In the program L, R in STEP 1 are denoted by leftde and rightde respectively. Expressions (1), (2) in STEP 2 are denoted by yy1 and yy2 respectively. In STEP 3 the five linear equations found are

−3 c + 3 a + 3 b − B + C − A = 0,
−5 − 4 d − 6 c + 6 a + 6 b + 6 C + 3 A + 3 B = 0,
−9 − 3 A − 3 B + 12 C = 0,
−6 − 3 a − 3 b + 8 C + A + B = 0,
4 d + 2 − 6 a − 6 b = 0.

The five quadratic equations are

−2 d + 6 dc − 6 da − 6 db + 9 AB = 0,
−18 AB − 12 db + 12 dc − 12 da + 4 d^{2} = 0,
−9 ab + 9 AB = 0,
−36 ab + 6 da + 6 db + 2 d = 0,
−36 ab + 12 da + 12 db − 4 d^{2} = 0.

These ten equations are stored in the set S. The MAPLE command solve(S) results in the following solutions:

\{d = d, a = \frac{d}{3}, B = \frac{d}{3}, b = \frac{d}{3} + \frac{1}{3}, A = \frac{d}{3} + \frac{1}{3}, c = \frac{1}{2} + \frac{d}{2}, C = \frac{5}{6} + \frac{d}{6}\} ,

\{d = d, b = \frac{d}{3}, B = \frac{d}{3}, A = \frac{d}{3} + \frac{1}{3}, c = \frac{1}{2} + \frac{d}{2}, C = \frac{5}{6} + \frac{d}{6}, a = \frac{d}{3} + \frac{1}{3}\} ,

\{d = d, a = \frac{d}{3}, b = \frac{d}{3} + \frac{1}{3}, B = \frac{d}{3} + \frac{1}{3}, c = \frac{1}{2} + \frac{d}{2}, C = \frac{5}{6} + \frac{d}{6}, A = \frac{d}{3}\} ,

\{d = d, b = \frac{d}{3}, B = \frac{d}{3} + \frac{1}{3}, c = \frac{1}{2} + \frac{d}{2}, C = \frac{5}{6} + \frac{d}{6}, a = \frac{d}{3} + \frac{1}{3}, A = \frac{d}{3}\} .

There are four solutions since the hypergeometric function _{2}F_{1}(a, b; c; x) is symmetric in a and b. The third solution corresponds to (1.11).

Our method is easily adapted to find other higher order hypergeometric transformations. We examined each of Ramanujan’s hypergeometric transformations related to his theories of elliptic functions to alternative bases. Ramanujan’s results on these alternative theories are on six pages, pp. 257–262, of the second notebook, Ramanujan (1957). These are the first six pages in the 100 unorganized pages of material that immediately follow the 21 organized chapters in the second notebook. We list the hypergeometric transformations from these pages:

2F_{1}(\frac{1}{3}, \frac{2}{3}; 1; 1 − (\frac{1 − x}{1 + 2x})^{3}) = (1 + 2x)_{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; x^{3})  (p.258)  (2.20)

(1 + x + x^{2})_{2}F_{1}(\frac{1}{2}, \frac{1}{2}; 1; \frac{x^{3}(2 + x)}{1 + 2x}) = \sqrt{1 + x^{2}} _{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; \frac{27x^{2}(1 + x)^{2}}{4(1 + x + x^{2})^{3}} ) (p.258) (2.21)

2F_{1}(\frac{1}{3}, \frac{2}{3}; 1; \frac{x(3 + x)^{2}}{2(1 + x)^{3}} ) = (1 + x)_{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; \frac{x^{2}(3 + x)}{4})  (p.258) (2.22)

(2 + 2x − x^{2})_{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; \frac{27x(1 + x)^{4}}{2(1 + 4x + x^{2})^{3}} )  (2.23)

= 2(1 + 4x + x^{2})_{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; \frac{27x^{4}(1 + x)}{2(2 + 2x − x^{2})^{3}} ) (p.258)

2F_{1}(\frac{1}{2}, \frac{1}{2}; 1; \frac{2x}{1 + x}) = \sqrt{1 + x}_{2}F_{1}(\frac{1}{4}, \frac{3}{4}; 1; x^{2})  (p.260)  (2.24)

2F_{1}(\frac{1}{4}, \frac{3}{4}; 1; 1 − (\frac{1 − x}{1 + 3x})^{2}) = \sqrt{1 + 3x}_{2}F_{1}(\frac{1}{4}, \frac{3}{4}; 1; x^{2})  (p.260)  (2.25)

\sqrt{27 − 18x − x^{2}} _{2}F_{1}(\frac{1}{4}, \frac{3}{4}; 1; \frac{64x}{(3 + 6x − x^{2})^{2}} )  (2.26)

= 3\sqrt{3 + 6x − x^{2}} _{2}F_{1}(\frac{1}{4}, \frac{3}{4}; 1; \frac{64x^{3}}{(27 − 18x − x^{2})^{2}} ) (p.260)

\sqrt{1 + 2x}_{2}F_{1}(\frac{1}{6}, \frac{5}{6}; 1; \frac{27x^{2}(1 + x)^{2}}{4(1 + x + x^{2})^{3}} )  (2.27)

= \sqrt{1 + x + x^{2}} _{2}F_{1}(\frac{1}{2}, \frac{1}{2}; 1; \frac{x(2 + x)}{1 + 2x}) (p.262)

We were able to find generalizations of (2.20), (2.21), (2.24), (2.25), (2.27) but (2.22), (2.23) and (2.26) do not have such generalizations. We list the generalizations.

2F_{1}(d, d + \frac{1}{3}; \frac{3}{2}d + \frac{1}{2}; 1 − (\frac{1 − x}{1 + 2x})^{3}) = (1 + 2x)^{3d} _{2}F_{1}(d, d + \frac{1}{3}; \frac{1}{2}d + \frac{5}{6}; x^{3}).(2.28)

2F_{1}(3d, d + \frac{1}{3}; 2d + \frac{2}{3}; \frac{x^{3}(2 + x)}{1 + 2x})  (2.29)

= (\frac{1 + 2x}{(1 + x + x^{2})^{2}} )^{3d} _{2}F_{1}(2d, 2d + \frac{1}{3}; 3d + \frac{1}{3}; \frac{27x^{2}(1 + x)^{2}}{4(1 + x + x^{2})^{3}} ).

2F_{1}(2d, B; 2B; \frac{2x}{1 + x}) = (1 + x)^{2d} _{2}F_{1}(d, d + \frac{1}{2}; B + \frac{1}{2}; x^{2}).  (2.30)

2F_{1}(d, d + \frac{1}{2}; \frac{4}{3}d + \frac{2}{3}; \frac{8x(1 + x)}{(1 + 3x)^{2}}) = (1 + 3x)^{2d} _{2}F_{1}(d, d + \frac{1}{2}; \frac{2}{3}d + \frac{5}{6}; x^{2}). (2.31)

2F_{1}(d, d + \frac{2}{3}; d + \frac{5}{6}; \frac{27x^{2}(1 + x)^{2}}{4(1 + x + x^{2})^{3}} )  (2.32)

= (\frac{1 + x + x^{2}}{1 + 2x} )^{3d} _{2}F_{1}(3d, d + \frac{1}{3}; 2d + \frac{2}{3}; \frac{x(2 + x)}{1 + 2x}).

We note that (2.20), (2.28) are (1.10), (1.11) respectively with x replaced by \frac{1−x}{1+2x}. Equation (2.29) was given in Berndt, Bhargava and Garvan (submitted). Equations (2.30)

– (2.32) probably follow from known transformations. In §4 we show how we used MAPLE to find a q-series proof of (2.21) that avoids differential equations. As well as (2.28)-(2.31) we found the following transformations.

2F_{1}(3d, 2d + \frac{1}{6}; d + \frac{5}{6}; \frac{(x − 1)(x + 3)^{3})}{16x^{3}})  (2.33)

= (\frac{16x^{3}}{(x^{2} + 6x − 3)^{2}} )^{3d} _{2}F_{1}(2d, 2d + \frac{1}{3}; d + \frac{5}{6}; \frac{27(x + 1)^{3}(x^{2} − 1)}{(x^{2} + 6x − 3)^{3}}),

2F_{1}(3d, 2d + \frac{1}{6}; 4d + \frac{1}{3}; \frac{x^{3}(x + 2)}{2x + 1})  (2.34)

= (\frac{4(1 + 2x)}{(2 + 2x − x^{2})^{2}} )^{3d} _{2}F_{1}(2d, 2d + \frac{1}{3}; 3d + \frac{1}{2}; \frac{27x^{4}(1 + x)}{2(2 + 2x − x^{2})^{3}} ).

2F_{1}(d, d + \frac{2}{3}; d + \frac{5}{6}; \frac{(x − 1)(x + 3)^{3}}{16x^{3}} )  (2.35)

= x^{3d}_{2}F_{1}(2d, 2d + \frac{1}{3}; d + \frac{5}{6}; \frac{(x − 1)(x + 1)}{8}).

2F_{1}(d, d + \frac{2}{3}; d + \frac{5}{6}; \frac{(1 − x)^{3}(3x + 1)}{16x^{3}})  (2.36)

= x^{3d}_{2}F_{1}(2d, 2d + \frac{1}{3}; 3d + \frac{1}{2}; \frac{9(1 − x)(x + 1)}{8}).

Equations (2.33)–(2.35) were given in Berndt, Bhargava and Garvan (submitted). Equation (2.36) is new. It would be interesting to investigate which of the above transformations follow from known transformations. We now briefly sketch how we found (2.36). We need the following Eisenstein series studied by Ramanujan. We define

M(q) := 1 + 240 ∑_{n=1}^{∞} \frac{n^{3}q^{n}}{1 − q^{n}} ,  (2.37)

N(q) := 1 − 540 ∑_{n=1}^{∞} \frac{n^{5}q^{n}}{1 − q^{n}} .  (2.38)

We note that M(q) and N(q) are modular forms of weight 4 and 6 respectively. It can be shown that

2F_{1}^{4}(\frac{1}{6}, \frac{5}{6}; 1; \frac{1}{2} − \frac{N(q)}{2M^{3/2}(q)}) = M(q),  (2.39)

which is analogous to (2.4) and (2.14). A method for discovering symbolically such parametrizations is given in Borwein, Borwein and Garvan (1993). In §4 we show how we found a parametrization of (2.21) using MAPLE. If we let

z = a(q),  (2.40)

and

x = \frac{c^{3}(q)}{a^{3}(q)},  (2.41)

then we have the following identities due to Ramanujan:

M(q^{3}) = z^{4}(1 − \frac{8}{9}x),  (2.42)
N(q^{3}) = z^{6}(1 − \frac{4}{3}x + \frac{8}{27}x^{2}).  (2.43)

Hence after replacing q by q^{3} in (2.39) and using (2.40)–(2.43), and (2.14) we have

2F_{1}^{4}(\frac{1}{6}, \frac{5}{6}; 1; \frac{1}{2} − \frac{(1 − \frac{4}{3}x + \frac{8}{27}x^{2})}{2(1 − \frac{8}{9}x)^{3/2}}) = (1 − \frac{8}{9}x)_{2}F_{1}^{4}(\frac{1}{3}, \frac{2}{3}; 1; x).  (2.44)

Replacing x by \frac{9}{8}(1 − x^{2}) gives

2F_{1}(\frac{1}{6}, \frac{5}{6}; 1; \frac{(1 − x)^{3}(3x + 1)}{16x^{3}}) = \sqrt{x}_{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; \frac{9}{8}(1 − x)(1 + x)).  (2.45)

We then used MAPLE to find the generalization (2.36).

3. An Identity from Ramanujan’s First Notebook

We now examine Ramanujan’s statement given in (1.12). We rewrite the equation as

θ_{3}(exp(−πy/ sin(πh))) = u\sqrt{_{2}F_{1}(h, 1 − h; 1; x)},  (3.1)

where

y = \frac{_{2}F_{1}(h, 1 − h; 1; 1 − x)}{_{2}F_{1}(h, 1 − h; 1; x)}.

If Ramanujan means that u is contained in some radical extension of the field ℚ(↶, ≂), the field of rational functions in x and h, then the statement is false for general h. We sketch the proof given in Berndt, Bhargava and Garvan (submitted). From (Berndt, 1991, p.90) we have

exp(−πy/ sin(πh))  (3.2)

= x exp(ψ(h) + ψ(1 − h) + 2γ)

× \{1 + (2h^{2} − 2h + 1)x + (1 − \frac{7}{2}(h − h^{2}) + \frac{13}{4}(h − h^{2})^{2})x^{2} + ⋯ \} ,

where ψ(x) is the logarithmic derivative of the Gamma function and γ is Euler’s constant. We find that the quantity exp(ψ(h) + ψ(1 − h) + 2γ) is rational for h = \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \frac{1}{6} but transcendental for h = \frac{1}{5}. In fact from (Berndt, 1985, p.192) we have

exp(2ψ(\frac{1}{2}) + 2γ) = \frac{1}{16},
exp(ψ(\frac{1}{3}) + ψ(\frac{2}{3}) + 2γ) = \frac{1}{27},
exp(ψ(\frac{1}{4}) + ψ(\frac{3}{4}) + 2γ) = \frac{1}{64},
exp(ψ(\frac{1}{6}) + ψ(\frac{5}{6}) + 2γ) = \frac{1}{432},

exp(ψ(\frac{1}{5}) + ψ(\frac{4}{5}) + 2γ) = 5^{−5/2} (\frac{\sqrt{5} + 1}{2})^{−\sqrt{5}} .

We are led to conjecture the following.

Conjecture 3.1. Let 0 < h ≤ \frac{1}{2} and suppose h ∈ ℚ. Then exp(ψ(h) + ψ(1 − h) + 2γ) is rational if and only if h = \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \frac{1}{6}.

If u(x, h) were algebraic over ℚ(↶, ≂) then u(x, \frac{1}{5}) would be algebraic over ℚ(↶). Now the functions \sqrt{_{2}F_{1}(h, 1 − h; 1; x)} and, by (3.2), θ_{3}(exp(−πy/ sin(πh))) have Taylor expansions about x = 0. Thus (3.1) implies that u has a Taylor expansion about x = 0. But u(x, \frac{1}{5}) algebraic over ℚ(↶) implies that the coefficient of x^{1} in the Taylor expansion of u(x, \frac{1}{5}) is algebraic over ℚ. But this coefficient is exp(ψ(\frac{1}{5}) + ψ(\frac{4}{5}) + 2γ) which is transcendental, and we have a contradiction. Hence the statement is false for general h.

In Berndt, Bhargava and Garvan (submitted) we found that the statement is true for h = \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \frac{1}{6}. We summarize our results in the following theorem.

Theorem 3.2. Ramanujan’s statement (1.12) is true for h = \frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \frac{1}{6}. If 0 < x < 1 then

u(x, \frac{1}{2}) = 1;  (1)
u(x, \frac{1}{3}) = \frac{2m^{\frac{1}{4}}}{\sqrt{m^{2} + 6m − 3}};  (2a)

where

m = \frac{φ − \sqrt{(φ + 2)(φ − 6)}}{2}  (2b)

and φ is the root of the cubic equation

x = \frac{27(φ + 2)^{2}}{(φ + 6)^{3}}  (2c)

that is greater then 6;

u(x, \frac{1}{4}) = (\frac{1 + \sqrt{1 − x}}{2})^{\frac{1}{4}} ;  (3)

u(x, \frac{1}{6}) = \frac{\sqrt{\sqrt{1 + 2p} + \sqrt{1 − p^{2}}}}{\sqrt{p}(1 + p + p^{2})^{\frac{1}{4}}} ;  (4)

where

p = \frac{−1 + \sqrt{1 + 4y}}{2}

and y is the root of the cubic equation

x = \frac{27y^{2}}{4(1 + y)^{3}}

which lies between 0 and 2.

We now show how we used MAPLE to discover and prove (2) above in Theorem 3.2. If x = c^{3}(q)/a^{3}(q) then, from (2.10), (2.14), and (3.1) we have

θ_{3}^{2}(q) = u^{2}(x, \frac{1}{3})_{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; \frac{c^{3}(q)}{a^{3}(q)}),  (3.3)

so that

u(x, \frac{1}{3}) = \frac{θ_{3}(q)}{\sqrt{a(q)}}.  (3.4)

We define the cubic multiplier

m := \frac{θ_{3}^{2}(q)}{θ_{3}(q^{3})}.  (3.5)

Then is can be shown that

x = \frac{c^{3}(q)}{a^{3}(q)} = \frac{27(m + 1)^{3}(m^{2} − 1)}{(m^{2} + 6m − 3)^{3}},  (3.6)

and

u^{2} = u^{2}(x, \frac{1}{3}) = \frac{θ_{3}^{2}(q)}{a(q)} = \frac{4m^{\frac{3}{2}}}{(m^{2} + 6m − 3)}.  (3.7)

So to find u solvably in terms of x it is enough to find m solvably in terms of x. It is not immediately clear from (3.6) whether this can be done. We let

P (X, M) := (M^{2} + 6M − 3)^{3}X − 27(M + 1)^{3}(M^{2} − 1),

so that P (x, m) = 0. Since P (X, M) is linear in X, we see that P (X, M) is irreducible as a polynomial in ℚ(𝕏)[𝕄]. We would like to find the Galois group of P. For i = 1, 2, …, 20 we used MAPLE to calculate the Galois group of Q_{i}(M) := P (i, M) ∈ ℚ[𝕄] when Q_{i}(M) was irreducible. In each case we found that the Galois group was ℤ_{⊭} × 𝕊_{⋭}. This would seem to suggest that the Galois group of P was G := ℤ_{⊭} × 𝕊_{⋭}. A set of generators is (1234), (15)(36). We observe that the set

{{1, 3}, {2, 4}, {5, 6}}

is invariant under the generators and thus under G. We assume that G is the Galois group of P and that φ_{1}, φ_{2}, …, φ_{6} are the roots of the polynomial over some splitting field. We observe that if σ ∈ G fixes φ_{1} then it also fixes φ_{3}. It follows that

φ_{3} ∈ ℚ(↶)[φ_{⊮}].  (3.8)

We now try to identify the roots φ_{i} as q-series. From (3.6) we know that

\frac{27(m + 1)^{4}(m − 1)}{(m^{2} + 6m − 3)^{3}} = \frac{c^{3}(q)}{a^{3}(q)} = 27q + ⋯ = x,  (3.9)

where

m = \frac{θ_{3}^{2}(q)}{θ_{3}^{2}(q^{3})} = 1 + · · · .

Other q-series solutions of (3.9) besides m should correspond to the φ_{i}. We find six solutions. One solution is m which we label as φ_{1}. Four solutions involve fractional powers of q. The remaining solution must be φ_{3} because (3.8) would indicate that φ_{3} does not involve fractional powers of q. We write the first term in the q-series expansions.

φ_{1} = \frac{θ_{3}^{2}(q)}{θ_{3}^{2}(q^{3})} = 1 + ⋯,
φ_{2} = −1 + 4c_{1}q^{\frac{1}{4}} + ⋯,
φ_{3} = \frac{1}{q} + ⋯,
φ_{4} = −1 + 4c_{2}q^{\frac{1}{4}} + ⋯,
φ_{5} = −1 + 4c_{3}q^{\frac{1}{4}} + ⋯,
φ_{6} = −1 + 4c_{4}q^{\frac{1}{4}} + ⋯,

where each c_{j}^{4} = 1. We then used MAPLE and equation (3.9) to compute the first 50 terms of the q-series expansion of φ_{3}. We used the MAPLE procedure etamake, which is in Program 2 in the Appendix, to convert our q-series expansion into an eta-product. This led us to conjecture

φ_{3} = \frac{θ_{2}^{2}(q)}{θ_{2}^{2}(q^{3})}.  (3.10)

We also used the fact that the theta functions θ_{j}(q) have well known product expansions. See §4 for some examples in using etamake. Alternatively we could have used Andrews’ (Andrews, 1985) algorithm for converting a q-series expansion into a product. In view of (3.8) we try to write the right side of (3.10) in terms of x and m. From equations (1.17), and (2.13)–(2.15) of Berndt, Bhargava and Garvan (submitted) we find

\frac{θ_{2}^{2}(q)}{θ_{2}^{2}(q^{3})} = \frac{3 + m}{m − 1}.  (3.11)

Now (3.10) is easily proved by showing that the left side of (3.9) is invariant under

m ⟼ \frac{3 + m}{m − 1}.

Equation (3.10) follows and we have also verified (3.8). From the remarks before (3.8) we suspect that

φ := φ_{1} + φ_{3} = m + \frac{3 + m}{m − 1},  (3.12)

satisfies a cubic over ℚ(↶). This is a linear problem. For i = 0, 1; j = 0, 1, 2, 3; we use MAPLE to compute the q-series expansions of x^{i}φ^{j} up to q^{17}. This gives an 8 × 18 matrix A. In MAPLE we find the kernel of A^{t} which leads us to conjecture the following cubic relation

(φ + 6)^{3}x − 27(φ + 2)^{2} = 0.  (3.13)

Once we have (3.13) it is trivial to prove. We simply verify that

\frac{27(φ + 2)^{2}}{(φ + 6)^{3}} = \frac{27(m + 1)^{3}(m − 1)}{(m^{2} + 6m − 3)^{3}}  (3.14)

where φ = m + \frac{3+m}{m−1}. Equation (3.13) then follows by (3.6). Similarly we suspect that φ_{1}φ_{3} also satisfies a cubic over ℚ(↶). Instead we observe that

φ_{1} + φ_{3} = m + \frac{3 + m}{m − 1}  (3.15)

= \frac{m^{2} + 3}{m − 1}

= \frac{m(m + 3)}{m − 1} − 3 = φ_{1}φ_{3} − 3.  (3.16)

Hence y = φ_{1} = m satisfies the quadratic equation

y^{2} − φy + (φ + 3) = 0.  (3.17)

We note that (3.14), (3.6) give equation (2c). Some care needs to be taken in deciding which root is taken in (3.17) and (2c). The details are given in Berndt, Bhargava and Garvan (submitted).

4. Parametrizing a hypergeometric transformation of Ramanujan

In this section we examine Ramanujan’s hypergeometric transformation (2.21). In Berndt, Bhargava and Garvan (submitted) we found a q-series proof. Here we show how we used MAPLE to find this proof. Such a proof hopefully helps us to understand how Ramanujan was led to such an identity.

We let

α = α(p) := \frac{p^{3}(2 + p)}{1 + 2p}, β = β(p) := \frac{27p^{2}(1 + p)^{2}}{4(1 + p + p^{2})^{3}} .  (4.1)

We want to show that

(1 + p + p^{2})_{2}F_{1}(\frac{1}{2}, \frac{1}{2}; 1; α) = \sqrt{1 + 2p}_{2}F_{1}(\frac{1}{3}, \frac{2}{3}; 1; β),  (4.2)

which is (2.21). We suspect that this transformation can be parametrized by a q-series of the form

p = c_{1} q + · · · .  (4.3)

In view of (2.4), (2.14), and (4.1) we suspect that we can find such a q-series which will satisfy

β(p) = \frac{c^{3}(q^{2})}{a^{3}(q^{2})},  α(p) = \frac{θ_{2}^{4}(q^{3})}{θ_{3}(q^{3})}.  (4.4)

Our goal is identify this q-series p. Then the proof of (4.2) should follow from (2.4), (2.14) together with some additional q-series identities. The idea is to use MAPLE to compute the first 50 terms (say) of the q-series expansion of p, assuming β = c^{3}(q^{2})/a^{3}(q^{2}) and then identify the series p.

We have written a short MAPLE program that computes p. See Program 2 in the Appendix. The MAPLE procedure find finds the first n terms of the q-series expansion of p, assuming p = 2q + · · ·. We leave it to the reader to write a program to compute the q-series expansion of

B(q) := \frac{c^{3}(q)}{a^{3}(q)} = 27q − 405q^{2} + 4617q^{3} − 4533q^{4} + · · · .

We have the following MAPLE session:

  > find(B(q^2),q,50);

2q + 2q^{2} − 2q^{3} − 6q^{4} + ⋯ + 35346q^{49} + 20206q^{50} + ⋯

  > xx:=":
  > etamake(",49);

2\frac{η(12τ)^{6}η(3τ)^{3}η(2τ)^{3}}{η(6τ)^{9}η(4τ)^{2}η(τ)}

  > subs(q=-q,xx):
  > etamake(",49);

−2\frac{η(12τ)^{3}η(τ)}{η(4τ)η(3τ)^{3}}

We note that the procedure etaq(q,i,trunk) computes the first trunk terms of the q-series expansion of the eta-product ∏_{n=1}^{∞}(1 − q^{in}), where i is a fixed positive integer. We have used Euler’s pentagonal number theorem

∏_{n=1}^{∞}(1 − q^{n}) = ∑_{n=−∞}^{∞}(−1)^{n}q^{n(3n−1)/2}.

The MAPLE procedure etamake(f,last) computes an eta-product expansion of the qseries f to order O(q^{last}). Here we recall the Dedekind eta-function

η(τ) := q^{\frac{1}{24}} ∏_{n=1}^{∞}(1 − q^{n}), (q = exp(2πiτ)),

which is a modular form of weight \frac{1}{2}. Our MAPLE session above leads us to conjecture

p(q) = 2\frac{η(12τ)^{6}η(3τ)^{3}η(2τ)^{3}}{η(6τ)^{9}η(4τ)^{2}η(τ)} .

We observe that this product seems nicer when q is replaced by −q. It seems that

p(−q) = −2\frac{η(12τ)^{3}η(τ)}{η(4τ)η(3τ)^{3}}.

This is the parametrization that we will use. So we now define

p := p(q) = −2\frac{η(12τ)^{3}η(τ)}{η(4τ)η(3τ)^{3}}.  (4.5)

We need to show that then

α(p) = \frac{θ_{2}^{4}(−q^{3})}{θ_{3}^{4}(−q^{3})} = −\frac{θ_{2}^{4}(q^{3})}{θ_{4}^{4}(q^{3})},  (4.6)

β(p) = \frac{c^{3}(q^{2})}{a^{3}(q^{2})},  (4.7)

\frac{(1 + p + p^{2})}{\sqrt{1 + 2p}} = \frac{a(q^{2})}{θ_{3}^{2}(−q^{3})} = \frac{a(q^{2})}{θ_{4}^{2}(q^{3})}.  (4.8)

The required identity (4.2) will then follow by (2.4) and (2.14). It can be shown that

c(q) = 3\frac{η^{3}(3τ)}{η(τ)},  (4.9)

so that

p = −2\frac{c(q^{4})}{c(q)},  (4.10)

by (4.5). In order to prove (4.6), (4.7) we use MAPLE to identify 2 + p, 1 + p, and 1 + 2p as eta-products. We have the following MAPLE session.

  > c:=q -> 3*q^(1/3)*etaq(q,3,100)^3/etaq(q,1,100):
  > p:=-2*c(q^4)/c(q):
  > series(2+p,q,100);

2 − 2q + 2q^{2} + 2q^{3} − 6q^{4} + ⋯ + 5068632q^{99} + O(q^{100})

  > etamake(",99);

2\frac{η(6τ)^{2}η(4τ)^{3}η(τ)}{η(12τ)η(3τ)^{3}η(2τ)^{2}}

  > series(1+p,q,100);

1 − 2q + 2q^{2} + 2q^{3} − 6q^{4} + ⋯ + 5068632q^{99} + O(q^{100})

  > etamake(",99);

\frac{η(6τ)^{9}η(4τ)η(τ)^{2}}{η(12τ)^{3}η(3τ)^{6}η(2τ)^{3}}

  > series(1+2*p,q,100);

1 − 4q + 4q^{2} + 4q^{3} − 12q^{4} + ⋯ + 10137264q^{99} + O(q^{100})

  > etamake(",99);

\frac{η(6τ)^{2}η(τ)^{4}}{η(3τ)^{4}η(2τ)^{2}}

This leads us to conjecture that

1 + 2p = \frac{θ_{4}^{2}(q)}{θ_{4}(q^{3})},  (4.11)

2 + p = 2\frac{c(q^{4})}{c(q)} \frac{θ_{2}^{2}(q)}{θ_{2}^{2}(q^{3})},  (4.12)

1 + p = \frac{c^{3}(q^{2})}{c^{2}(q)c(q^{4})} = −\frac{c(−q)}{c(q)}.  (4.13)

We have been able to prove (4.11)–(4.13), (4.8), and thus (4.6), (4.7) and (4.2). The details are given in Berndt, Bhargava and Garvan (submitted). Many of the results we needed turned out to be equivalent to identities in Ramanujan’s notebooks.

Acknowledgements. The author would like to thank Alexandre Turull for helpful discussions on Galois groups.

References

Andrews, G.E. (1985). The Theory of Partitions, Encyclopedia of Mathematics and Its Applications,

Vol. 2 (G.-C. Rota ed.). New York: Cambridge University Press. Berndt, B.C. (1985). Ramanujan’s Notebooks, Part I . New York: Springer-Verlag. Berndt, B.C. (1991). Ramanujan’s Notebooks, Part III . New York: Springer-Verlag. Berndt, B.C., Bhargava, S., Garvan, F.G. (submitted). Ramanujan’s theories of elliptic functions to

alternative bases. Borwein, J.M., Borwein, P.B. (1987). Pi and the AGM . New York: Wiley. Borwein, J.M., Borwein, P.B. (1991). A cubic counterpart of Jacobi’s identity and the AGM. Trans.

Amer. Math. Soc. 323, 691–701. Borwein, J.M., Borwein, P.B., Garvan, F.G. (1993). Hypergeometric analogues of the arithmetic-

geometric mean iteration. Constructive Approximation 9, 509–523. Borwein, J.M., Borwein, P.B., Garvan, F.G. (1994). Some cubic modular identities of Ramanujan. Trans.

Amer. Math. Soc. 343, 35–47. Cohen, H., Oesterlé, J. (1976). Dimensions des espaces de formes modulaires, in Modular Functions in

one variable VI, International Summer School of Modular Functions, Bonn 1976, Lecture Notes in Mathematics 627, 69–78. Berlin: Springer.

Erdèyli, A. (1953). Higher Transcendental Functions, vol. 1 . New York: McGraw-Hill. Garvan, F.G. (1994). Cubic modular identities of Ramanujan, hypergeometric functions and analogues

of the arithmetic-geometric mean iteration. In: (G.E. Andrews et. al. eds) Proceedings of the Ramanujan Centenary Conference. Contemp. Math. 166, 245–264.

Hirschhorn, M.D., Garvan, F.G., Borwein, J.M. (1993). Cubic analogues of the Jacobian theta function

θ(z, q). Canad. J. Math. 45, 673–694. Ramanujan, S. (1957). Notebooks (2 volumes). Bombay: Tata Institute of Fundamental Research. Shen, L.-C. (1994). On a definite integral of a hypergeometric function. Proc. Amer. Math. Soc. 120,

1131–1136. Shen, L.-C. (manuscript). On Ramanujan’s theory of elliptic functions based on the hypergeometric

series _{2}F_{1}( \frac{1}{3} , \frac{2}{3} ; 1; x).

Appendix: MAPLE programs

Below we give a listing of two MAPLE programs. Program 1 looks for a generalization of Ramanujan’s cubic transformation (1.10). This program is discussed in §2. Program 2 is used in §4 to identify a parametrization of a hypergeometric transformation due to Ramanujan in terms of q-series. Some examples and descriptions of the procedures are given in §4.

Program 1

DE1:=proc(aa,bb,cc,g)  #Gives the de for y(g(x)) when
                    #aa(x)y" + bb(x)y' + cc(x) y=0 is the de for y.
                    #AA(x) z" + BB(x)z'+CC(x)z=0 is the de for z=y(g(x)).
local g1,g2:
global AA,BB,CC,x:
g1:=diff(g(x),x):
g2:=diff(",x):
AA:=aa(g(x))/g1^2:
BB:=(bb(g(x))/g1-aa(g(x))*g2/g1^3):
CC:=cc(g(x)):
RETURN():
end:
DE2:=proc(aa,bb,cc,m)  #Gives the de for y*m when
                    #aa(x)y" + bb(x)y' + cc(x) y=0 is the de for y.
                    #AA(x) z" + BB(x)z'+CC(x)z=0 is the de for z=y*m.
local g1,m0,m1,m2:
global AA,BB,CC,x:
g1:=diff(g(x),x):
m0:=m(x):
m1:=diff(",x):
m2:=diff(",x):
AA:=aa(x)/m0:
BB:=(bb(x)/m0-2*aa(x)*m1/m0^2):
CC:=(cc(x)/m0-bb(x)*m1/m0^2+2*aa(x)*m1^2/m0^3-aa(x)*m2/m0^2):
RETURN():
end:
aa:=proc(x)
x*(1-x):
end:
bb:=proc(x)
global a,b,c:
c-(a+b+1)*x:
end:
cc:=proc(x)
global a,b:
-a*b:
end:
g:=proc(x)
(1-x^3):
end:

DE1(aa,bb,cc,g):
aaa:=unapply(AA,x):
bbb:=unapply(BB,x):
ccc:=unapply(CC,x):
m:=proc(x)
   global d:
   ((2*x+1)/3)^d:
end:
DE2(aaa,bbb,ccc,m):
AA1:=AA:
BB1:=BB:
CC1:=CC:
leftde:=((factor(AA)*Y2+factor(BB)*Y1+factor(CC)*Y0)):
g:=proc(x)
   (1-x)^3/(1+2*x)^3:
end:
bb:=proc(x)
   global A,B,C:
   C-(A+B+1)*x:
end:
cc:=proc(x)
   global A,B:
   -A*B:
end:
DE1(aa,bb,cc,g):
AA2:=AA:
BB2:=BB:
CC2:=CC:
rightde:=((factor(AA)*Y2+factor(BB)*Y1+factor(CC)*Y0)):
mult:=normal(AA1/AA2):
yy1:=normal(BB1-mult*BB2):
numer("):
xx:=":
xd1:=degree(",x):
for i from 0 to xd1 do
   x.i:=coeff(xx,x,i):
   L[i]:=":
od:
yy2:=normal(CC1-mult*CC2):
numer("):
xx:=":

xd2:=degree(",x):
for i from 0 to xd2 do
y.i:=coeff(xx,x,i):
L[i+xd1+1]:=":
od:
S:=convert(L,set):
lprint({` The values of the parameters are {`);
solve(S);

Program 2

beta:=proc(p)
27*p^2*(1+p)^2/4/(1+p+p^2)^3:
end:
find:=proc(A,q,n) #This procedure computes the first n terms of the
               #q-series expansion of p = 2q + ...,
               #so that beta(p)=A(q).
local x,i,v,pp,u1,uq,u2,u3:
pp:=2*q:
for i from 2 to n do
   u1:=series(A-beta(pp+v*q^i),q,i+3):
   uq:=coeff(u1,q,i+1):
   u2:=coeff(uq,v,0):
   u3:=coeff(uq,v,1):
   pp:=pp-u2/u3*q^i:
od:
RETURN(pp):
end:
etaq:=proc(q,i,trunk) #This procedure computes the first trunk terms of
                   #the q-series expansion of the eta-product
                   #(1-q^i)(1-q^(2i))(1-q^(3i))...
local k,x,z1,z,w:
z1:=(i + sqrt( i*i + 24*trunk*i ) )/(6*i):
z:=1+trunc( evalf(z1) ):
x:=0:
for k from -z to z do
   w:=i*k*(3*k-1)/2:
   if w<=trunk then
      x:=x+ q^( w )*(-1)^k:
   fi:
od:
RETURN(x):
end:

etamake:=proc(f,last) #This procedure computes an eta-product expansion
                   #of the series f to order O(q^last).
local fp,tc,exq,g,aa,ld,h,hh,i,cf,etaprod:
fp:=convert(f,polynom):
tc:=tcoeff(fp,q):
exq:=ldegree(fp,q):
g:=normal(fp/tc/q^exq):
aa:=tc:
ld:=1:
while ld>0 do
   h:=series(g-1,q=0,last+1):
   hh:=0:
   for i from 1 to last do
      hh:=hh+coeff(h,q,i)*q^i:
   od:
   h:=hh:
   ld:=ldegree(h,q):
   cf:=coeff(h,q,ld):
   if ld>0 then
      exq:=exq+(ld*cf)/24:
      aa:=eta(ld*tau)^(-cf)*aa:
      g:=g*etaq(q,ld,last)^cf:
   fi:
od:
etaprod:=q^(exq)*aa:
print(etaprod):
RETURN():
end: