# Discrepancy in the Application of the Identity $\sum_{n=-\infty}^\infty f(n) = -\sum_{j=1}^l \operatorname{Res}(g;a_j)$

The theorem in its entirety is as follows:

Let $a_1,\ldots,a_l\in\mathbb{C}$ be pairwise different non-integral numbers. Let f be an analytic function in $\mathbb{C}-\{a_1,\ldots,a_l\}$ and set $g(z):=\pi \cot(\pi z)f(z)$, such that $|z^2f(z)|$ is bounded outside a suitable compact set. Then:

$$\sum_{n=-\infty}^\infty f(n) = -\sum_{j=1}^l \operatorname{Res}(g;a_j)$$

The book wants me to use this theorem to prove that $\sum_{n=1}^\infty \frac{1}{n^{2}} = \frac{\pi^2}{6}$. Everything points to me setting $f(z)=\frac{1}{z^2}$, but the pole of $\frac{1}{z^2}$ is zero which is an integral number and is thus a point at which f must be analytic, thus the theorem cannot be applied, what am I missing here? Thanks.

Edit: I guess I'm suppose to slightly modify the theorem so it works for an overlapping pole, I probably don't need clarification on this after all.

-

Hint: you are on the right track. Try the function $$f(z) = \frac{1}{z^2 +a^2}$$ which coincides with your guess in the limit $a\to 0$. The additional term in the sum (due to the pole of $g(z)$ at $z=0$ can be simply subtracted). The rest of $\sum_n f(n)$ is two times the requested sum. Take the limit $a\to0$ and you are done...

-