Residue of $\frac{1}{\cosh(z)}$. When looking at $f(z)= \frac{1}{\cosh(z)}$, I found a singularity at $i \frac{\pi}{2}+i \pi k$ with $k \in \mathbb{Z}$ which has to be a pole of order 1. Now, when looking for the residue at that pole, is it enough to look at $\lim_{z \to i \frac{\pi}{2}} \frac{z-i \frac{\pi}{2}}{\cosh(z)}=\frac{1}{\sinh(i \frac{\pi}{2})}=-i$? Or am I ignoring certain values of k?
 A: The residue is equal to $$\lim_{z \to z_a} \frac{z-z_a}{\cosh{z}}= \lim_{z \to z_a} \frac{1}{\frac{d}{dz}\;  \cosh{z}}= \lim_{z \to z_a} \frac{1}{\sinh{z}}$$
Where $z_a=i \pi \left(k+\frac{1}{2}\right)$ are the singularities.  Using the hyperbolic trigonometric identity: $$\cosh^2{z}-\sinh^2{z}=1$$
Now, we know that $\cosh{z}=0$ because we're interested in $\sinh{z}$ at the singularities to evaluate the residues.  Therefore, $$\sinh^2{z}=-1$$ $$\sinh{z}= \pm i$$
Now, plug this into the expression above to evaluate the residues and you get:
$$\operatorname{Res}\left(\operatorname{sech};z_k \right) = \frac{(-1)^k}{i},$$
A: Here $f(z)=\frac{2}{e^z+e^{-z}}=\frac{p(z)}{q(z)}$
$\text{ Since each of the singularity } z_k=\pi i/2 +\pi ik \text{ is a simple pole, use the result}$
$Res(f(z),z_k)=\frac{p(z_k)}{q'(z_k)}$
$ \implies Res(f(z),z_k)=\frac{2}{e^{\pi i/2 +\pi i k}-e^{-\pi i/2 -\pi ik}}=\frac{2}{i(e^{\pi i k}+e^{ -\pi ik})}=\frac{1}{i\cos (\pi k )}$
$\color{red}\therefore {\color{red} Res(f(z),z_k)=\frac{1}{i(-1)^k}}$
