TITLE: Upper bound on $\sum_{n=1}^\infty q^{(n^2)}$
QUESTION [7 upvotes]: Let $q\in \mathbb R$ with $|q|<1$. I am looking for an upper bound of the converging series
$$
\sum_{n=1}^\infty q^{(n^2)}
$$
with respect to $q$.
Using the inequality $q^{(n^2)} \le q^{2n-1}$, one gets
$$
\sum_{n=1}^\infty q^{(n^2)} \le q^{-1} \sum_{n=1}^\infty q^{2n}  
= q\sum_{n=0}^\infty q^{2n}
= \frac{q}{1-q^2}
$$
Numerical experiments say that this estimate does not reflect the behavior of the sum for $q\to1$. They suggests an upper bound in the order of $\frac1{\sqrt{1-q^2}}$. Is it possible to prove this? Preferably with elementary arguments?

REPLY [12 votes]: Hint. Note that as $q\to 1^-$, we have that $\ln(q)<0$ and 
$$\sum_{n=1}^\infty q^{n^2}=\sum_{n=1}^{\infty}e^{\ln(q)n^2}\leq 
\int_{x=0}^{\infty}e^{\ln(q)x^2}\,dx=\frac{\sqrt{\pi}}{2\sqrt{-\ln(q)}}\sim \frac{\sqrt{\pi}}{2\sqrt{1-q}}.$$