asymptotics of $\sum_{n=0}^\infty x^{n^2}$ as $x\rightarrow 1$ This is an exercise in the book by Titchmarsh, 'the theory of functions', page 242. 
The answer is $\frac{1}{2}\sqrt{\pi /(1-x )} $. 
How to prove it? 
It is a little bit surprising to me. The function $1/\sqrt{1-x} $ has a quite different Taylor expansion around $x= 0 $. 
 A: This is a Theta function.
See https://en.wikipedia.org/wiki/Theta_function.
A search for
"theta function asymptotics"
comes up with this,
titled
"Asymptotics of the q-theta function",
among the first hits:
www.ucs.louisiana.edu/~xxw6637/papers/CMA2009.pdf
This is the main result:
For $0 < q < 1$
and $x \in \mathbb{C}$,
define
$\Theta_q(x)
=\sum_{n=-\infty}^{\infty} q^{k^2}x^k
$,
so
$f(x)
=(1+\Theta_x(1))/2
$.
Then,
as $q \to 1^-$,
$\Theta_q(x)
\sim \sqrt{\dfrac{\pi}{-\ln(q)}}\exp\left(\dfrac{(\ln x)^2}{-4\ln(q)}\right) 
$.
Setting $x = 1$,
this becomes
$\Theta_q(1)
\sim \sqrt{\dfrac{\pi}{-\ln(q)}}
$.
If $q = 1-z$,
$\Theta_{1-z}(1)
\sim \sqrt{\dfrac{\pi}{-\ln(1-z)}}
\sim \sqrt{\dfrac{\pi}{z}}
= \sqrt{\dfrac{\pi}{1-q}}
$.
Therefore
$\begin{array}\\
f(x)
&=(1+\Theta_x(1))/2\\
&\sim(1+\sqrt{\dfrac{\pi}{1-x}})/2\\
&\sim\frac12\sqrt{\dfrac{\pi}{1-x}}
\qquad\text{as } x \to 1\\
\end{array}
$
A: We will use the $\theta$ function, defined by $\theta(u)=\sum_{n\in \mathbb{Z}}e^{-\pi n^2u}$ for $u>0.$ It is known that (it can be proved by a direct application of Poisson's summation formula)
$$\theta(u)=\frac{1}{\sqrt{u}}\theta\left(\frac{1}{u}\right),\ u>0\ \ \ (1).$$ If $A(u)=\sum_{n\geq 0}e^{-\pi n^2u},\ u>0,$ then it is very easy to observe that $\theta(u)=2A(u)-1.$ Consequently, $(1)$ gives
$$2\sqrt{1-e^{-\pi u}}A(u)=\sqrt{\frac{1-e^{-\pi u}}{u}}\left(2A\left(\frac{1}{u}\right)-1\right)+\sqrt{1-e^{-\pi u}}.\ \ \ (2)$$
Now, by the definition of the derivative of $u\mapsto e^{-\pi u}$ at $0,$ we have that 
$$\lim_{u\rightarrow 0}\sqrt{\frac{1-e^{-\pi u}}{u}}=\sqrt{\pi}.\ \ \ (3)$$ 
Moreover, we have that
$$1\leq A\left(\frac{1}{u}\right) =1+\sum_{n\geq 1}e^{-\pi n^2/u}\leq 1+\sum_{n\geq 1}\int_{n-1}^ne^{-\pi x^2/u}dx\\=1+\int_0^{\infty}e^{-\pi x^2/u}dx=1+\frac{\sqrt{u}}{2},$$
where the last integral was computed by the change of variables $w=x\sqrt{\pi/u}$ and half of the known Gaussian integral. These inequalities and the squeeze theorem imply that 
$$\lim_{u\rightarrow 0^+}A\left(\frac{1}{u}\right)=1.\ \ \ (4)$$
Combining $(2),(3)$ and $(4)$, we obtain
$$\lim_{u\rightarrow 0^+}\sqrt{1-e^{-\pi u}}A(u)=\frac{\sqrt{\pi}}{2}.$$
Changing variables with $x=e^{-\pi u}$ in this limit yields the desired asymptotic formula.
