I did some numerical approximation of $$\sum_{n=-\infty}^\infty \exp(-(x+n)^2)$$ and found that this function is "almost" constant ($\approx 1.772$). Why does the sum fluctuate little? Is there a closed form for this sum?

Added: since $f(x) = \sum_{n=-\infty}^\infty \exp(-(x+n)^2)$ has period $1$ and is even, can we give an upper bound of $\sup\{ f(x)/f(y) : (x,y)\in [0,0.5]^2\}$?

  • $\begingroup$ @ThomasAndrews I know $f$ is periodic, but this can't explain why it's almost constant. I check for $x$ ranging from $0$ to $1$, with step length $0.1$ $\endgroup$ Commented Aug 9, 2014 at 12:13
  • 1
    $\begingroup$ @LiuGang Calc$101$: If you wanna understand why some function is not constant, take its derivative! $\endgroup$
    – David H
    Commented Aug 9, 2014 at 12:24
  • $\begingroup$ @DavidH My curiosity is rather for the inverse question: why this function "is" constant $\endgroup$ Commented Aug 9, 2014 at 12:27
  • $\begingroup$ Intuitively this is fairly clear: the series is very rapidly convergent at a rate which is largely independent of $x$. More precise details are already in the answers. $\endgroup$ Commented Aug 9, 2014 at 14:53
  • $\begingroup$ Don't take this the wrong way, but...isn't this question a little silly? Are you surprised that the function $f(x)= \frac{\sin x}{1000000000000}$ is "almost" constant ? And if $g(x)$ is your function, then $1000000000000g(x)$ isn't quite as constant, is it? $\endgroup$
    – MPW
    Commented Aug 9, 2014 at 16:04

3 Answers 3


Recall the general case of the Poisson sum formula:

$$\sum_{-\infty}^\infty f(x+n) =\sum_{k=-\infty}^\infty e^{2\pi i k x} \int_{-\infty}^{\infty} e^{-2\pi i k y}f(y)\,dy$$

Then $\displaystyle\int_{-\infty}^{\infty} e^{-2\pi i k y}e^{-y^2}\,dy$ is a Gaussian integral, and (skipping the tedious step of completing the square) evaluates to $\sqrt{\pi} e^{ -k^2 \pi^2}$. So

$$\sum_{-\infty}^\infty e^{-(x+n)^2} = \sqrt{\pi}\sum_{k=-\infty}^\infty e^{2\pi i k x} e^{-k^2 \pi^2}=\sqrt{\pi}+2\sqrt{\pi}\sum_{k=1}^\infty e^{-k^2 \pi^2}\cos 2\pi kx $$

Observe that this means that the function has an average value of $\sqrt\pi$, and that we have a tower of corrections which are each exponentially smaller than the last. To a very good approximation, then, we can take the function to be $$\sqrt\pi+2\sqrt\pi e^{-\pi^2} \cos 2\pi x$$ with a variation around the value $\sqrt\pi\approx1.77245$ of merely $\pm2\sqrt\pi e^{-\pi^2}\approx\pm0.0002$. So the function is very flat.

This is also consistent with Dmoreno's observation that the sum is a Jacobi theta function, since the argument above amounts to a proof that $\vartheta_3(x;\tau)$ has its known Fourier expansion $$\vartheta_3(z,q)=\sum_{-\infty}^\infty q^{n^2}e^{2 i n z}=1+2\sum_{n=1}^\infty q^{n^2} \cos 2n z$$

for the case $q=e^{-\pi^2},$ $z=\pi x$.


We can generalize the above calculation to obtain the sum $$\sum\limits_{-\infty}^\infty \exp\left[-\left(\dfrac{x+n}{a}\right)^2\right] =\sqrt{\pi}|a|\vartheta_3(\pi x,e^{-\pi^2 a^2})=\sqrt{\pi}|a|\left[1+2\sum_{k=1}^\infty e^{-\pi^2 a^2 k^2} \cos(2\pi k x)\right]$$

Observe that if we pick $a$ to be small, then $e^{-a^2 \pi^2}$ (formally the elliptic nome $q$) need not be small. In that case the approximation given earlier breaks down. The cases $a=\pi^{-1}$ and $a=(2\pi)^{-1}$ give striking examples, as evident in these WolframAlpha plots [1] [2]: the sums definitely aren't flat!

