Using complex analysis for evaluating summations: some general queries So, I was reading some old course materials, and came across the following summation, which is to be evaluated through complex analysis:
$$\sum_{-\infty}^{\infty}\frac{1}{n^2+a^2}, \ \ \ \ \ \ \ a\ne 0$$
I am fine with the mathematical manipulation for the most part. Instead, I am more curious as to the motivations between a couple of points in the method (below).
In my course notes, the following is written:
"Firstly, one considers the integral
$$I_N(a) = \oint_{\mathcal{C}} \frac{\pi \cot(\pi z)}{z^2+a^2} dz$$
Where the contour $\mathcal{C}$ is the circle of radius $N+1/2$ ($N$ integer), and centred on the origin. This contour contains $2N+1$ poles of the function $\pi\cot(\pi z)$ (integers from $-N$ to $N$), as well as $\pm ia$ from $(z^2+a^2)^{-1}$ (assuming $N+1/2 > |a|$) leading to:
$$I_N(a) = \sum_{-N}^{N} \frac{2i\pi}{n^2+a^2}+2i\pi\left(\frac{\pi\cot(i\pi a)}{2ia} + \frac{\pi\cot(-i\pi a)}{-2i\pi a}\right) = \sum_{-N}^{N}\frac{2i\pi}{n^2+a^2}-2i\pi\frac{\pi\coth{\pi a}}{a}$$
But $I_N(a)\propto N^{-1}$ as $N\rightarrow \infty$ since the numerator is of order $1$, the denominator $N^2$, and the contour length is of order $N$, leading (in the limit) to:
$$\sum_{-\infty}^{\infty}\frac{1}{n^2+a^2} = \frac{\pi}{a}\coth(\pi a),\ \ \ \ \ \ a\ne 0$$"
Q1) EDIT: Now understood thanks to the answers and comments below

What caught my attention revisiting this, is how seemingly "out of nowhere" the function $\pi\cot(\pi z)$ seems to have appeared. For sums like this (and any other that can be analysed similarly), how is such an integral as $I_N(a)$ above even determined- what motivates the decision to choose this integral? (i.e. why is the $\pi\cot(\pi z)$ required to correctly determine this sum? Is it arbitrary? Are there other integrals that would yield the same results?)

Q2) EDIT: Now understood thanks to Ron Gordon's answer (below)

Is there any significance to the contour being of radius $N+1/2$ in this example? If I understand correctly, radius $N$ would cause the perimeter of the contour to lie on another pole; but why can we not use, say $N+1/4$, or $N-1/2$ as the radius, or some other non-integer radius? What motivates this decision?

Q3) EDIT: Now understood thanks to Ron Gordon's answer + comments (below)

$2N+1$ poles of $\pi\cot(\pi z)$ within the contour? Simple thing here- I think I've confused myself slightly, thinking that there are $2N$ integers in the range $[-N, N]$... Am I correct in thinking that the $+1$ accounts for $0$ being a pole? (and if the radius is different, as per Q2) above, is there an easy way to determine how many poles you have for a periodic function like this?)

Q4) EDIT: Now understood thanks to Ron Gordon's answer (below)

"...and the contour length is of order $N$"- just a sanity check really- is the significance of the contour length contributing in the limit of $I_N(a)$ ($N\rightarrow\infty$) because it is effectively a line integral? Not sure if I'm just overthinking, or misunderstanding exactly what's going on here, so a clarification would be appreciated.

Any sort of pointers in the right direction, or things for me to think about to try and understand this would be very welcome!
Thanks :)
 A: These are some good questions.  Let me try to answer:

*

*Yeah, this is hard.  The idea is that we need a function that has poles at the integers and is bounded on a contour as the size of the region bounded by the contour becomes infinite.  The function $\pi \cot{(\pi z)}$ fits the bill.  But I understand the bemusement at this function just magically appearing out of nowhere.

The problem is, it is very difficult to find other functions.  For example, the function $\Gamma{(z)}$ has poles at the nonpositive integers, residue $(-1)^n/n!$.  But $\Gamma{(z)}$ is unbounded over the increasingly large contours you see in your proofs with $\pi \cot{(\pi z)}$, so it won't work.


*No real significance, so long as the contours do not intersect poles.


*Yes, zero is a pole.  You can prove that the poles are the only ones with the contour using, e.g., Rouche's Theorem.


*A contour integral is essentially a line integral, in that one parametrizes each portion of the contour for computation.  The idea is that the magnitude of such an integral is bounded as the size of the region enclosed by the contour increases without bound.
