Residue of $f(z) = \frac{z}{1-\cos(z)}$ at $z=0$ I've been self-studying some complex variables and just started on residues. I'm looking at a problem where I've been asked to calculate the residue of:
$$f(z) = \frac{z}{1-\cos(z)}$$ 
at $z=0$. I'm not really sure how to find the Laurent series of this function, and I can't really apply Cauchy's integral formula either. So I would appreciate if anyone can get me started.
 A: The first question you should ask is what type of singularity $f(z)$ has at $z = 0$.  Since $z$ has a zero of order $1$ and $1 - cos(z)$ has a zero of order $2$, $f(z)$ has a simple pole.  This means $zf(z)$ has a removable singularity, and relating the power series expansion at $0$ of $f(z)$ and $zf(z)$, you know that the residue of $f(z)$ at $z = 0$ is the value of $zf(z)$ at $z = 0$.  Now you need to find this value.  
A: Write the (first few terms of the) Taylor series for $\cos z$, and subtract this from 1. You should find that the result can be written in the form $1-\cos z=az^2+bz^4+\cdots$ for some constants $a$ and $b$, and where the dots represent higher powers of $z$. Then think about using the binomial theorem to pin down the coefficient of $z^{-1}$ in 
$$ f(z) = \frac{z}{1-\cos z}=\frac{z}{az^2(1+\frac{b}{a}z^2+\cdots)}.$$ 
A: Using the power series $\cos(z)=1-\frac12z^2+O(z^4)$ yields
$$
\begin{align}
f(z)
&=\frac{z}{1-(1-\frac12z^2+O(z^4))}\\
&=\frac{1}{\frac12z+O(z^3)}\\
&=\frac{1}{z}\frac{1}{\frac12+O(z^2)}\\
&=\frac{1}{z}(2+O(z^2))
\end{align}
$$
Thus the residue is $2$

Another thought is to write
$$
\begin{align}
\frac{z}{1-\cos(z)}
&=\frac{z^2}{\sin^2(z)}\frac{1+\cos(z)}{z}\\
&=\frac{1}{1+O(z^2)}\cdot\frac{2+O(z^2)}{z}
\end{align}
$$
again giving a residue of $2$.
A: $\displaystyle\text{Res}=\lim_{z\to0}(z-0)f(z)=\lim\frac{z^2}{1-\cos z}$. Now use l'Hopital's rule twice.
