Finding poles of $f(z) = z/(1-\cos z)$ I'm trying to self-learn complex analysis and am working on a question (from a practice exam) that asks me to find all the poles of
$$f(z) = {z\over 1-\cos z}$$
and compute the residues at each pole. Now if $z_0 = 2\pi n$ where $n$ is a nonzero integer, then
$$\lim_{z\to z_0} {(z-z_0)^2 z\over 1-\cos z} =
\lim_{z\to z_0} {2(z-z_0) z + (z-z_0)^2 \over \sin z} =
\lim_{z\to z_0} {4z - 2z_0 + (z-z_0) \over \cos z} = 2z_0,
$$
which is neither zero nor infinity, so $f$ has a pole of order $2$ at all of these points. If you try this with $z_0 = 0$ and $m=1$, you get
$$\lim_{z\to 0} {z^{2} \over 1-\cos z} = \lim_{z\to 0} {2z\over \sin z} = \lim_{z\to 0} {2\over \cos z} =2,$$
which says that $0$ is a pole of order $1$ and also tells us that the residue at $0$ is $2$.
I decided to check if these are the correct poles and typed this into WolframAlpha:
https://www.wolframalpha.com/input?i=poles+of+z%2F%281-cos+z%29
It says that there is no pole at $z=0$, which is strange. Am I misunderstanding the concept of pole? My definition of pole (I'm learning out of Complex Variables by Francis J. Flanagan) is $z_0$ such that $\lim z\to z_0 |f(z)| = \infty$, and by this definition, $0$ is a pole.
(By the way, I still have to compute the residues here which is a huge mess according to the formula I know:
$$ {\rm Res}(f; z_0) = \lim_{z\to z_0} ((z-z_0)^2 f(z))'$$
so I guess a subquestion would be: Is there any way to compute these residues without differentiating the inside of that and then using l'Hospital's rule over and over? WolframAlpha says the answer should be $2$ at every pole.)
 A: Alright let's see if I can answer this. We have the function $$f(z)=\frac{z}{1-\cos(z)}$$
We want to find all poles and residues at said poles.
First look at the numerator. This is just the identity function, and will not have a pole as it is analytical throughout the complex plane. However, we can note that at the origin, it is $0$, which may cause problems. Let's set this aside for now.
For the denominator, the poles exist at the solutions of $$1-\cos(z)=0$$
$$\implies z=2\pi n,\quad n\in\mathbb{Z}$$
Now what about the degree of the poles?
We could observe that by reducing the entire denominator into one single term, to wit, $1-\cos(z)=2\sin^2\left(\frac z2\right)$, this would mean that the multiplicity of all poles should be two. Now at $0$, we can see that this would become an indeterminate form. You can intuitively think (similar to the $\frac{z}{\sin(z)}$ case) that the zero from the top cancels out one degree of the pole and makes the pole at the origin degree $1$ instead. I don't recommend doing this because for trigonometric functions the multiplicity of the pole based purely on power is a tentative thing.
What you did is also plausible. Recall that if $z=c$ is a pole of order $n$, then the residue of $f$ around $c$ can be found by
$$\mathop{\mathrm{Res}}_{z = c}f(z) = \frac{1}{(n-1)!} \lim_{z \to c} \frac{\text{d}^{n-1}}{\text{d}z^{n-1}} \left[ (z-c)^n f(z) \right]$$
We can test degree by degree upwards, letting $n=1$ first, and increasing $n$ based on the following fact: if the limit is infinite, increase $n$ by $1$ and try again. By this, we test that all poles have a multiplicity of $2$ except the one at the origin which has a multiplicity of $1$. You can also find all residues this way(though I do indeed get 2, contrary to what you get but w/e)
This is of course tedious, so we can instead use a third  method. Invert $f$ by raising it to the $-1$st power. Call this $g(z)$.
If $g(z) = g '(z) = 0$, $g ''(z)\ne0$ , then $z$ is a double zero.
If $g(z) = g '(z) = g ''(z) = 0$, $g '''(z)\ne0$ , then $z$ is a triple zero.
And so on.
By this, we can see that all zeroes have a multiplicity of $2$, except for the one at $0$ which has a multiplicity of $1$.

Am I misunderstanding the concept of pole?

so the answer to this question (as already established in the comments is W|A is wrong and you're correct)
Alternatively, you could also use a laurent series expansion. We have $$1-\cos(z)=1-\left[\cos(2 n \pi) - \sin(2 n \pi) (z - 2n\pi) - 
 \frac 12 \cos(2 n\pi) (z - 2 n\pi)^2 + 
 \frac 16 \sin(2 n\pi)(z - 2 n\pi)^3+\frac 1{24}\cos(2n\pi)(z-2 n\pi)^4-\frac1{120}\sin(2n\pi)(z-2n\pi)^5-\frac1{720}\cos(2n\pi)(z-2n\pi)^6+\mathcal{O}(z-2n\pi)^7
\right]$$
so $$\frac{z}{1-\cos(z)}=\frac{z}{1-\cos(2 n \pi) + \sin(2 n \pi) (z - 2n\pi) + 
 \frac 12 \cos(2 n\pi) (z - 2 n\pi)^2 - 
 \frac 16 \sin(2 n\pi)(z - 2 n\pi)^3-\frac 1{24}\cos(2n\pi)(z-2 n\pi)^4+\frac1{120}\sin(2n\pi)(z-2n\pi)^5+\frac1{720}\cos(2n\pi)(z-2n\pi)^6+\mathcal{O}(z-2n\pi)^7}$$
There are two cases. First, $n\neq 0$. WLOG $n=1$. Plug this in and after some manipulation we see that the lowest two terms are $$\frac{4\pi}{(z-2\pi)^2} +\frac{2}{z-2\pi}+...$$
We can tell two things from this. First, the lowest degree is the multiplicity of the pole (which is multiplicity $2$). Next, the residue is the coefficient of the term with degree $-1$, and it is $2$.
The next case is $n=0$, to which we can plug this in, and a nice symmetry of the denominator and numerator will cause the series to become $$\frac2z+\frac z6+...$$
Hence, the degree of the pole is $1$, and the residue at this pole is still $2$.
As a matter of fact, if you do some tedious algebra bashing of the more general series, you will see that the coefficient of the term with the degree $-1$ will always be $2$(and hence, residue will always be $2$).
Usually when using laurent series however, we just focus on finding the residue, not the degree of the pole unless explicitly asked. Furthermore, as you can see in this case, it may be quite inconvenient, (and if you work out the algebra i've ommitted and shortcut mathematica used) especially if it is expanded in the denominator.
Typically building a Laurent series, we would use a geometric series, binomial series, taylor series(like in this case), or any easily availible series to expand out a known term(s) and simplify enough such that you can find the coefficient of the $z^{-1}$ term(ie matching indicies, shortcut PFD, etc).

Is there any way to compute these residues without differentiating the inside of that and then using l'Hospital's rule over and over?

the answer to this question would then be that if you don't want to use the higher order pole residue formula, find the function's laurent series and then look for the coefficient of the term $z^{-1}$
A: Among all the singularities  i.e. $z_0=2\pi n i, n\in\mathbb Z$,  $z_0=0$ should be specially treated as the numerator is zero there while the rest of the singularities are poles of order $2$ because the denominator $g(z)=1-\cos z$ has zero of order $2$ there. Verify it by checking $g(2n\pi i)=g'(2n\pi i)=0$ but $g''(2n\pi i)\ne0$ for all $n\in\mathbb Z-\{0\}$.
To identify the nature of singularity of $f(z)$ at $z_0=0$, either you observe that the factor $\lim_{z\rightarrow 0}\frac{z/2}{\sin z/2}=1$ so that $f(z)$ eventually depends upon the factor $\frac{1}{\sin z/2}$ which has simple pole at $0$; or you can directly expand $f(z)$ about $z_0=0$ to get
$f(z)=\frac{2}{z}\left(1+z^2/12-O(z^4) \right)$
to see that there is a simple pole there with residue given by coeffiecient of $1/z$ i.e. $2$.
