Asymptotic equivalent of $\sum_{n\ge0} q^{n^2}{x^n}$ as $x\to+\infty$
Solution 1:
Edit: We assume that $q$ is real, $0<q<1$ and $x$ is real and positive. We want to study the behavior of $f(x)$ as $x\to\infty$.
We have $f(x)=g(x)-\sum_{n=-\infty}^{-1} q^{n^2}x^n$ with $g(x)=\sum_{n=-\infty}^\infty q^{n^2}x^n$. Therefore $f(x)=g(x)+O(x^{-1})$ as $x\to\infty$. Now we calculate $$q\,x\, g(q^{2} x)=q\,x\,\sum_{n=-\infty}^\infty q^{n^2}q^{2n}x^n= \sum_{n=-\infty}^\infty q^{n^2+2n+1}x^{n+1}=\sum_{n=-\infty}^\infty q^{n^2}x^n=g(x)$$ for all real $x$.
Consider now with $\mu=\log q$ the function $d(x)=\exp\left(\frac1{4\mu}(\log x)^2\right)g(x)$, defined for real positive $x$. We calculate $$\begin{matrix}d(q^2x)&=&\exp\left(\frac1{4\mu}(\log x+\mu)^2\right)g(q^2x)= \exp\left(\frac1{4\mu}(\log x)^2\right)\exp(\log(x))\exp(\mu)g(q^2x)\\&=& \exp\left(\frac1{4\mu}(\log x)^2\right)\,x\,q\,g(q^2x)=\exp\left(\frac1{4\mu}(\log x)^2\right)g(x)=d(x)\end{matrix}.$$ This means that the function $p(t)=d(e^{2\mu t})$ is 1-periodic. We have found that $$g(x)=\exp\left(-\frac1{4\mu}(\log x)^2\right)p\left(\frac1{2\mu}\log x\right)$$ with a certain 1-periodic function $p$.
In summary, with $\mu=\log q<0$, we have shown the existence of a 1-periodic function $p$ such that $$f(x)=\exp\left(-\frac1{4\mu}(\log x)^2\right)p\left(\frac1{2\mu}\log x\right)+O(x^{-1}).$$ Observe that, by construction, $p$ is positive and hence also its minimum is positive.
If we use the Theta function, this periodic function $p$ can be identified. If we put $q=\exp(\pi\tau i)$ and $x=\exp(2\pi z i)$ then $g(x)=\vartheta(z,\tau)$. The Jacobi identity $\vartheta\left(\frac z\tau;-\frac1\tau\right)=(-i\tau)^{1/2}\exp(\frac\pi\tau i z^2)\vartheta(z;\tau)$ yields after a short calculation that $$p(t)=\sqrt{\frac{\pi}{-\mu}}\left(1+2\sum_{n=1}^\infty e^{\pi^2n^2/\mu}\cos(2\pi n t)\right).$$
Edit 2: User reuns indicates a way to avoid using the Theta function and the Jacobi identity as a black box. If I remember correctly, this is a way to prove the Jacobi identity.
We have (since $t=\frac1{2\mu}\log x$) that $$p(t)=\sum_{n=-\infty}^\infty \exp\left(\mu(n+t)^2\right).$$ This shows in particular clearly that $p$ is a 1-periodic function. Its Fourier series is $$p(t)=\sqrt{\frac{\pi}{-\mu}}\sum_{n=-\infty}^\infty e^{\pi^2n^2/\mu}\exp(2\pi i n t);$$ here it is used that $\int_{-\infty}^\infty \exp(\mu t^2 -2\pi i m t)\,dt= \sqrt{\frac\pi{-\mu}}\exp(\pi^2 m^2/\mu)$ for $m\in{\mathbb Z}$.
Edit: If $q\in{\mathbb C}^*$, $|q|<1$, then we still have $f(x)-g(x)=O(x^{-1})$, even as $|x|\to\infty$ even for complex $x$, but we have just $\mbox{Re }\mu<0$. The function $p(t)$ is still 1-periodic, but we need it for values $t=\frac1{2\mu}\log x$, $x$ real tending to $+\infty$, for which $|\mbox{Im } t|$ tends to infinity. The asymptotic behavior of $g(x)$ is more complicated then. I think, it is dominated by the term $q^{n^2}x^n$ of maximal norm, that is when $x|q|^{2n+1}\approx1$.