Determining the number of zeros in the upper half plane I have the following function:$$z^4+3iz^2+z-2+i$$
I need to find the number of zeros in the upper half plane. I wonder how one should go about solving such a problem. Help would be greatly appreciated!
P.S. This question has been asked before, but the answer in that question is sloppy, the links provided do not work.
Thanks!
 A: The usual method to attack such problems is Rouché's theorem. For that, we need to reduce the problem to a bounded region. But it's not hard to find a bound for the modulus of the zeros of a polynomial. Here we have
$$\lvert z^4 + 3iz^2 + z - 2 + i\rvert \geqslant \lvert z\rvert^4\biggl( 1 - \frac{3}{\lvert z\rvert^2} - \frac{1}{\lvert z\rvert^3} - \frac{3}{\lvert z\rvert^4}\biggr) \geqslant \lvert z\rvert^4 \biggl(1 - \frac{3}{9} - \frac{1}{27} - \frac{3}{81}\biggr) = \frac{19}{27}\lvert z\rvert^4 > 0$$
for $\lvert z\rvert \geqslant 3$, so we need to find the number of zeros of $f(z) = z^4 + 3iz^2 + z - 2 + i$ in the half-disk $D = \{z\in \mathbb{C} : \lvert z\rvert < 3,\, \operatorname{Im} z > 0\}$.
It remains to find a suitable function $g$ such that $\lvert f-g\rvert < \lvert f\rvert + \lvert g\rvert$ on $\partial D$ and the number of zeros of $g$ in $D$ is easy to determine.
On the circle $\lvert z\rvert = 3$, the dominating component of $f$ is the monomial $z^4$, so that needs to be included in $g$. One might be tempted to try $g(z) = z^4$, but that alone doesn't work, since it has a zero (of multiplicity four) on $\partial D$. We need to include some other term to avoid that.
Since $z^4$ is real and nonnegative on the real line, we can make sure that $g$ has no zeros on $\partial D$ by adding a (small enough) positive constant to $z^4$. The constant mustn't be too large in order to retain the inequality $\lvert f-g\rvert < \lvert f\rvert + \lvert g\rvert$ on the semicircular part of $\partial D$. In our case, we have a lot of wiggle room on the semicircle, so we can use $g(z) = z^4 + 1$. Verifying the premises of Rouché's theorem for that choice and determining the number of zeros of $g$ in $D$ isn't hard.
A: As suggested by another answer, we can deduce the desired number of roots
by consideration of argument. I'll like to present a slightly more geometric
view of this in the language of winding number.
Let $f(z) = z^4+3iz^2+z-2+i$ be the polynomial at hand.
For any $R > 0$, let $D_R$ be the semicircle of radius $R$ anchored at $z = 0$. More precisely,
$$D_R = \bigg\{ z \in \mathbb{C} : |z| < R \land \Re z > 0 \bigg\}$$
Let $C_R = \partial D_R$ be the boundary of $D_R$ (oriented in the counterclockwise direction). If $R$ is chosen so that
$f(z) \ne 0$ on $C_R$, then the number of roots of $f(z)$ inside $D_R$ is given by
a contour integral
$$N_R = \frac{1}{2\pi i} \int_{C_R} \frac{f'(z)}{f(z)} dz\tag{*1}$$
If $R$ is large enough so that $D_R$ contains all roots of $f(z)$ in the upper-half plane, then $N_R$ is the number of root we seek.
We don't really need to evaluate $(*1)$ directly.
The function $\frac{f'(z)}{f(z)}$ has a local antiderivative $\log f(z)$. If we start from some point on $C_R$, say $-R$, walk along $C_R$ counterclockwisely and analytic continue $\log f(z)$ along the way. By the time $z$ reaches the starting point $-R$ again, the final value of $\log f(z)$ will differ from the initial value by an amount $2\pi i N_R$. 
Taking exponential of the analytic continuation of $\log f(z)$ along $C_R$.
The number $N_R$ becomes the number of times $f(z)$ wraps around the origin as $z$ walk along the $C_R$. This is the winding number of the "curve" $f(C_R)$ with respect to the origin.
Back to the original problem and assume we have picked a $R$ large enough.
$C_R$ consists of two pieces, a line segment and a semicircle
$$C_R =  [ -R, R ] \cup \big\{ R e^{i\theta} : \theta \in [0,\pi ] \big\}$$ 
For $z \in [ -R, R ] \subset \mathbb{R}$, we have
$$\begin{cases}
\Re f(z) &= z^4 + z - 2,\\
\Im f(z) &= 3z^2+1
\end{cases}
\quad\implies\quad \Im f(z) > 0
$$
This means $f([-R,R])$ lies completely inside upper half-plane.
Notice when $z \to \pm \infty$, $\Re f(z) \to \infty$, $\Im f(z) \to \infty$ while $\frac{\Im f(z)}{\Re f(z)} \to 0$. The endpoints of $f([-R,R])$ lies in the $1^{st}$ quadrant near the $+ve$ $x$-axis. The contribution from $[-R,R]$ to the winding number is smaller than $\frac14$
and vanishes as $R \to \infty$.
On the semicircle $z = Re^{i\theta}$. When $R$ is large, $f(z)$ is dominated by the $z^4$ term. As $\theta$ varies from $0$ to $\pi$, $z^4 = R^4 e^{i4\theta}$ wraps around the origin twice. So the contribution from the semicircle to the
winding number is $2$ plus another small number.
Combine these two pieces, we find the desired winding number
$$N_R = \verb/small number/ + ( 2 + \verb/another small number/ )$$
Since $N_R$ is always an integer, $N_R = 2$ for large $R$.
As a result, the function $f(z)$ has two roots on the upper half-plane.
At the end is a picture showing what happens to $f(C_R)$ when $R = 2$.
The red section is $f([-R,0])$, the orange section is $f([0,R])$ and
the green and blue sections are those for $f(R e^{i\theta})$ where $\theta$ belongs to $[0,\frac{\pi}{2}]$ and $[\frac{\pi}{2},\pi]$ respectively. As one can see,
$R = 2$ is large enough and the image $f(C_2)$ wraps around the origin twice.
This means the two roots in the upper half-plane satisfy $|z| < 2$.
$\hspace0.75in$ 
A: HINT: You can do an argument variation. Integrate the function along a contour which surrounds the upper half plane. A popular choice is the half circle with straight line along real axis from -R to R and with radius R and then letting $R \to \infty$.
