<s>[INST] $\pi \cot (\pi z) = \frac{1}{z} + \sum_{n \in \mathbb{Z},\ n \neq 0} \frac{1}{z-n}+ \frac{1}{n}$ I'm reading the proof that $$\pi \cot (\pi z) = \frac{1}{z} + \sum_{n \in \mathbb{Z},\  n \neq 0} \frac{1}{z-n}+ \frac{1}{n}$$
There is a function $$h(z) =\pi \cot (\pi z) -[ \frac{1}{z} + \sum_{n \in \mathbb{Z},\  n \neq 0} \frac{1}{z-n}+ \frac{1}{n} ]$$ and the proof states that $h(1) = 0$. 
I don't understand this point, why $h(1) = 0$ ?
 [/INST] Consider the function
$$d(z) = \pi \cot \pi z - \frac{1}{z-1}$$
in a neighbourhood of $1$. Writing $z = 1+h$, we have
$$\begin{align}
d(1+h) &= \pi\frac{\cos \pi(1+h)}{\sin \pi(1+h)} - \frac{1}{h}\\
&= \pi \frac{-\cos \pi h}{-\sin \pi h} - \frac{1}{h}\\
&= \frac{1 - \frac{\pi^2h^2}{2} + O(h^4)}{h\left(1 - \frac{\pi^2h^2}{6}+O(h^4)\right)} - \frac{1}{h}\\
&= \frac{1}{h}\left(1- \frac{\pi^2h^2}{2}+O(h^4)\right)\left(1 + \frac{\pi^2h^2}{6}+O(h^4)\right) - \frac{1}{h}\\
&= \frac{1}{h}\left(1-\frac{\pi^2h^2}{3} + O(h^4)\right) - \frac{1}{h}\\
&= -\frac{\pi^2h}{3} + O(h^3),
\end{align}$$
so $d$ has a removable singularity in $1$, and after removing it, we have $d(1) = 0$.
Then it remains to see that
$$e(z) = \left(\frac{1}{z} + \sum_{n\neq 0} \frac{1}{z-n}+\frac{1}{n}\right) - \frac{1}{z-1} = \frac{1}{z} + 1 + \sum_{n\notin \{0,1\}} \frac{1}{z-n} + \frac{1}{n}$$
also has a zero in $1$. Having cancelled the $\frac{1}{z-1}$ term, we can compute $e(1)$ simply by substituting $1$ for $z$ in the last representation. The sums nicely telescope then and yield the expected result. Since $h(z) = d(z) - e(z)$, that concludes the proof.
</s>