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?
 A: You wouldn't have to do the rewrite, but it's easier for the residue calculation. The only thing you have to see is that the nominator doesn't have any singularities and neither does the denominator (except at $\infty$).
The only singularities are due to the denominator being zero. Then you use Euler formula (using $z=x+iy$ with read $x$ and $y$):
$$1 + e^{2z} = 1 + e^{2x}(\cos(2y)+i\sin(2y))$$
For this to be zero you will first have to have $\sin(2y) = 0$ which means that $cos(2y) = \pm1$, but also that $\cos(2x)<0$ since $e^{2y} > 0$. It follows that $\cos(2y) = -1$. Now that means that $e^{2x}=1$. So we have that $x=0$ and $y=(n-1/2)\pi$. That is
$$z = i(n-1/2)\pi$$
That you get different $z$ for each value of $n$ is as it should as you have infinitely many values for which the denominator is zero.
For the residue calculation we rewrite it as
$${z^2e^{z}\over1+e^{2z}} = {z^2\over\cos(-iz)}$$
Now to calculate the residue we can note that we could cancel the poles by multiplying with $z-i(n-1/2)\pi$ which would reveal the $c_{-1}$ laurent coefficient as the limit:
$$\operatorname{Res} = \lim_{z\to i(n-1/2)\pi} {z^2(z-i(n-1/2)\pi)\over\cos(-iz)}$$ 
Then use $\lim_{z\to0}\sin(z)/z = 1$, or l'Hospitals rule:
$$\operatorname{Res} = (i(n-1/2)\pi)^2\lim_{z\to i(n-1/2)\pi} {(z-i(n-1/2)\pi)\over\cos(-iz)} = (i(n-1/2)\pi)^2 {1\over -\sin( (n-1/2)\pi )}$$ 
A: Ok, so to evaluate the residue of a pole of order $m$, at $z_0$ you can use the formula
\begin{equation}
Res(z_0) = \frac{1}{(m-1)!} \lim_{z \rightarrow z_0} \frac{d^{m-1}}{d z^{m-1}} [(z - z_0)^m f(z)].
\end{equation}
Now in this case, the poles are of order 1, i.e. $m = 1$, so the formula just becomes
\begin{equation}
Res(z_0) = \lim_{z \rightarrow z_0} [(z - z_0) f(z)].
\end{equation}
Now in your case this limit is undefined as you get $Res(z_0) = 0/0$, however, you should be able to apply L'Hopital's rule once to actually produce the correct value of the limit.
A: let $z_n=i(n-1/2)\pi $ and $r_n$ be the residue at the pole at $z_n$
$$  r_n =  \lim_{z \to z_m} (z-z_n)f(z) $$
$$= z_n^2 e^{z_n}   \lim_{z \to z_m}   \frac{z-z_n}{    {1+e^{2z}}}$$
you can apply L'hopital to get 
$$ r_n = z_n^2 e^{z_n}   \lim_{z \to z_m}   \frac{1}{    {2e^{2z}}} = \frac 12   z_n^2 e^{-z_n}$$
A: You can write your function $f$ as the quotient $g/h$ of the two entire functions $g\colon z\mapsto ze^z$ and $h\colon z\mapsto 1+e^{2z}$.
If $w$ is such that $h(w)=1+e^{2w}=0$ (you already found all such $w$'s), then since $h'(z)=2e^{2z}$ for all complex number $z$, you find that $h'(w)=2e^{2w}=-2\neq 0$, and so $w$ is a zero of order $1$ of $h$, hence a pole of order $1$ of $f$.
You can also notice that $e^{2w}=-1$, so $e^w=\pm i$, or more precisely $-e^w = (-1)^{\mathrm{Im}(w)/\pi - 1/2}i$.
You can now use the formula for poles of order $1$ to compute the residue of $f$ at $w$:
$$\mathrm{Res}(f,w)=\lim_{z\to w}\ (z-w)f(z)$$
To compute this limit, you can just notice that $\dfrac{z-w}{h(z)}=\dfrac{z-w}{h(z)-h(w)}$ is the inverse of a difference quotient.
$$\mathrm{Res}(f,w)=\lim_{z\to w}\ (z-w)\dfrac{g(z)}{h(z)}=\dfrac{g(w)}{h'(w)}=-\dfrac{w^2e^w}{2}=(-1)^{\mathrm{Im(w)}/\pi-1/2}\dfrac{iw^2}2$$
A: 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...
