<s>[INST] Residue of $f(z) = \frac{z-2}{z^2}\sin(\frac{1}{1-z})$ at $z = 1$ Given the complex function $f(z) = \frac{z-2}{z^2}\sin(\frac{1}{1-z})$, how can we calculate the residue at the essential singularity at $z = 1$?
 [/INST] Let us define $\xi=z-1$ (such that we can calculate the residue at $\xi=0$). The function is given by
$$\frac{1-\xi}{(1+\xi)^2} \sin(\xi^{-1}).$$ For the residue, we need to obtain the coefficient in front of $\xi^{-1}$ in the Laurent expansion around $\xi=0$. We have the Laurent expansions 
 $$\sin(\xi^{-1}) = \sum_{k=0}^\infty \frac{(-1)^k}{(2k+1)!\xi^{2k+1}}$$ and
$$\frac{1-\xi}{(1+\xi)^2} = \sum_{k=0}^\infty (-1)^k (2k+1) \xi^k$$ valid for $0<|\xi|<1$.
As the original function is the product of these functions, the residue (= coefficient in front of $\xi^{-1}$) is given by
$$
\begin{align}
\text{Res}_{z=1}\left[\frac{z-2}{z^2}\sin\left(\frac{1}{1-z}\right) \right]
&= \sum_{k=0}^\infty \frac{(-1)^k}{(2k+1)!} (-1)^{2k} (4k+1) \\
&=\sum_{k=0}^\infty \frac{(-1)^k [2 (2k +1 ) -1]}{(2k+1)!}  \\
&= 2\cos(1) - \sin(1) \approx 0.24
\end{align}$$
</s>