TITLE: Why is $\lim_{x\to 1}\sqrt{1-x}\sum_{n=0}^\infty x^{n^2}=\sqrt{\pi}/2\,\,$?
QUESTION [10 upvotes]: It is well-known that $\sum_{n=0}^\infty x^n=1/(1-x)$. However, it seems difficult to find $\sum_{n=0}^\infty x^{n^2}$. A natural problem is study its behavior around $1$. A problem states that
$$\lim_{x\to 1}\sqrt{1-x}\sum_{n=0}^\infty x^{n^2}=\sqrt{\pi}/2.$$
How can we prove this? Abel summation formula? Any others? I have no idea.

REPLY [2 votes]: We will use variable $q$ instead of $x$ so that we can visibly link the problem to theta functions. We have $$\vartheta_{3}(q) = \sum_{n = -\infty}^{\infty}q^{n^{2}} = \sqrt{\frac{2K}{\pi}}$$ where $K$ is the elliptic integral of first kind and $q = e^{-\pi K'/K}$. Now we can see that $$\sqrt{1 - q}\sum_{n = 0}^{\infty}q^{n^{2}} = \sqrt{1 - q}\cdot\frac{\vartheta_{3}(q) + 1}{2}$$ and then clearly $$\lim_{q \to 1^{-}}\sqrt{1 - q}\sum_{n = 0}^{\infty}q^{n^{2}} = \frac{1}{2}\lim_{q \to 1^{-}}\sqrt{1 - q}\vartheta_{3}(q) = \frac{1}{2}\lim_{q \to 1^{-}}\sqrt{\frac{2K(1 - q)}{\pi}}$$ and from $q = e^{-\pi K'/K}$ we can see that the limit is equal to $$\frac{1}{2}\lim_{k \to 1^{-}}\sqrt{2K'}$$ which is $$\frac{1}{2}\sqrt{\pi}$$ Here we have used the fact that as $q \to 1^{-}$ we have modulus $k \to 1^{-}$ so that $K' \to \pi/2$ and $K \to \infty$ and hence from $q = e^{-\pi K'/K}$ we get $$1 - q = \pi\frac{K'}{K} + o(1/K)$$ A more elementary answer by G. H. Hardy is available here.