Why does this method work? I have been reading my professor's solutions to a problem where I was instructed to find the residue at a singularity of a particular function.
The function is:
$$f(z) = \frac{1}{1+\mathrm{cosh}(z)}$$
The singularities for this function are at 
$$z_n = (2n+1)\pi i, n \in \mathbb{Z}$$
My professor asserts that all of the poles are order 2 and gives the following reasoning.

Each singularity is a pole of order 2 since
\begin{equation}
\lim_{z\rightarrow z_n}\dfrac{(z-z_n)^2}{1+\mathrm{cosh}(z)} = \lim_{z \rightarrow z_n}\dfrac{2(z-z_n)}{\mathrm{sinh}(z)}
 = \lim_{z \rightarrow z_n}\dfrac{2}{\mathrm{cosh}(z)}
 = \lim_{z \rightarrow z_n}\dfrac{2}{\mathrm{cosh}(2n+1)\pi i}
 = -2
 \ne 0
\end{equation}

What is going on here? What theorem is being used to figure this out and why can't it be applied to any even number (e.g. 4 or 6)?

With $$\cosh z=\frac{e^{iz}+e^{-iz}}{2},$$ your given function $f(z)$ can be rewritten as $$f(z)=\frac{2e^{iz}}{e^{2iz}+2e^{iz}+1}.$$ The denominator can be factored as a perfect square. What does than mean for its roots?
