The function is even, so its Fourier series has . In the convention ,
Twice applying integration by parts gives, for ,
Therefore the periodic Fourier representation is
with periodic continuation. The periodic extension is continuous, including the identified endpoints, and piecewise smooth, so the Fourier series converges to it. The coefficients also give absolute convergence and uniform convergence by comparison with .
At , the cosine cancels the alternating coefficient sign; at , it is identically one. These evaluations yield
The first identity solves the Basel problem.
The displayed definition uses iterated Eisenstein summation in weight two: the sum in is evaluated before the sum in , with the single term omitted. This order is essential. The two-dimensional lattice series does not have absolute convergence, so arbitrary rearrangement would not be justified.
For noninteger , the cosecant partial-fraction identity is
For completeness, apply the residue theorem to on squares with large half-integer sides. The cotangent is bounded on the contours and the integral is . Its residues at the integers are and its residue at is , proving the formula. If , the geometric-series expression , differentiated termwise, gives the cotangent partial-fraction Fourier kernel
Put with in the complex upper half-plane. For positive , this gives . Negative gives the same value, by replacing with in its inner sum. The row is , by the Basel problem. The resulting series in does have absolute convergence, locally uniformly in , so collecting the coefficient at is legitimate:
The coefficient is the sum-of-divisors function, since runs over the positive divisors of . Thus
There is no conflict with vanishing of weight-two level-one modular forms: the Eisenstein series of weight two has an anomalous transformation term, so it is not a weight-two modular form.
Write the function from the preceding part as . Its expansion at zero is
Hence the residue theorem gives
Choose . This circle stays a distance at least from every pole of , so is bounded uniformly on it. Moreover
Thus , and the ML inequality yields
Letting solves the Basel problem: