<s>[INST] How to compute the residue of $(z^2+2z+1)\sin\left(\frac{1}{1+z}\right)$ This was an example given in my notes but all it concluded was with something about an infinite principal part. How do we compute it? we have it equal to $ \left( z + 1 \right)^2 \cdot \sin \left( (z+1)^{-1}  \right) = \left( z + 1 \right)^2 \cdot \left[ (z+1)^{-1} + \cdots \right] $. That's all I could get. What now?
 [/INST] $z=-1$ is an essential singularity of the function. So we have $$(z^2+2z+1)\sin \frac{1}{1+z}=(z+1)^2\sin \frac{1}{1+z} $$ therefore $$(z+1)^2\sin \frac{1}{1+z}=(z+1)^2 \left(\frac{1}{1+z}-\frac{1}{3!(1+z)^3}+\frac{1}{5!(1+z)^5}-\cdots\right)$$ this shows that Res$[(z+1)^2\sin \frac{1}{1+z}, -1]=-\frac{1}{3!}$
</s>