I want to find the residue of $\displaystyle f=\frac{e^z+1}{\sin z}$ at $z=0$.
My solution was $2$, which I got using $\displaystyle \frac{e^z+1}{\sin z}=\frac{e^z}{\sin z}+\frac{1}{\sin z}$.
The residue for $\displaystyle Res_0\left( \frac{1}{\sin z} \right)=\lim_{z\rightarrow 0}z\frac{1}{\sin z}=\lim_{z\rightarrow 0}\frac{1}{\cos z}=1$
The residue for $\displaystyle Res_0\left( \frac{e^z}{\sin z} \right)=\lim_{z\rightarrow 0}z\frac{e^z}{\sin z}=\lim_{z\rightarrow 0}\frac{e^z+ze^z}{\cos z}=1$
Adding up the residues, the answer would be $2$.
Another question I have is regarding the order of residues. I know that for $\displaystyle \frac{a}{z^n}$ the order is $n$, but what happens with non-polynomials function like trigonometric in my case? I assumed the order of $0$ in $\displaystyle\frac{1}{\sin z}$ to be $1$, but I am not sure of what argument I could give here.