<s>[INST] Find residue of $f(z) = \frac{\sin z}{(z^2+1)^2}$ at $z = \infty$ Find residue of $f(z) = \dfrac{\sin z}{(z^2+1)^2}$ at $z = \infty$. Then this is the same as finding the residue at $z=0$ for $\dfrac{-1}{z^2}f(1/z)= \dfrac{-z^2 \sin 1/z}{(z^2+1)^2}$
$z = 0$ is a pole. But $z^n \sin 1/z \to \infty$ when $z \to 0, n = 1,2,3...$ Also the denominator is not $0$ when $z=0$. So I can't use famous formulas. Now, $-z^2\sin 1/z = \sum_{n = 0}^\infty {\dfrac{(-1)^{n-1}}{(2n+1)!z^{2n-1}}}$. But what I should do with $(z^2+1)^2$ I don't know. Also, the answer is $1/2e$ which suggests me that there is something tricky. Should I evaluate an integral over some circle? Also, I know that the residue at $z=\infty$ of $g(z) = \dfrac{\cos z}{(z^2+1)^2}$ is $0$, so $-\dfrac{1}{2\pi i}\int_{|z|=R}{g(z)dz}=0$, can this fact be of help? Any hints will be appreciated, thanks in advance.
 [/INST] The function $\frac{-z^2}{(z^2+1)^2}$ is holomorphic near $z=0$. So you can expand it as a power series at $z=0$:
$$
\frac{-z^2}{(z^2+1)^2}=a_0+a_1z+a_2z^2+\cdots\tag{1}
$$
where you can work out the coefficients by looking at the Taylor expansion of $\frac{z}{(z^2+1)^2}$ at $z=0$ and then multiply by $-z$.
Using the expansion of $\sin(z)$, you can write the Laurent series for $\sin(\frac1z)$ as
$$
\frac1z-\frac{1}{3!z^3}+\frac{1}{5!z^5}-\cdots\tag{2}
$$
Now multiply the two series (1) and (2) to find the coefficient of $\frac1z$:
$$
(a_0-\frac{a_2}{3!}+\frac{a_4}{5!}-\frac{a_6}{7!}+\cdots)\frac1z
$$

To find out the exact coefficients, observe that:
\begin{align}
\frac{-z^2}{(1+z^2)^2} &= \frac{z}2(\frac{1}{1+z^2})'
=\frac{z}2(1-z^2+z^4+\cdots)'\\
&=\frac{z}2(-2z+4z^3-6z^5+\cdots)\\
&=\frac12(-2z^2+4z^4-6z^6+\cdots)
\end{align}
So
$$
\begin{align}
(a_0-\frac{a_2}{3!}+\frac{a_4}{5!}-\frac{a_6}{7!}+\cdots)
&=\frac12\left(\frac{2}{3!}+\frac{4}{5!}+\frac{5}{6!}+\cdots\right)\\
&=\frac12\left(\frac{3-1}{3!}+\frac{5-1}{5!}+\frac{6-1}{6!}+\cdots\right)\\
&=\frac12\left(\frac{1}{2!}-\frac{1}{3!}
+\frac{1}{4!}-\frac{1}{5!}
+\frac{1}{6!}-\frac{1}{7!}
+\cdots\right)\\
&=\frac12\sum_{n=0}^\infty\frac{(-1)^n}{n!}=\frac{1}{2e}\;.
\end{align}
$$
</s>