Closed form for the series: $\sum_{n=1}^{\infty}x^{n^2}$ Let $$S=\sum_{n=1}^{\infty}x^{n^2}, \quad|x|<1.$$  It is convergent and the sum is definitely less than $1/(1-x).$ 
Is there any closed form for $S$ ?
 A: There is no known closed form of
$$
S(q):=\sum_{n=1}^{\infty}q^{n^2}, \qquad|q|<1.
$$ in terms of elementary functions. A related function, called the Jacobi theta function, 
$$
\begin{align} 
\vartheta(z; \tau) &= \sum_{n=-\infty}^\infty \exp \left(\pi i n^2 \tau + 2 \pi i n z\right) \\
&= 1 + 2 \sum_{n=1}^\infty \left(e^{\pi i\tau}\right)^{n^2} \cos(2\pi n z) \\
&= \sum_{n=-\infty}^\infty q^{n^2}\eta^n 
\end{align}
$$
has been studied showing very   interesting properties. By setting $q=e^{-x \pi}$ and 
\begin{align}
\varphi(e^{-\pi x}) = \vartheta(0; ix)  = \sum_{n=-\infty}^\infty e^{-x \pi n^2}=2S(q)+1
\end{align} one may prove that
\begin{align}
\varphi\left(e^{-\pi} \right) &= \frac{\sqrt[4]{\pi}}{\Gamma\left(\frac34\right)},
\\\\
\varphi\left(e^{-2\pi}\right) &= \frac{\sqrt[4]{6\pi+4\sqrt2\pi}}{2\Gamma\left(\frac34\right)},
\\\\
\varphi\left(e^{-3\pi}\right) &= \frac{\sqrt[4]{27\pi+18\sqrt3\pi}}{3\Gamma\left(\frac34\right)},
\\\\
\varphi\left(e^{-4\pi}\right) &= \frac{\sqrt[4]{8\pi}+2\sqrt[4]{\pi}}{4\Gamma\left(\frac34\right)},
\\\\
\varphi\left(e^{-5\pi}\right) &= \frac{\sqrt[4]{225\pi+ 100\sqrt5 \pi}}{5\Gamma\left(\frac34\right)},
\\\\
\varphi\left(e^{-6\pi}\right) &= \frac{\sqrt[3]{3\sqrt{2}+3\sqrt[4]{3}+2\sqrt{3}-\sqrt[4]{27}+\sqrt[4]{1728}-4}\cdot\sqrt[8]{243{\pi}^2}}{6\sqrt[6]{1+\sqrt6-\sqrt2-\sqrt3}{\Gamma\left(\frac34\right)}}.
\end{align}
A: You are not going to get an elementary closed form for this sum. It is a linear transformation of the third Jacobi theta function:
$$\sum_{n=1}^\infty x^{n^2}=\frac{\vartheta_3(0,x)-1}2$$
(I an using the notation used by Mathematica and mpmath. The theta functions have tons of different notations.)
