January 19th
Today I learn an application of the (truncated) Poisson summation formula to compute the quadratic Gauss sum. We begin by presenting the truncated Poisson summation formula. Fix $f:\RR\to\CC$ satisfying some boundedness conditions to give is a Fourier series. Dirichlet's theorem on representing functions by a Fourier series on $f:[0,1]\to\CC$ says that\[\frac{f(0^-)+f(1^+)}2=\sum_{n=-\infty}^\infty\int_0^1f(x)e^{-2\pi inx}\,dx.\]That is, our Fourier series represents the average of the limits approaching the point for a piecewise continuous function. I don't know the proof of this, but Fourier analysis is sad. Running the above with $f(x+k)$ for integers $k$ reveals\[\frac{f(k^-)+f(k+1^+)}2=\sum_{n=-\infty}^\infty\int_0^1f(x+k)e^{-2\pi ix}\,dx=\sum_{n=-\infty}^\infty\int_k^{k+1}f(x)e^{-2\pi inx}\,dx,\]so summing up to $m$ implies that\[\frac12f(0)+f(1)+\cdots+f(m-1)+\frac12f(m)=\sum_{n=-\infty}^\infty\int_0^mf(x)e^{-2\pi inx}\,dx.\]This is the truncated Poisson summation formula. We remark that adding the flipped sum with $m\mapsto-m$ and then sending $m\to\infty$ recovers the original Poisson summation formula.
This is a different proof than the one we had before, but it has the advantage of dealing with finite sum. This is important because the quadratic Gauss sum is also finite. In particular, taking $f(k)=e^{2\pi ik^2/m}$ makes the summation read\[g_m=\sum_{k=0}^{m-1}e^{2\pi ik^2/m}=\frac12f(0)+f(1)+\cdots+f(m-1)+\frac12f(m).\]It follows that\[g_m=\sum_{n=-\infty}^\infty\int_0^me^{2\pi ix^2/m}e^{-2\pi inx}\,dx.\]From here, the proof is computation. Completing the square, this is\[g_m=\sum_{n=-\infty}^\infty e^{-2\pi imn^2/4}\int_0^me^{2\pi i(x-mn/2)^2/m}\,dx.\]In particular, we may shift the integral to\[g_m=\sum_{n=-\infty}^\infty e^{-2\pi imn^2/4}\int_{mn/2}^{m(n+2)/2}e^{2\pi ix^2/m}\,dx.\]We would like to use the sum to collapse the integral into an infinite one, but this requires some care due to the scale factor $e^{-2\pi imn^2/4}.$ Well, for $n$ even, $mn^2/4$ is an integer, so the scale factor is just $1.$ Thus,\[\sum_{\substack{n=-\infty\\n\text{ even}}}^\infty e^{-2\pi imn^2/4}\int_{mn/2}^{m(n+2)/2}e^{2\pi ix^2/m}\,dx=\int_{-\infty}^\infty e^{2\pi ix^2/m}\,dx.\]And for $n$ odd, $n^2\equiv1\pmod4,$ so the scale factor comes out to $i^{-m}.$ Thus,\[\sum_{\substack{n=-\infty\\n\text{ odd}}}^\infty e^{-2\pi imn^2/4}\int_{mn/2}^{m(n+2)/2}e^{2\pi ix^2/m}\,dx=i^{-m}\int_{-\infty}^\infty e^{2\pi ix^2/m}\,dx.\]It follows that\[g_m=\left(1+i^{-m}\right)\int_{-\infty}^\infty e^{2\pi ix^2/m}\,dx=\left(1+i^{-m}\right)\sqrt m\int_{-\infty}^\infty e^{2\pi ix^2}\,dx.\]This integral is not easy to evaluate, but it isn't dependent on $m,$ so we can evaluate it by taking $m=1.$ Here $g_m=1,$ so the integral is $\frac1{1+i^{-1}}=\frac{1+i}2.$ Thus,\[g_m=\frac{\left(1+i^{-m}\right)(1+i)}2\sqrt m.\]Because $i^m$ only depends on $m\pmod4,$ we might as well do the casework, which gives\[\boxed{g_m=\begin{cases} (1+i)\sqrt m & m\equiv0\pmod4, \\ \sqrt m & m\equiv1\pmod4, \\ 0 & m\equiv2\pmod4, \\ i\sqrt m & m\equiv3\pmod4.\end{cases}}\]This finishes the proof.
I would be remiss if I didn't prove quadratic reciprocity from this. As usual, for $p$ an odd prime and $a$ not divisible by $p,$ define\[g_p(a)=\sum_{k=0}^{p-1}\left(\frac kp\right)e^{2\pi iak/p}.\]Adding in $\sum e^{2\pi ian/p}=0$ to this sum, we find that\[g_p(a)=\sum_{k=0}^{p-1}\left(1+\left(\frac kp\right)\right)e^{2\pi iak/p}=\sum_{k=0}^{p-1}e^{2\pi iak^2/p}\]because $1+\left(\frac kp\right)$ is $2$ for nonzero squares, $1$ for zero, and $0$ otherwise. (Just count the number of times an element $k^2\pmod p$ appears in both sums.) In particular, $g_p(1)=g_p,$ which we evaluated above. However,\[\left(\frac ap\right)g_p(a)=\sum_{k=0}^{p-1}\left(\frac{ak}p\right)e^{2\pi iak/p}=g_p(1).\]To finish, we evaluate $g_{pq}$ twice, which is the main character of this story. One way is as above. Alternatively, we can use the Chinese remainder theorem to give a bijection $\ZZ/p\ZZ\times\ZZ/q\ZZ\to\ZZ/(pq)\ZZ$ by $(x,y)\mapsto xq+yp.$ (I haven't seen this before, but it is bijective.) It follows\[g_{pq}=\sum_{x=0}^{p-1}\sum_{y=0}^{q-1}e^{2\pi i(xp+yq)^2/pq}.\]We can expand this out because the cross term $2xy\cdot pq$ will die to periodicity. This is\[g_{pq}=\left(\sum_{x=0}^{p-1}e^{2\pi ipx^2/q}\right)\left(\sum_{y=0}^{q-1}e^{2\pi iqy^2/p}\right)=g_q(p)g_p(q).\]It follows that\[\left(\frac pq\right)\left(\frac qp\right)=\frac{g_q(p)g_p(q)}{g_qg_p}=\frac{g_{pq}}{g_pg_q}.\]Plugging in our evaluation of $g_\bullet$ from above recovers quadratic reciprocity.