What are the residues of $\frac{z^2 e^z}{1+e^{2z}}$? I hope to know the singularity and pole of $\frac{z^2 e^z}{1+e^{2z}}$.
I try $\frac{z^2 e^z}{1+e^{2z}} = \frac{z^2}{e^{-z}+e^{z}}$ and observe that the denominator seems like cosine function. So I think the singularites are i(2n+1)$\pi$/2. But when I try to evaluate the poles, I fail and different values of $n$ has different residues. 
Could the residues be imaginary?

Since $\frac{z^2 e^z}{1+e^{2z}} = \frac{z^2}{2\cosh z}$, let's start with
$$f(z)=\frac{z^2}{2\cos iz}$$
Now both $z^2$ and $\cos iz$ are entire. The function can be singular only where $z_{0_n} = iz = \frac{\pi +2\pi n}{2}$ and since the zeroes of the denominators are first order, we have
$$\begin{align*}
Res f(z_{0_n}) & =\frac{z^2}{(2\cos iz)'}\bigg|_{z_{0_n}} \\ \\
 &  =\frac{\left(\frac{\pi +2\pi n}{2}\right)^2}{-2i\sin \left(\frac{\pi +2\pi n}{2}\right)} \\ \\ 
 &  =\frac{i\left(\pi +2\pi n\right)^2}{8\sin \left(\frac{\pi}{2} +\pi n\right)} \\ \\
 &  =\frac{i\pi^2\left(1 +2 n\right)^2}{8\cos\left(\pi n\right)} \\ \\
\end{align*}
$$
$$\boxed{Res f(z_{0_n})  =(-1)^n\frac{i\pi}{8}\left(1 +2 n\right)^2}$$
Compare with  WolframAlpha...
