I am trying to find determine the type of singular point $z=\frac{\pi}{2}$ is for the function, $$f(z)=\frac{z-\frac{\pi}{2}}{1-\sin(z)}.$$
My attempt:
I originally thought that $$\lim_{z\to\frac{\pi}{2}} z-\frac{\pi}{2}$$ was a simple zero and that $$\lim_{z\to\frac{\pi}{2}} 1-\sin(z)$$ was also a simple zero. Hence $z=\frac{\pi}{2}$ is a removable singularity. But the answer states that for $1-\sin(z)$, $z=\frac{\pi}{2}$ is a zero of order $2$. How can this be?
edit
However, if I use the fact that $z=\frac{\pi}{2}$ is a zero of order $k$ iff $$f(\frac{\pi}{2})=f'(\frac{\pi}{2})=..=f^{k-1}(\frac{\pi}{2})=0, \ \text{where} \ f^k(\frac{\pi}{2})\neq 0,$$ then $$f(\frac{\pi}{2})=1-\sin(\frac{\pi}{2})=0,$$ $$f'(\frac{\pi}{2})=-\cos(\frac{\pi}{2})=0,$$ $$f''(\frac{\pi}{2})=\sin(\frac{\pi}{2})\neq 0.$$ Hence $z=\frac{\pi}{2}$ is a zero of order $k=2$ for $1-\sin(z)$. Is this correct?
We can instead study $g(z):=f(z+\frac\pi2)$ at $z=0$.
$$\begin{align} g(z)&= \frac{z}{1-\cos z}\\ &=\frac{z}{z^2+O(z^3)}\\ &=\frac{z}{z^2\left(1+\frac{O(z^3)}{z^2}\right)}\\ &=\frac{1}z(1+O(z))\qquad{(1)}\\ &=\frac{1}z+O(1) \end{align} $$ $(1)$: by geometric series.
Thus it is a simple pole with residue $1$.
To see why $\frac1{1-\sin z}$ has a pole of order two at $z=\frac\pi2$, we can instead look at the order of zero of $1-\sin z$ at $z=\frac\pi2$.
$$\sin z=\cos\left(z-\frac{\pi}2\right)=1-\left(z-\frac\pi2\right)^2+\cdots$$
Hence, $$1-\sin z=\left(z-\frac\pi2\right)^2+\cdots$$
Obviously, that is a zero of order two, and its reciprocal will be a pole of order two.