argument principle with a polynomial The problem is: How many zeros of the polynomial 
$$
f(z)=z^4+3z^2+z+1
$$
lie in the right half-plane?
To solve this, we use the argument principle,
$$
\text{number of zeros}=\frac{1}{2\pi i}\int_{\partial\Omega}\frac{f'(z)}{f(z)}dz.
$$
Here 
$$
\partial\Omega=\{z=iy, -R\leq y\leq R\}\cup\{ z=Re^{i\theta},-\frac{\pi}{2}\leq \theta\leq\frac{\pi}{2}\}.
$$
It claims that 
$$
\int_{-iR}^{iR}\frac{f'(z)}{f(z)}dz=0.
$$
But I don't know why above equality holds. 
 A: We are going to prove that there is exactly one zero in the first quadrant. Since the polynomial has real coefficients it will have another zero in the fourth quadrant and therefore two zeros in the right half-plane. Let be 
$$
\gamma _1 \left( t \right):\left\{ \begin{gathered}
  x(t) = t \hfill \\
  y(t) = 0 \hfill \\ 
\end{gathered}  \right.\,\,\,\,\,\,\,0 \leqslant t \leqslant R
$$
Let be $C=\gamma_1+\gamma_2-\gamma_3$.
$$
\gamma _2 \left( t \right):\left\{ \begin{gathered}
  x(t) = R\cos (t) \hfill \\
  y(t) = R\sin (t) \hfill \\ 
\end{gathered}  \right.\,\,\,\,\,\,\,0 \leqslant t \leqslant \frac{\pi }
{2}
$$
Let be
$$
\gamma _3 \left( t \right):\left\{ \begin{gathered}
  x(t) = 0 \hfill \\
  y(t) = it \hfill \\ 
\end{gathered}  \right.\,\,\,\,\,\,\,0 \leqslant t \leqslant R
$$
We notice that there are no zeros on $\gamma_1$ since the coefficients are positive. Moreover we have that there are no zeros on $\gamma_3$ also. Indeed, we  have that
$$
f\left( {it} \right) = t^4  - 3t^2  + 1 + it
$$
which, of course is never zero for any $t\in \mathbb R$. let be $\gamma=\gamma_1+\gamma_2-\gamma_3$. Now, by argument principle, we have that
$$
N = \frac{1}
{{2\pi i}}\int\limits_C {\frac{{f'(z)}}
{{f(z)}}} dz = \frac{{\Delta _\gamma  \left( {\arg \left( {f(z)} \right)} \right)}}
{{2\pi }}
$$
where $N$ is the number of zeros inside $\gamma$. We have that
$$
\frac{{\Delta _\gamma  \left( {\arg \left( {f(z)} \right)} \right)}}
{{2\pi }} = \frac{{\Delta _{\gamma _1 } \left( {\arg \left( {f(z)} \right)} \right)}}
{{2\pi }} + \frac{{\Delta _{\gamma _2 } \left( {\arg \left( {f(z)} \right)} \right)}}
{{2\pi }} - \frac{{\Delta _{\gamma _3 } \left( {\arg \left( {f(z)} \right)} \right)}}
{{2\pi }}
$$
Now,
$$
\frac{{\Delta _{\gamma _1 } \left( {\arg \left( {f(z)} \right)} \right)}}
{{2\pi }} = 0
$$
because $f(x)>0$ on $\gamma_1$.
We notice that we can write $\gamma_2=Re^{it}$ with $0 \leq t \leq \pi/2$ and therefore we have that 
$$
\begin{gathered}
  \frac{{\Delta _{\gamma _2 } \left( {\arg \left( {f(z)} \right)} \right)}}
{{2\pi }} = \Delta _{\gamma _2 } \left( {\arg \left[ {R^4 e^{4it} \left( {1 + \frac{{3R^2 e^{2it}  + \operatorname{Re} ^{it}  + 1}}
{{R^4 e^{4it} }}} \right)} \right]} \right) =  \hfill \\
   = \frac{{4\left( {\frac{\pi }
{2}} \right) + o\left( {\frac{1}
{R}} \right)}}
{{2\pi }}\,,\,\,\,\,\,\,\left( {R \to  + \infty } \right) =  \hfill \\
   \hfill \\
   = 1 + o\left( {\frac{1}
{R}} \right),\,\,\,\,\,\left( {R \to  + \infty } \right) \hfill \\
   \hfill \\ 
\end{gathered} 
$$
Finally,
$$
\begin{gathered}
  \frac{{\Delta _{\gamma _3 } \left( {\arg \left( {f(z)} \right)} \right)}}
{{2\pi }} = \frac{{\arg \left( {f(iR)} \right) - \arg \left( {f(0)} \right)}}
{{2\pi }} =  \hfill \\
   \hfill \\
   = \frac{{\arg \left( {R^4  - 3R^2  + 1 + iR} \right)}}
{{2\pi }} =  \hfill \\
   \hfill \\
   = \frac{1}
{{2\pi }}\arg \left[ {R^4 \left( {1 - \frac{{3R^2  - 1 - iR}}
{{R^4 }}} \right)} \right] = 0 + o\left( {\frac{1}
{R}} \right)\,,\,\,\,\,\,\,\left( {R \to  + \infty } \right) \hfill \\ 
\end{gathered} 
$$
Therefore we have that $N=1$. Thus there are two zeros in the right half-plane.
