Question about the multiplicities of zeros of a complex function 
Let $f$ be analytic at $z_0$ and suppose $f(z_0)=0$. We say that the order of zero or multiplicity of $f$ at $z_0$ is $N$ if there exists an analytic function $h$ such that $f(z)=(z-z_0)^Nh(z)$ with $h(z)\ne0$.

My question is: what if $h(z)=0$ and you can't factor out a $(z-z_0)$ from it? For example, let $f(z)=(z^2+1)^3(1+e^{\pi z})^2$. What is the multiplicity of $i$? I tried differentiating it again and again until $f^{(n+1)}(i)\ne0$ but it gets HELLA long so I was hoping there was another way to solve this. Thank you for all your help.
 A: Power series are your friends:
$$(z^2+1)^3(1+e^{\pi z})^2=(z+i)^3(z-i)^3\left(1+e^{\pi i} e^{\pi(z-i)}\right)^2=$$
$$=(z+i)^3(z-i)^3\left(1- \left(1+\frac{\pi(z-i)}{1!}+\frac{\pi^2(z-i)^2}{2!}+\frac{\pi^3(z-i)^3}{3!}+\ldots\right)\right)^2=$$
$$=(z+i)^3(z-i)^3\left(\pi^2(z-i)^2+\pi^3(z-i)^3+\ldots\right)=$$
$$=\color{red}{(z-i)^5}\overbrace{\left[(z+i)^3+(z+i)^3(z-i)+\ldots\right]}^{=h(z)}$$
and indeed $\;h(i)=(2i)^3=-8i\neq0$
The same idea works pretty nicely many times when trying to find out what the residue of a pole of order two or more is, say when trying to integrate something, though in that case Laurent Series are our friends.
A: A possible trick is doing it at $0$ instead of $i$, which is accomplished by considering $z=w+i$. Clearly, the order of $f(z)$ at $i$ is the same as the order of $f(w+i)$ at $0$.
Now $z^2+1=w^2+2wi=w(w+2i)$ and $1+e^{\pi z}=1-e^{\pi w}$. Thus
$$
f(w+i)=w^3(w+2i)^5(1-e^{\pi w})^2
$$
Now recall that
$$
g(w)=\frac{1-e^{\pi w}}{w}
$$
has a removable singularity at $0$ and we can extend it by $g(0)=-\pi$ (the derivative of $-e^{\pi w}$ at $0$). Thus
$$
f(w+i)=w^5(w+2i)^3g(w)^2
$$
This shows the requested order is $5$. You can now go back to $z$, if you prefer:
$$
f(z)=(z-i)^5(z+i)^3g(z-i)^2
$$
