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)?