# Ramanujan theta function and its continued fraction

I believe Ramanujan would have loved this kind of identity. After deriving the identity, I wanted to share it with the mathematical community. If it's well known, please inform me and give me some links to it. Let $q=e^{2\pi\mathrm{i}\tau}$, then $$(1+q^{2}+q^{6}+q^{12}+q^{20}+q^{30}+\cdots)^{2}=\cfrac{1}{1+q-\cfrac{q(1+q)^2}{1+q^3+\cfrac{q^2(1-q^2)^2}{1+q^5-\cfrac{q^3(1+q^3)^2}{1+q^7+\ddots}}}}$$ for $|q|\lt1$. If possible, please provide more examples of this nature, available in the literature.

• This is now the third continued fraction of this kind. The others: (1), (2). – ccorn Aug 7 '15 at 9:58
• How did you derive it? You might find this problem interesting – Winther Aug 7 '15 at 9:59
• Thanks for the links gentlemen,but all of those continued fractions were established by me.I will post my derivations soon,but as a self-taught mathematician it may be hard to follow my methods,being unrigorous perhaps. – Nicco Aug 7 '15 at 10:44
• I second @Winther in that the derivation, or its main ingredients, ought to be given. Otherwise this question will probably share the same fate as the related questions linked above. – ccorn Aug 7 '15 at 10:46
• The left-hand side does not change under the substitution $q\mapsto-q$, and the right-hand side does not need alternating signs then. I'd therefore prefer this form: $$(1+q^{2}+q^{6}+q^{12}+q^{20}+q^{30}+\cdots)^{2}=\cfrac{1}{1-q+{\cfrac{q(1-q)^2}{1-q^3+\cfrac{q^2(1-q^2)^2}{1-q^5+\cfrac{q^3(1-q^3)^2}{1-q^7+\ddots}}}}}$$ – ccorn Aug 7 '15 at 10:51

## 3 Answers

To clarify, what you found is a q-continued fraction for the Jacobi theta function $\vartheta_2(0,q)$. Using ccorn's formulation,

$$\left(\frac{\vartheta_2(0,q)}{2\,q^{1/4}}\right)^2 =\Big(\sum_{n=0}^\infty q^{n(n+1)}\Big)^2 =\cfrac{1}{1-q+\cfrac{q(1\color{red}-q)^2}{1-q^3+\cfrac{q^2(1\color{red}-q^2)^2}{1-q^5+\cfrac{q^3(1\color{red}-q^3)^2}{1-q^7+\ddots}}}}\tag1$$

One can compare this to your other cfrac in this post,

$$\frac{1}{2\,q^{1/2}}\frac{\vartheta_2(0,q^2)}{\vartheta_3(0,q^2)}=\cfrac{1}{1-q+\cfrac{q(1\color{blue}+q)^2}{1-q^3+\cfrac{q^2(1\color{blue}+q^2)^2}{1-q^5+\cfrac{q^3(1\color{blue}+q^3)^2}{1-q^7+\ddots}}}}\tag2$$

They are beautifully similar, differing only in the $\pm$ within the square, though these two identities are not yet rigorously proven. (Update: The second was already established in 2005 by Michael Somos as the cfrac for sequence $A079006$ discussed in this answer.)

P.S. Ramanujan's octic cfrac can also express $(2)$, but I am unsure if there are q-cfracs for any of the $\vartheta_n(0,q)$. (I believe there are, but I'll have to go through my notes.)

• Using ccorn's formulation ,I was able to show that the cfrac is a q-analogue of gauss's cfrac for pi,kindly see my answer here – Nicco Aug 20 '15 at 15:23
• @Nicco: This is not really a Ramanujan theta function; Jacobi found it first. But you right, he would have liked your cfracs. :) – Tito Piezas III Aug 20 '15 at 15:32
• @Nicco: What would be great is if you can find a $q$-cfrac for $\vartheta_3(0,q)$ as well. Then the ratio of two $q$-cfracs would also be a $q$-cfrac. – Tito Piezas III Aug 21 '15 at 11:55
• @ Tito PiezasIII it has already been found by EIsenstein,see here – Nicco Aug 21 '15 at 12:35
• @Nicco: Thanks. I now recall coming across Eisenstein's general cfrac before, and it must be somewhere in my notes. But too bad the ones for $\vartheta_3^k$ don't look similar to yours. Can you modify it so it will look similar? – Tito Piezas III Aug 21 '15 at 13:03

