# Estimating $\sum_1^\infty e^{-k^2}$

While reviewing the integral test, I remembered a formula for bounding sums the test applies to (non-negative, monotone decreasing $f(x)$): $$\sum_{N+1}^M f(n) \leq \int_N^M f(x)dx$$

Specifically, for $S_N = \sum_{k=1}^N e^{-k^2}$, $$S_\infty = \sum_{k=1}^\infty e^{-k^2} \leq \int_0^\infty e^{-x^2}dx = \frac{\sqrt{\pi}}{2}\operatorname{erf}(\infty) = \frac{\sqrt{\pi}}{2}$$

I computed $\frac{\sqrt{\pi}}{2}\operatorname{erf}(N) - S_N$ for large $N$ ($10^6$), and it seemed to converge to ~$0.49990832303943183$. This implies that $$\sum_{k=1}^\infty e^{-k^2} = \frac{\sqrt{\pi}}{2} - C,$$ where $C$ is ~$0.49990832303943183$. ries gives a few ideas for $C$, and also for $S_{10^6}$.

Can these estimates get any better? Or, fingers crossed, is there a closed form for this sum? Specifically without Jacobi Theta functions.

The only “closed” form of this sum is in terms of Jacobi theta functions. A better approximation (involving the erfc function) can be found using partial summation $$\sum_{k\leq N}e^{-k^{2}}=Ne^{-N^{2}}+2\int_{1}^{N}\left\lfloor t\right\rfloor te^{-t^{2}}dt$$ which means $$\sum_{k\geq1}e^{-k^{2}}=2\int_{1}^{\infty}t^{2}e^{-t^{2}}dt-2\int_{1}^{\infty}\left\{ t\right\} te^{-t^{2}}dt$$ where $\left\lfloor t\right\rfloor$ and $\left\{ t\right\}$ are the integer part of $t$ and the fractional part of $t$. Hence we have, using integration by pats, $$2\int_{1}^{\infty}t^{2}e^{-t^{2}}dt=\frac{1}{e}+\frac{\sqrt{\pi}}{2}\textrm{erfc}\left(1\right)\approx0.50782$$ so, noting that $\left\{ t\right\} \in\left[0,1\right)$, we have $$0\leq2\int_{1}^{\infty}\left\{ t\right\} te^{-t^{2}}dt\leq\frac{1}{e}$$ $$\sum_{k\geq1}e^{-k^{2}}=\frac{1}{e}+\frac{\sqrt{\pi}}{2}\textrm{erfc}\left(1\right)-C$$ with $C\in\left[0,1/e\right]$.