# How to calculate $\sum_{k=1}^{\infty}x^{k^2}$ for different $x$

This is quick question, hopefully. How can I evaluate $f(x) = \sum_{k=1}^{\infty}x^{k^2}$? Some power series can easily be reduced to a geometric series, taylor series etc. via term wise integration/differentiation. I want to find an expression for $f(x)$ not involving series, to be able to calculate the exact value for the sum for different $x\in (-1,1)$. I've already shown that the radius of convergence is 1, and the series looks kind of like the regular geometric series. I've tried to do some term wise integration/differentiation, which however turned out to not work very well. Perhaps this is easy, but it has been a while since I was doing these kind of problems.

Cheers!

## 2 Answers

$\displaystyle \sum_{k = 1}^{\infty}x^{k^{2}} = -\,{1 \over 2} + {1 \over 2}\sum_{k = -\infty}^{\infty}x^{k^{2}} = \bbox[8px,border:1px groove navy]{{\vartheta_{3}\left(0,x\right) - 1 \over 2}}$ where $\displaystyle\vartheta_{\nu}$ is a Jacobi Theta Function.

As Felix Marin pointed out, your sum is very close to a Jacobi Theta Function.

There are an astounding number of identities for these functions.

For computing it, this identity relates small and large arguments:

If $g(x) = \sum_{k = 1}^{\infty}e^{-k^{2}\pi x}$ then $\dfrac{1+2g(x)}{1+2g(1/x)} =\dfrac1{\sqrt{x}}$.

Since $f(x) = \sum_{k=1}^{\infty}x^{k^2}$, $f(e^{-\pi x}) =g(x)$ or $f(x) = g(-\ln(x)/\pi)$.