Evaluate the order of the pole in $1/(1-\cos(z))^2$ I'm trying to determine the order of the pole in the complex expression
$$f(z)=\frac{1}{(1-\cos(z))^2}$$
I have determined the pole to be  $z=2\pi n, n\in \mathbb{Z}$.
However, when I use the equation $\lim\limits_{z\rightarrow 2\pi n}[(z-2\pi n)^k f(z)]$ with $k=1$, it equals $\frac{0}{1}=0$ or that the function is analytical in the neighborhood. I have used L'Hôpital's rule repeatedly to obtain this result. I checked my answer with Wolfram Alpha, and it's supposed to have a pole of order $4$ and $z=2\pi n$. Where am I going wrong?

If a function $g$ has a pole of order $k$ then $g^2$ will have a pole of order $2k$. Using your method, we have by L'Hopital, $$\lim_{z\to2\pi n}\frac{z-2\pi n}{1-\cos z}=\lim_{z\to2\pi n}\frac1{\sin z}=\infty$$ but $$\lim_{z\to2\pi n}\frac{(z-2\pi n)^2}{1-\cos z}=\lim_{z\to2\pi n}\frac{2(z-2\pi n)}{\sin z}=\lim_{z\to2\pi n}\frac2{\cos z}=2$$ so $1/(1-\cos z)$ has a pole of order $2$. Therefore, $f(z)=1/(1-\cos z)^2$ has a pole of order $4$.
In your attempt, the limit with $k=1$ is in fact of the form $1/0$ not $0/1$, so $f$ is not analytic as you claim.
