Application of argument principle Do you have any idea to prove the following formula?
$\int_{-j \infty }^{+j \infty}  \frac{f'(z)}{f(z)} dz = -\pi j (N_{Z} - N_{P})$ 


*

*$f(z)$ is a rational function

*$N_{P}$ is the number of poles in the right half plane.

*$N_{Z}$ is the number of zeros in the right half plane.


For a Jordan curve $C$ and a rational function $f(z)$, we obtain the following (the argument principle).
$\oint_{C} \frac{f'(z)}{f(z)}dz  = 2\pi j(Z-P)$
where $Z$ and $P$ are respectively, the number of zeros and poles of $f$ inside the region defined by $C$.
I guess the first formula is an application of the argument principle.
 A: Suppose first that $p(z)=\sum_{k=0}^{n} a_k z^k$  is a polynomial without zeros on the imaginary axis and let $\gamma(t):= R e^{\frac{\pi}{2}jt}$,  for $t\in[-1,1]$.
By argument principle, 
$$\int_{jR}^{-jR} \frac{p'(z)}{p(z)} dz + \int_{\gamma} \frac{p'(z)}{p(z)} dz = 2\pi j Z, $$
where $Z$ is the number of zeros of $p$ inside the region defined by the semi-circle of radius $R$.
One has that
$$ \int_{\gamma} \frac{p'(z)}{p(z)} dz = 
  j\frac{\pi}{2}\int_{-1}^{1} \frac{nR^{n}a_{n}e^{n\frac{\pi}{2}jt}+\cdots+Ra_{1}e^{\frac{\pi}{2}jt}}{R^{n}a_{n}e^{n\frac{\pi}{2}jt}+\cdots+a_{0}} dt
$$
Thus, by dominated convergence theorem
$$ \lim_{R\rightarrow \infty}\int_{\gamma} \frac{p'(z)}{p(z)} dz = j\frac{\pi}{2} \int_{-1}^{1} \lim_{R\rightarrow \infty} \frac{nR^{n}a_{n}e^{n\frac{\pi}{2}jt}+\cdots+Ra_{1}e^{\frac{\pi}{2}jt}}{R^{n}a_{n}e^{n\frac{\pi}{2}jt}+\cdots+a_{0}} dt = j\frac{\pi}{2} \int_{-1}^{1} n\,dt= jn\pi $$
Consequently, 
$$ \int_{-j\infty}^{j\infty} \frac{p'(z)}{p(z)} dz = -(2\pi j Z-jn\pi)= (n-2Z)\pi j, $$
where $Z$ is now the number of zeros of $p$ in the open right half-plane.
(An alternative proof that does not use argument principle can be seen in Mathematical Systems Theory I, Proposition 3.4.3)
For the case where $f=p/q\,$ is a rational function, note first that 
$$ \int_{-j\infty}^{j\infty} \frac{p'(z)}{p(z)} dz =  (\ln |p(z)| + j\arg p(z))\, \vert_{-j\infty}^{j\infty} = j\lim_{\omega\rightarrow\infty} (\arg p(j\omega) - \arg p(-j\omega))$$
which implies that 
$$\lim_{\omega\rightarrow\infty} (\arg p(j\omega) - \arg p(-j\omega)) = (n-2Z)\pi $$
Thus
$$
\begin{eqnarray} 
\int_{-j\infty}^{j\infty} \frac{f'(z)}{f(z)} dz  &=& 
j\lim_{\omega\rightarrow\infty} \left(\arg \frac{p(j\omega)}{q(j\omega)} - \arg \frac{p(-j\omega)}{q(-j\omega)}\right) \\ 
&=&  
j\lim_{\omega\rightarrow\infty} (\arg p(j\omega) - \arg p(-j\omega) - 
(\arg q(j\omega) - \arg q(-j\omega))) \\
&=& j\pi(n - 2N_Z - 2N_P - \deg(q))
\end{eqnarray}
$$