I refer to your claim with the sign of $q$ adjusted so that it reads $$\small(1+q^{2}+q^{6}+q^{12}+q^{20}+q^{30}+\cdots)^{2} =\cfrac{1}{1-q+{\cfrac{q\,(1-q)^2}{1-q^3+\cfrac{q^2(1-q^2)^2} {1-q^5+\cfrac{q^3(1-q^3)^2}{1-q^7+\cdots}}}}}$$ Given

1. a related answer introducing a continued fraction formula by Ramanujan with parameters $a,b,q$ and making use of some Jacobi thetanull properties,
2. plus another answer where the formula and the thetanull stuff is applied again with other settings of $a$ and $b$,
3. and yet another one where we found and applied the insight that whenever $ab=q$, the result can be simplified along the same lines as before, this time using the two-argument Jacobi theta functions,

you know what comes next.

But it does not get boring: This one comes with another twist and a slight beautification.

As usual in posts like these, I write $q_n = \exp\frac{2\pi\mathrm{i}\tau}{n}$, thus $q_n^n=q$, and I consider expressions with $q_n$ implicity as functions of $\tau$.

I will again use Ramanujan's formula $$\small\frac{(-a;q)_\infty\,(-b;q)_\infty - (a;q)_\infty\,(b;q)_\infty} {(-a;q)_\infty\,(-b;q)_\infty + (a;q)_\infty\,(b;q)_\infty} = \cfrac{a+b}{1-q+\cfrac{(a+bq)(aq+b)}{1-q^3+\cfrac{q\,(a+bq^2)(aq^2+b)} {1-q^5+\cfrac{q^2(a+bq^3)(aq^3+b)}{1-q^7+\cdots}}}}\tag{*}$$ If you look at formula $(2)$ in my previous answer, you may notice that, by pulling out the first factor of the $q$-Pochhammer symbol containing $q^{-1}$, the identity can be written in the fully symmetric form $$\small\frac{(-a;q)_\infty\,(-b;q)_\infty - (a;q)_\infty\,(b;q)_\infty} {(-a;q)_\infty\,(-b;q)_\infty + (a;q)_\infty\,(b;q)_\infty} = (a+b)\,\frac{(-a^2q^3;q^4)_\infty\,(-b^2q^3;q^4)_\infty} {(-a^2q;q^4)_\infty\,(-b^2q;q^4)_\infty} \qquad (ab=q) \tag{**}$$ Combining $(*)$ and $(**)$, you get the following formula, restricted to the case $ab=q$: $$\small\cfrac{1}{1-q+\cfrac{(a+bq)(aq+b)}{1-q^3+\cfrac{q\,(a+bq^2)(aq^2+b)} {1-q^5+\cfrac{q^2(a+bq^3)(aq^3+b)}{1-q^7+\cdots}}}} = \frac{(-a^2q^3;q^4)_\infty\,(-b^2q^3;q^4)_\infty} {(-a^2q;q^4)_\infty\,(-b^2q;q^4)_\infty} \tag{***}$$ Note that the factor $(a+b)$ has been cancelled from both sides. This is important because now we are going to use it for $a+b=0$ by continuity.

