The formula is $$-\sin(i)\sum_{n=0}^\infty (\frac{w}{2i})^n\sum_{n=0}^\infty (\frac{w}{i})^n\sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} (w)^{2n-1}.$$ I only want to get the coefficient of the $w^{-1}$ term, and the coefficients of other terms are negligible, so it looks like this
$$-\sin(i)\sum_{n=0}^\infty (\frac{w}{2i})^n\sum_{n=0}^\infty (\frac{w}{i})^n\sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} (w)^{2n-1} = -\sin(i)w^{-1}+ ...$$
I want to have this kind of expression because I'm finding the residue of a function $f$ at the point $i$, so I only need to know the coefficient of the $w^{-1}$ term.
I tried to use the small $o$ notation, but I don't know if I use it correctly. $$-\sin(i)\sum_{n=0}^\infty (\frac{w}{2i})^n\sum_{n=0}^\infty (\frac{w}{i})^n\sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} (w)^{2n-1} = -\sin(i)(1+o(1))(1+o(1))(w^-1+o(1)),$$ where $\Phi(w) = o(\Psi(w))$ means $lim_{w\to 0} \Phi(w)/\Psi(w) = 0$.
The product can be written in closed form, because the first two sums are geometric series $$\sum_{n=0}^\infty \left(\frac{w}{2i}\right)^n = \frac{1}{1-(w/2i)}=\frac{2}{2+iw}$$ $$\sum_{n=0}^\infty \left(\frac{w}{i}\right)^n=\frac{1}{1+iw}$$ an the third sum is related to $\cos x:$ $$\sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} w^{2n-1}= \frac{1}{w}\sum_{n=0}^\infty \frac{(-1)^n}{(2n)!} w^{2n}=\frac{\cos w}{w}$$ Therefore the result is $$-\frac{\sin i\cos w}{2 (2+iw)(1+w)w} = \left(-\frac{1}{w} + \frac{3i}{2} + \frac{9w}{4}+O(w^2)\right)\sin i$$