Addition formula for elliptic integral of second kind Let $k\in(0,1)$ and the incomplete elliptic integral integral $E(u, k) $ be defined by $$E(u, k) =\int_{0}^{u}\operatorname {dn} ^2(t,k)\,dt\tag{1}$$ where $\operatorname {dn} (u, k) $ represents one of the Jacobian elliptic functions. When the value of $k$ is evident from context the parameter $k$ is dropped and one writes $E(u)$ instead of $E(u, k) $. 
The function $E(u) $ satisfies the following addition formula $$E(u) +E(v) - E(u+v) =k^2\operatorname {sn} (u, k) \operatorname {sn} (v, k) \operatorname {sn} (u+v, k) \tag{2}$$ where $\operatorname {sn} (u, k) $ is another Jacobian elliptic function.
Dr. Bruce C. Berndt mentions in his Ramanujan Notebooks vol 3 that the above formula $(2)$ is equivalent to  $$\frac{qf(-a, - q^2/a)f(-b,-q^2/b)f(-ab,-q^2/ab)} {abf(-aq, - q/a) f(-bq, - q/a) f(-abq, - q/ab) }=\frac{\varphi(-q)} {f^{3}(-q^2)}\sum_{n=1}^{\infty}\frac{q^n} {1-q^{2n}}\left(\frac{1}{a^nb^n}-\frac{1}{a^n}-\frac{1}{b^n}+a^n+b^n-a^nb^n\right) \tag{3}$$ where $|q|<1$ and
\begin{align*}
f(a, b) & =\sum_{n\in\mathbb {Z}} a^{n(n+1)/2}b^{n(n-1)/2},|ab|<1\\
\varphi(q) &= f(q, q) =\sum_{n\in \mathbb {Z}} q^{n^2}=\vartheta_{3}(q)\\
f(-q)&=f(-q, - q^2)=\prod_{n=1}^{\infty} (1-q^n)
\end{align*} are Ramanujan's theta functions.
The formula $(2)$ is famous and proved in both Jacobi's Fundamenta Nova and Whittaker & Watson's A Course of Modern Analysis.

How does one show that it is equivalent to formula $(3)$?


My own try is to deal with the fraction $\varphi(-q) /f^{3}(-q^2)$. We have via the theory of theta functions and elliptic integrals $$\varphi(-q) =\vartheta_{4}(q)=\sqrt{\frac{2k'K}{\pi}}$$ where $$K=K(k) =\int_{0}^{\pi/2}\frac{dx}{\sqrt{1-k^2\sin^2x}},k'=\sqrt{1-k^2}$$ and $$q^{1/12}f(-q^2)=q^{1/12}\prod_{n=1}^{\infty} (1-q^{2n})=2^{-1/3}\sqrt{\frac{2K}{\pi}}(kk')^{1/6}$$ so that $$q^{1/4}f^{3}(-q^2)=\frac{K}{\pi}\sqrt{\frac{2kk'K}{\pi}}$$ Thus we have $$\frac{\varphi(-q)} {f^3(-q^2)}=\frac{q^{1/4}}{\sqrt{k}}\frac{\pi}{K}$$ Next we have the product expansion $$\operatorname {sn} (u, k) = \dfrac{2q^{1/4}}{\sqrt{k}}\sin z\prod_{n = 1}^{\infty}\dfrac{1 - 2q^{2n}\cos 2z + q^{4n}}{1 - 2q^{2n - 1}\cos 2z + q^{4n - 2}}, z=\frac{\pi u} {2K}$$ which can be written as $$\frac{2q^{1/4}}{\sqrt{k}}\sin z\prod_{n=1}^{\infty}\frac{(1-q^{2n}e^{2iz})(1-q^{2n}e^{-2iz})}{(1-q^{2n-1}e^{2iz})(1-q^{2n-1}e^{-2iz})}\tag{4}$$ Using the Jacobi triple product (written in terms of Ramanujan theta function) $$f(a,b)=\prod_{n=1}^{\infty} (1-(ab)^n)(1+a(ab)^{n-1})(1+b(ab)^{n-1})\tag{5}$$ and the expression $(4)$ for $\operatorname{sn } (u, k)$ (and similar expressions for $\operatorname {sn} (v, k)$ and $\operatorname {sn} (u+v, k) $) it appears that the RHS of $(2)$ can be written like LHS of $(3)$ (via substitution $a=e^{2iz},b=e^{2iw},w= \dfrac{\pi v} {2K}$). However I don't see how to handle the LHS of $(2)$ (or RHS of $(3)$).
 A: On searching further in Fundamenta Nova I found the key to the problem. Not only Jacobi found the Fourier series for elliptic functions, but he found such series for their integer powers also using purely algebraic approach. Here one needs the following Fourier series for $\operatorname {dn} ^2(u,k)$ $$\left(\frac{2K}{\pi}\right) ^2\operatorname {dn} ^2(u,k)=\frac{2K}{\pi}\cdot\frac{2E}{\pi}+8\sum_{n=1}^{\infty} \frac{nq^n}{1-q^{2n}}\cos 2nz,\,E=E(K,k),z=\frac{\pi u} {2K}\tag{1}$$ Integrating the above with respect to $u$ we get $$\frac{2K}{\pi}\cdot E(u,k)=\frac{2E}{\pi}\cdot u+4 \sum_{n=1}^{\infty} \frac{q^n} {1-q^{2n}}\sin 2nz\tag{2}$$ Using this formula we can see that $$E(u) +E(v) - E(u+v) =\frac{2\pi}{K}\sum_{n=1}^{\infty}\frac{q^n}{1-q^{2n}}\{\sin 2nz+\sin 2nw-\sin 2n(z+w)\}, \, w=\frac{\pi v} {2K}\tag{3}$$ Now we can set $$a=e^{2iz},b=e^{2iw}$$ and then the RHS of $(3)$ above resembles the RHS of equation $(3)$ in question. I have checked that other factors match exactly as specified in the question. 
