Find an explicit formula for $ \sum_{n=0}^{\infty}{x^{n^2}} ,\quad \forall x \in (0,1) $ My question askes me to find an explicit formula for
$$ \sum_{n=0}^{\infty}{x^{n^2}} \quad\left(\forall x \in (0,1)\right)$$
And I feel it kind of interesting to find an appropriate f(x) that satisfies
$$ \lim_{x \to 1^{-} }\frac{\sum_{n=0}^{\infty}{x^{n^2}}}{f(x)}=1 $$
Both questions make me feel puzzled, and I tried
$$ \sum_{n=0}^{\infty}{x^{n^2}}<\sum_{n=0}^{\infty}{x^n}=\frac{1}{1-x} $$
Hence I guess maybe
$$ \sum_{n=0}^{\infty}{x^{n^2}}\sim\frac{C_{1}}{\sqrt{1-x}} \quad \text{when} \quad x \to 1^{-}$$
or at least $$ \sum_{n=0}^{\infty}{x^{n^2}} \sim \frac{C_{2}}{(1-x)^\alpha} \quad \text{for} \quad \text{some} \quad \alpha$$
Any help or recommendation related would be greatly appreciated.
Thanks a lot for your focus.
 A: $$\sum_{n=0}^{\infty}{x^{n^2}} =\frac{1}{2} (\vartheta _3(0,x)+1)$$ This is the definition of the theta function.
A: Recall the Jacobi triple product:
$$\prod_{n\ge1}(1-x^{2m})(1-y^2x^{2m-1})(1-y^{-2}x^{2m-1})=\sum_{n\in\Bbb Z}x^{n^2}y^{2n}.$$
Setting $y=1$, $$\sum_{n\in\Bbb Z}x^{n^2}=\left(\prod_{m\ge1}(1-x^{2m-1})\right)\prod_{m\ge1}(1-x^m),$$
because $\prod_{m\ge1}(1-x^{2m})(1-x^{2m-1})=(1-x^2)(1-x)(1-x^4)(1-x^3)(1-x^6)(1-x^5)\cdots=\prod_{m\ge1}(1-x^m)$. Similarly we may write $$\prod_{m\ge1}(1-x^{2m-1})=\prod_{m\ge1}\frac{(1-x^{2m-1})(1-x^{2m})}{1-x^{2m}}=\frac{\prod_{m\ge1}(1-x^m)}{\prod_{m\ge1}(1-x^{2m})}.$$
Writing everything in terms of the $q$-Pochhammer symbol
$$(a;q)_\infty=\prod_{k\ge0}(1-aq^k),$$
we have
$$\sum_{n\in\Bbb Z}x^{n^2}=\frac{(x;x)_\infty^2}{(x^2;x^2)_\infty}.$$
Since $(-n)^2=n^2$, we have that the left side is
$$\sum_{n\in\Bbb Z}x^{n^2}=1+2\sum_{n\ge1}x^{n^2},$$
so
$$\sum_{n\ge1}x^{n^2}=\frac12\left(\frac{(x;x)_\infty^2}{(x^2;x^2)_\infty}-1\right).$$
This is, as Claude mentioned,
$$\sum_{n\ge1}x^{n^2}=\frac12(\vartheta_3(0,x)-1),$$
where $\vartheta_3$ is the Jacobi theta function.