To explain this in less formal terms, note that the sum consists of an infinite set of shifted Gaussians $\{e^{-(x+n)/a^2}\}$. If $a$ is small, then each Gaussian is narrowly peaked and does not overlap much with its neighbors; consequently, the sum of all of them together leads to a 'comb' of narrow peaks. But if $a$ is not small--and $a=1$ is not--then each Gaussian overlaps strongly with its neighbors, and so the resulting 'comb' due to the sum has its gaps mostly filled in (i.e. nearly flat.)

  • $\begingroup$ There should be a direct equivalence between this result and the Jacobi-theta expression of Dmoreno, but for some reason I'm having a hard time making it work...which perhaps the errors that @Did corrected may have something to do with (thank you!) $\endgroup$ Commented Aug 9, 2014 at 13:21
  • $\begingroup$ +1. Added some missing factors $\sqrt\pi$. (You are welcome!) $\endgroup$
    – Did
    Commented Aug 9, 2014 at 13:22
  • $\begingroup$ @Semiclassical Nice answer! +1. $\endgroup$ Commented Oct 26, 2014 at 19:19

Well, according to Mathematica:

$$\sum_{n=-\infty}^{\infty}\exp(-(x+n)^2) = \sqrt{\pi} \, \vartheta_3(\pi x, e^{-\pi^2}),$$ where $\vartheta_a(x,q)$ is the elliptic theta function.

Edit: a plot of the result as a function of $x$ when $x \in {(-10,10)}$ reveals an almost flat graph.

  • $\begingroup$ For comparison with other sources, note Mathematica gives the Jacobi theta functions in terms of the nome $q$ rather than the half-period ratio $\tau$. $\endgroup$ Commented Aug 9, 2014 at 13:55
  • $\begingroup$ If truth be told, I'm not an expert in this field of Mathematics, I just plugged the series into Mathematica and this result came up. However, thanks for your note. Could you please explain to me if this kind of functions appear in physics or in a more applied area? Wikipedia just addresses me to quantum mechanics. $\endgroup$
    – Dmoreno
    Commented Aug 9, 2014 at 13:58
  • $\begingroup$ If I'm honest, I'm not much of an expert either! But I did know enough to recognize the series as a Jacobi theta function. (The main reason for that note, actually, was that I couldn't match my answer to yours until I realized how Mathematica was defining $\vartheta_3$.) $\endgroup$ Commented Aug 9, 2014 at 14:00
  • $\begingroup$ Thank you again @Semiclassical, cheers! $\endgroup$
    – Dmoreno
    Commented Aug 9, 2014 at 14:03
  • $\begingroup$ They appear as partition functions of vacua in string theory, as I recall. $\endgroup$ Commented Aug 9, 2014 at 14:50

I'm not sure that this question can really have a conclusive answer, but here is something to think about.

Denoting the sum by $f(x)$, it is easy to show by shifting the variable of summation that $f(x)=f(x+1)$, that is, $f$ has period $1$. Moreover, $f(x)=f(-x)$. Therefore, all values of $f(x)$ are determined by its values on $0\le x\le\frac{1}{2}$. Since this is a short interval, you might reasonably expect that the values of $f(x)$ would not vary by much - though obviously you could make up an example where they did.

  • $\begingroup$ Thank you for this answer. I am wondering what prevents $f$ from fluctuating much over the interval $[0, \frac{1}{2}]$. Is it possible to give a upper bound(which is close to 1) of $\frac{f(x)}{f(y)}$? $\endgroup$ Commented Aug 9, 2014 at 12:24
  • $\begingroup$ Well,I'm not convinced by the argument that $[0,\frac{1}{2}]$ is a "short interval" since the function $x \mapsto 10^{10^{2x}}$ is $10^{10}$ at $\frac{1}{2}$, however the properties you pointed out are definitely interesting. $\endgroup$
    – Surb
    Commented Aug 9, 2014 at 12:44
  • 1
    $\begingroup$ @surb Of course your comment is correct. Perhaps you could re-read the first sentence and the last half sentence of my answer. $\endgroup$
    – David
    Commented Aug 9, 2014 at 12:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .