<s>[INST] Residue ${{(z+1)^2}\sin(1/z)}\over{(3z+1)^2}$ 
Calculate residue at $z=0$ of $\dfrac{{(z+1)^2\sin(1/z)}}{(3z+1)^2}$

It is essential singularity.So I am trying to get Laurent series expansion.Which in this case is hard because requires combing two expansions.
 [/INST] If you are familiar with the residue at infinity, you can reduce your problem to a simpler one. Set
$$ f(z) = \left( \frac{z+1}{3z+1} \right)^2 \sin \left( \frac{1}{z} \right). $$
The function $f$ has isolated singularities at $z = 0, -\frac{1}{3}, \infty$. Let us calculate the residue at infinity first. We have
$$ -\frac{1}{z^2} f \left( \frac{1}{z} \right) = -\frac{1}{z^2} \left( \frac{\frac{1}{z}  + 1}{\frac{3}{z} + 1} \right)^2 \sin(z) = -\frac{1}{z^2} \left( \frac{1+z}{3 + z} \right)^2 \sin(z). $$
Since $\left( \frac{1+z}{3+z} \right)^2 \sin(z)$ is holomorphic at $z = 0$, we see that the residue at infinity is zero. Since the total sum of residues is always zero, we have
$$ \operatorname{Res}(f, 0) = -\operatorname{Res} \left( f, -\frac{1}{3} 
\right) $$
so it is enough to calculate $\operatorname{Res} \left( f, -\frac{1}{3} 
\right)$. We have
$$ f(z) = \frac{(z+1)^2}{9} \sin \left( \frac{1}{z} \right) \frac{1}{ \left( z + \frac{1}{3} \right)^2} = \frac{g(z)}{\left( z + \frac{1}{3} \right)^2}$$
for $g$ which is holomorphic at $z = -\frac{1}{3}$. Hence, the residue $\operatorname{Res} \left( f, -\frac{1}{3} 
\right)$ will be $g' \left( -\frac{1}{3} \right)$ which can be calculated directly.
</s>