In Table of Integrals, Series and Products (p. 869) by Gradshteyn and Ryzhik, I found the identity (called 'the Weierstrass expansion of $\operatorname{sn}$') $$\operatorname{sn}u=\frac{B}{A}$$ where $\operatorname{sn}$ is the Jacobi elliptic function $\operatorname{sn}$, $$B=\sum_{n=0}^\infty (-1)^n b_n\frac{u^{2n+1}}{(2n+1)!},$$ $$A=1-\sum_{n=1}^\infty (-1)^{n+1}a_{n+1}\frac{u^{2n+2}}{(2n+2)!},$$ $$b_0=1,\, b_1=1+k^2,\, b_2=1+k^4+4k^2,\,\ldots ,$$ and $$a_2=2k^2,\, a_3=8(k^2+k^4),\ldots ,$$ ($k$ is the elliptic modulus). Note that Gradshteyn and Ryzhik write only the first few terms and don't write the general term.
My question
I know the Weierstrass factorization theorem. But it is unclear to me how the sequences $\{a_n\}_n$ and $\{b_n\}_n$ are generated. How can one come up with them? What is the "general term" of the sequences?
From Gradshteyn and Ryzhik, Table of Integrals, Series, and Products, $6$th edition, $2000$, page $861$ (the text gives the coefficients up to $n=6$ but here I have abbreviated to $n=3$ or $n=4$)
The question is
Recall (from Wikipedia)
The expansions of sn, cn, dn as the quotient two entire functions was accomplished by Jacobi using his four theta functions. He used essentially (these are not the same as the functions in the text)
$$ A\!=\!\sqrt{k}\,\vartheta_4\Big(\frac{\pi u}{2K}\Big),\; B\!=\!\vartheta_1\Big(\frac{\pi u}{2K}\Big),\; C\!=\!\sqrt{k'}\,\vartheta_2\Big(\frac{\pi u}{2K}\Big),\; D\!=\!\sqrt{kk'}\,\vartheta_3\Big(\frac{\pi u}{2K}\Big) \tag1 $$
as given in section $\bf{8.191}$ of the text. However, we are given that
$$ A \equiv A(u) = 1 + O(u^4),\; B \equiv B(u) = u - (1+k^2)u^3/3! + O(u^5),\\ C \equiv C(u) = 1 - u^2/2! + O(u^4),\; D \equiv D(u) = 1 - k^2u^2/2! + O(u^4) \tag2 $$
which implies that there is a common factor missing. Note that commonly $\,0 < k < 1\,$ but, in general, $\,k\,$ can be any complex number. Weierstrass proposed his four sigma functions as an alternative to the Jacobi theta functions.
I can identify the function $\,B\,$ as
$$ B(u) = L(u)\sigma(u; g_2, g_3) \quad \text{ where } \quad L(u) := e^{-(1+k^2)u^2/6} \tag3 $$
and where
$$ g_2 := (1-k^2+k^4)\frac43,\; g_3 := (2-3k^2-3k^4+2k^6)\frac4{27}. \tag4 $$
Where did these equations come from? First, the sequence defined by $\, W_n := B(nu)\,$ is an Elliptic Divisibility Sequence. As such, the values of $\,G_2, G_3, j\,$ can be calculated from $\,W_1, W_2, W_3, W_4\,$ where $\, j = \frac{1728 G_2^3}{G_2^3-27G_3^2}\,$ is the Klein j-invariant. It is known that $\, j = \frac{256(1-k^2+k^4)^3}{(k^2-k^4)^2}\,$ and this determines $\,G_2,G_3\,$ up to a factor $\,B\,$ as in
$$G_2 = g_2 B^4,\quad G_3 = g_3 B^6. \tag5 $$
The other functions $\,A, C, D\,$ are similar sigma functions. (Refer to MathWorld for these three other sigma functions). I used Wolfram Mathematica code to check my work. Specifically, with $\,\omega_2 = -\omega_1-\omega_3\,$ and $\,k^2=\lambda(\omega_3/\omega_1)\,$ and expressing $\,\sigma_1,\sigma_2,\sigma_3\,$ in terms of $\,\sigma\,$ I get
$$ A(u)/L(u) = \sigma_3(u) := e^{-\eta_3 u}\sigma(u+\omega_3)/\sigma(\omega_3), \\ C(u)/L(u) = \sigma_1(u) := e^{-\eta_1 u}\sigma(u+\omega_1)/\sigma(\omega_1), \\ D(u)/L(u) = \sigma_2(u) := e^{-\eta_2 u}\sigma(u+\omega_2)/\sigma(\omega_2) ,\\ \tag6 $$
where $\,\omega_1,\omega_2,\omega_3\,$ are half periods.
Note that these three other functions are uniquely determined without referring to $\,B\,$ by using the following "doubling formulas" (note also that $\,B(2u) = 2ABCD$)
$$ A(2u) = A^2(C^2 + D^2) - C^2D^2, \\ C(2u) = C^2(A^2 + D^2) - A^2D^2, \\ D(2u) = D^2(A^2 + C^2) - A^2C^2. \tag7 $$
Define the function
$$ T(u) := W_5 W_1^3 - W_4 W_2^3 + W_3^3 W_1 = \sum_{n=0}^\infty t_n u^{2n}. \tag8 $$
Note that $\,T(u) = 0\,$ uniquely determines $\,W = B(u) := \sum_{n=0}^\infty (-1)^n b_n\frac{u^{2n+1}}{(2n+1)!},\,$ given the values of $\,b_0,b_1,b_2,b_3$ while the rest of the values of $\,b_n\,$ are determined by a recurrence equating the coefficients $\,t_n\,$ of $\,T(u)\,$ to zero. For example,
$$ t_6 := b_0^3b_4 - 12b_0^2b_1b_3 + 9b_0^2b_2^2 + 12b_0b_1^2b_2 - 10b_1^4 = 0 \tag9 $$
determines $\,b_4.\,$
For more results, read my "WXYZ Math Project" which is related as follows:
$$ B=W\;\;\text{ and }\;\;\{A,C,D\}=\{X,Y,Z\}\;\;\text{ in any order}. $$
Given the differential equation for $\,\wp\,$ the Weierstrass elliptic function
$$ \wp'^2(z) = 4\wp^3(z)-g_2\wp(z)-g_3, \tag{10}$$
similarly, the function
$$ V(u) := -(B'(u)/B(u))' = \wp(u) + \frac{1+k^2}3 \tag{11} $$
using equation $(3)$ is a solution of
$$ V'^2(u) = 4V(u)(V(u)-1)(V(u)-k^2). \tag{12} $$
Compare this with section $\bf{8.161}$ of the reference. Similar to equation $\bf{8.162}$, this implies that $\,V(u)\,$ is the inverse function of an elliptic integral. Now $\,B(u)\,$ can be computed with two integrations using equation $(11)$.
Also, equation $(12)$ can be used to iteratively compute the coefficients of $\,V(u)\,$ and from this to compute truncations of the power series for $\,B(u).$
Motivated by the partial differentiation equation w.r.t. $g_2,g_3$ for the Weierstrass sigma function given by the Wolfram Functions Site
$$ z\frac{\partial \sigma(z; g_2, g_3)}{\partial z} - 4g_2\frac{\partial \sigma(z; g_2, g_3)}{\partial g_2} - 6g_3\frac{\partial \sigma(z; g_2, g_3)}{\partial g_3} - \sigma(z; g_2, g_3) = 0 \tag{13} $$
I have empirically found the partial differential equations that are satisfied by each of the four functions (Weierstrass in his $1840$ paper in equation (6.) on page $12$ volume I of his Werke had essentially these same formulas). They are (where $f$ is one of $A, B, C, D$ and $\,m := k^2$)
$$ 4m(1-m)\frac{\partial f(u)}{\partial m} + \frac{\partial^2 f(u)}{\partial u^2} + 2mu \frac{\partial f(u)}{\partial u} + (e_f + mu^2) f(u) = 0 \tag{14} $$
and where the constant $\,e_f\,$ is given by $\,e_A = 0,\, e_B = 1-m,\, e_C = 1,\, e_D = m.\,$ This PDE can be used to determine the coefficient polynomials for $\,f(u)\,$ by recursion.
First, $\, a_n =\sum_{j=0}^n a_n(j)\,m^j,\,$ where $\,a_0(0) = -1,\,$ and
$$ a_n(j) = 4j\, a_{n-1}(j) +4(n-j) a_{n-1}(j-1) -(2n-2)(2n-3)a_{n-2}(j-1). $$
Similarly, $\, b_n =\sum_{j=0}^n b_n(j)\,m^j,\,$ where $\,b_0(0) = 1,\,$ and
$$ b_n(j) = (1+4j)\, b_{n-1}(j) +(1+4(n-j)) b_{n-1}(j-1) -(2n-1)(2n-2)b_{n-2}(j-1). $$
Also, $\, c_n = \sum_{j=0}^n c_n(j)\,m^j,\,$ where $\,c_0(0) = 1,\,$ and
$$ c_n(j) = (1+4j)\, c_{n-1}(j) +4(n-j) c_{n-1}(j-1) -(2n-2)(2n-3)c_{n-2}(j-1). $$
Finally, $\, d_n=\sum_{j=0}^n d_n(j)\,m^j,\,$ where $\,d_n(j) = c_n(n-j).$
Notice that in all of these sums, the the range of the index $\,j\,$ is restricted so that $\,0\le j\le n.\,$ Thus, for example, $\,a_n(j) = 0\,$ if $\,j<0\,$ or $\,j>n.\,$ This is explicit in my Wolfram
Mathematicacode: