P.444-445 of volume 3 of Gauss's Nachlass, in which Gauss wrote down an identity for the infinite series of $\vartheta^4_3(x)$ (this identity is the essence of Jacobi's four squares theorem), include several differential equations which, together with his identity for $\mathbb{log}(\vartheta^4_3(x))$ (which is dicussed here), apparently enabled him to derive the identities for $\vartheta^4_2(x),\vartheta^4_3(x),\vartheta^4_4(x)$. I believe the missing piece in the puzzle of answering this question is to understand the origin of these differential equations. I will describe them right now.
Denote $\vartheta_2(x),\vartheta_3(x),\vartheta_4(x)$ as $r,p,q$ respectively. Denote also $t=\frac{1}{p^2},u=\frac{1}{q^2}$. Then define the following mathematical operator: $t' = x\frac{dt} {dx}$ (although the $'$ symbol, this operator is not derivative). Then I would like to know on what grounds the following identities hold:
$$\frac{u}{t}-\frac{t}{u}=2(tu'-ut')=-4u^3t'' = 4t^3u''$$ $$\frac{t'''}{t''}+3\frac{t'}{t}=\sqrt{\frac{1}{t^4}+16\frac{t''}{t}}.$$ The significance of the first equation can be explained along the following line: $$\frac{u}{t}-\frac{t}{u}=2(tu'-ut')\implies p^4-q^4 = 4x(\frac{d\mathbb{log}(\frac{p}{q})}{dx})\implies r^4 = 4x(\frac{d\mathbb{log}(\frac{p}{q})}{dx})$$, so this identity connects $r^4$ with the logarithmic derivatives of $p,q$.
I will have much appreciation for an answer that will explain the principle behind such identities.