Concretely, set $a=-\mathrm{i}q_2$, $b=\mathrm{i}q_2$, so $ab=q$ and $a/b=-1$. This yields \begin{align} \cfrac{1}{1-q+\cfrac{q\,(1-q)^2}{1-q^3+\cfrac{q^2(1-q^2)^2} {1-q^5+\cfrac{q^3(1-q^3)^2}{1-q^7+\cdots}}}} &\stackrel{(***)}{=} \frac{(q^4;q^4)_\infty^2}{(q^2;q^4)_\infty^2} \\ &\stackrel{(P1)}{=} (q^4;q^4)_\infty^2\,(-q^2;q^2)_\infty^2 \\ &\stackrel{(P2)}{=} (q^2;q^2)_\infty^2\,(-q^2;q^2)_\infty^4 \\ &\stackrel{(T1)}{=} \left(\frac{\vartheta_2(0\mid2\tau)}{2q_4}\right)^2 \\ &\stackrel{(T2)}{=} \left(\sum_{n=0}^\infty q^{n\,(n+1)}\right)^2 \end{align} where $(\mathrm{P1})$ and $(\mathrm{P2})$ are $q$-Pochhammer symbol manipulation rules like \begin{align} (-q;q)_\infty\,(q;q^2)_\infty &= 1 \tag{P1} \\ (-q;q)_\infty\,(q;q)_\infty &= (q^2;q^2)_\infty \tag{P2} \end{align} and $(\mathrm{T1})$ refers to the product representation of $\vartheta_2$: $$\vartheta_2(0\mid\tau) = 2q_8\,(-q;q)_\infty^2\,(q;q)_\infty \tag{T1}$$ while $(\mathrm{T2})$ describes the series representation $$\vartheta_2(0\mid\tau) = \sum_{k\in\mathbb{Z}} q_8^{(2k+1)^2} = 2q_8\sum_{n=0}^\infty q^{n\,(n+1)/2} \tag{T2}$$ which is linked with $(\mathrm{T1})$ by the triple product identity. Those ingredients are the same as for the other answers. Nothing new here.

That's it. Enjoy the formulae with more continued fractions of that sort.

• This automatically solves the conjecture in this post – Nicco Oct 3 '15 at 18:47
• @Nicco: Indeed. In that MO post, one would just have to flip the signs of both $a$ and $q$ to get the expressions used here. The condition $ab=q$ is preserved under that substitution. – ccorn Oct 3 '15 at 21:55
• Ccorn:Surprisingly ,Bruce C Berndt once commented via e-mail that the symmetric form of the cfrac had not been previously observed. – Nicco Oct 3 '15 at 22:27
• According to [ABBW85], in Ramanujan's 2nd notebook, chapter 16, entry 11, the sign of $b$ was flipped, making the expressions skew-symmetric. Entry 12 was then the cfrac mentioned in Tito's MO post. This leaves me with the impression that Ramanujan was aware of the possibility to specialize entry 11 to a simpler theta quotient, but sought something more general than just $ab=q$, and entry 12 was the result. I like entry 11 more though, particularly in the symmetric simplified form here for $ab=q$: The corresponding power series for the numerator and denominator converge to interesting series. – ccorn Oct 3 '15 at 22:38
• @ ccorn :it's also of particular importance to note the equality $\frac{\sum_{n=-\infty}^{\infty} (a^{n}b^{n+1})^{2n+1}}{\sum_{n=-\infty}^{\infty} a^{n(2n+1)}b^{n(2n-1)}}=(a+b)\frac{(-a^5b^3;(ab)^4)_\infty\,(-a^3b^5;(ab)^4)_\infty} {(-ab^3;(ab)^4)_\infty\,(-a^3b;(ab)^4)_\infty}$ – Nicco Oct 12 '17 at 7:36

In a paper of me and Professor M.L. Glasser  we have generalized the continued fractions regarding this conversation. Namely

If $|q|<1$ and we set $$(a;q)_{\infty}=\prod^{\infty}_{n=0}\left(1-aq^n\right),\tag 1$$ then $$\left(\frac{(-a;q)_{\infty}}{(a;q)_{\infty}}\right)^2=-1+\frac{2}{1-}\frac{2a}{1-q+}\frac{a^2(1+q)^2}{1-q^3+}\frac{a^2q(1+q^2)^2}{1-q^5+}\frac{a^2q^2(1+q^3)^2}{1-q^7+}\ldots,\tag 2$$ $$\sum^{\infty}_{n=0}\frac{q^n}{1-a^2q^{2n}}=\frac{1}{1-q+}\frac{-a^2(1-q)^2}{1-q^3+}\frac{-qa^2(1-q^2)^2}{1-q^5+}\frac{-q^2a^2(1-q^3)^2}{1-q^7+}\ldots,\tag 3$$ where $a$ is a complex number.

Hence for example

1) If we set $a=iq$ in (3) and using  pg.17, pg.55: $$cn(u)=\frac{2\pi}{Kk}\sum^{\infty}_{n=0}\frac{q^{n+1/2}}{1+q^{2n+1}}\cos((2n+1)z)$$ where $z=\frac{\pi}{2K}u$ and $cn(0)=1$, we get $$\sum^{\infty}_{n=0}\frac{q^n}{1+q^{2n+1}}=\frac{1}{1-q+}\frac{q(1-q)^2}{1-q^3+}\frac{q^2(1-q^2)^2}{1-q^5+}\frac{q^2(1-q^3)^2}{1-q^7+}\ldots=$$ $$=q^{-1/2}\frac{Kk}{2\pi}=\left(\frac{\theta_2(q)}{2q^{1/4}}\right)^2=\left(\sum^{\infty}_{n=0}q^{n(n+1)}\right)^2,$$ where $\theta_2(q)=\sum^{\infty}_{n=-\infty}q^{(n+1/2)^2}=\sqrt{2Kk/\pi}$, $q=e^{-\pi\sqrt{r}}$, $r>0$.

2) From  pg.37 we have $$\theta_4(q)=\sum^{\infty}_{n=-\infty}(-1)^nq^{n^2}=\frac{(q;q)_{\infty}}{(-q,q)_{\infty}}.$$ Using (2) we arive to $$\left(\sum^{\infty}_{n=-\infty}(-1)^nq^{n^2}\right)^{-2}=-1+\frac{2}{1-}\frac{2q}{1-q+}\frac{q^2(1+q)^2}{1-q^3+}\frac{q^3(1+q^2)^2}{1-q^5+}\frac{q^4(1+q^3)^2}{1-q^7+}\ldots$$

3) For $q\rightarrow q^2$ and $a=q$, we get $$S_1=\left(\frac{(-q;q^2)_{\infty}}{(q;q^2)_{\infty}}\right)^2= -1+\frac{2}{1-}\frac{2q}{1-q^2+}\frac{q^2(1+q^2)^2}{1-q^6+}\frac{q^4(1+q^4)^2}{1-q^{10}+}\frac{q^6(1+q^6)^2}{1-q^{14}+}\ldots\tag 4$$ we also get $$S_2=\left(\frac{(q;q^2)_{\infty}}{(-q;q^2)_{\infty}}\right)^2=\frac{1}{S_1}=$$ $$=-1+\frac{2}{1+}\frac{2q}{1-q^2+}\frac{q^2(1+q^2)^2}{1-q^6+}\frac{q^4(1+q^4)^2}{1-q^{10}+}\frac{q^6(1+q^6)^2}{1-q^{14}+}\frac{q^8(1+q^8)^2}{1-q^{18}+}\ldots\tag 5$$ But $\chi(q)=(-q;q^2)_{\infty}$, $\psi(q)=\sum^{\infty}_{n=0}q^{n(n+1)/2}=\frac{(q^2;q^2)_{\infty}}{(q;q^2)_{\infty}}$, $f(-q)=(q;q)_{\infty}$ (note that $\chi(-q)=\frac{\theta_4(q)}{f(-q)}$). Moreover if $k'_r=\sqrt{1-k_r^2}$ is the complementary elliptic singular modulus, then from  chapter 16, Entry 24, pg. 39 we have the following cfrac expansions: $$S_1=\frac{\chi(q)}{\chi(-q)}=\frac{f(q)}{f(-q)}=\frac{\psi(q)}{\psi(-q)}=\sqrt{\frac{\theta_3(q)}{\theta_4(q)}}=\frac{1}{\sqrt{k'_r}}$$

Note. $$k_r=\sqrt{m(q)}=4q^{1/2}\exp\left(-4\sum^{\infty}_{n=1}q^n\sum_{d|n}\frac{(-1)^{d+n/d}}{d}\right),$$
where $q=e^{-\pi\sqrt{r}}$, $r>0$.

etc...

References

: N.D. Bagis and M.L. Glasser. "Evaluations of a Continued Fraction of Ramanujan". Rend. Sem. Mat. Univ. Padova, Vol. 133 (2015). (submited 2013)

: J.V. Armitage W.F. Eberlein. 'Elliptic Functions'. Cambridge University Press, (2006).

: Bruce C. Berndt. 'Ramanujan`s Notebooks Part III'. Springer Verlag, New York, (1991).

• Nice generalization. (3) is given in a related thread as (P) with a rearranged sum for $r=a^2$, but restricted to $|r|<1$. – ccorn Apr 19 '17 at 13:10
• – ccorn Apr 19 '17 at 13:55