On the inequality $ \int_{-\infty}^{+\infty}\frac{(p'(x))^2}{(p'(x))^2+(p(x))^2}\,dx \le n^{3/2}\pi.$ 
$ p(x)\in\mathbb{R[X]} $ is a polynomial of degree $n$ with no real
  roots. Show that: $$\int\limits_{-\infty}^{+\infty}\dfrac{(p'(x))^2}{(p'(x))^2+(p(x))^2}\,dx \leq n^{3/2}\pi.$$

It's easy to see that the degree of $ p$ has to be even.
For $n=2$ this integral is at most $2\pi$.
For $n>2$ the maximum value of this integral is obtained when all the imaginary parts of the roots of $p(x)$ tend to $0$, but I couldn't go further.  
Any help would be appreciated, thanks.

Edits by David Speyer: It seems very likely now that the optimum bound is $n \pi$, not $n^{3/2} \pi$. As pointed out in the comments below, and further in 23rd's question, this is the value we get in the limit where $p$ has double roots on the real axis. 
It seems likely that  moving the roots of $p$ away from the real axis can only make the integral less. Write the roots of $p$ as $a_j \pm i b_j$, so $p(x) = \prod ((x-a_j)^2 + b_j^2)$ and 
$$\frac{p'(x)}{p(x)} = \sum \frac{2 (x-a_j)}{(x-a_j)^2 + b_j^2}.\quad (\ast)$$ 
So making the $b_j$ larger tends to make $p'(x)/p(x)$ smaller, which makes the integral smaller. But this argument is not rigorous, because the terms of $(\ast)$ can have both positive and negative sign, so it could be that making the individual terms closer to $0$ makes the absolute value of $(\ast)$ larger. 
I don't see how to beat this issue easily.
Thus, I'm putting up a bounty for proving or disproving 
$$ \int_{-\infty}^{+\infty}\dfrac{(p'(x))^2}{(p'(x))^2+(p(x))^2}\,dx \leq n\pi.$$
 A: Without loss of generality, we may assume that $p$ is monic. Since $p$ has no real roots, $n=2m$ for some $m\ge 1$, and there exist  quadratic monic polynomials $q_1,\dots,q_m$ with no real roots such that $p=\prod_{k=1}^m q_k$. Therefore, by Cauchy-Schwarz inequality, 
$$ \left(\frac{p'}{p}\right)^2=\left(\sum_{k=1}^m \frac{q_k'}{q_k}\right)^2\le m\cdot \sum_{k=1}^m \left(\frac{q_k'}{q_k}\right)^2. \tag{1}$$
Denote $f(t):=\frac{t}{1+t}$ for $t\ge 0$. Note that $f$ is increasing and $f(s+t)\le f(s)+f(t)$. Then from $(1)$ it follows that
$$\frac{p'^2}{p'^2+p^2}=f\left(\left(\frac{p'}{p}\right)^2\right)\le \sum_{k=1}^m f\left(m\cdot\left(\frac{q_k'}{q_k}\right)^2\right). \tag{2}$$
For each $k$, since $q_k$ has no real roots, there exist $a_k\in\mathbb R$ and $c_k>0$ such that $q_k(x)=(x-a_k)^2+c_k$. Therefore,
$$\int_{-\infty}^{+\infty}f\left(m\cdot\left(\frac{q_k'(x)}{q_k(x)}\right)^2\right)dx\le \int_{-\infty}^{+\infty} f\left( \frac{4m}{(x-a_k)^2}\right)dx=2\sqrt{m}\cdot\pi.  \tag{3}$$
Combining $(2)$ and  $(3)$, we obtain that
$$\int_{-\infty}^{+\infty}\frac{p'^2(x)}{p'^2(x)+p^2(x)}dx\le 2^{-\frac{1}{2}}\cdot n^{\frac{3}{2}}\cdot\pi.$$
A: 1. Notation and the Main Statement
For each $\mathrm{z} \in \Bbb{C}^d$, we define
$$ p(t) = p(\mathrm{z}, t) = \prod_{j=1}^d (t - z_j), \qquad I = I(\mathrm{z}) = \int_{-\infty}^{\infty} \frac{p_{\mathrm{z}}'(t)^2}{p_{\mathrm{z}}(t)^2 + p_{\mathrm{z}}'(t)^2} \, \mathrm{d}t \tag{1} $$
whenever the denominator of the integrand does not vanish. Also by writing
$$ \frac{p'(\mathrm{z}, t)}{p(\mathrm{z}, t)} = \sum_{j=1}^d \frac{1}{t - z_j}, \quad I(\mathrm{z}) = \int_{-\infty}^{\infty} \frac{\mathrm{d}t}{1 + (p(\mathrm{z}, t)/p'(\mathrm{z}, t))^2},$$
we find that $I$ is well-defined and continuous on all of $\mathrm{x} \in \Bbb{R}^d$. (Continuity, for example, follows from the dominated convergence theorem.)
Then we claim the following proposition:

Proposition 1. For any $\mathrm{x} \in \Bbb{R}^d$ we have $I(\mathrm{x}) = \pi d$.

Notice that David Speyer gave a nice, complex analytic proof of this identiy in his answer. In my answer, we will take real analytic approach.

Counterexample 2. On the other hand, we find that for
  $$p(t) = (t-1)^4 (t^2 + 1/9),$$
  a numerical calculation by Mathematica 8.0 shows that
  $$ \frac{1}{\pi} I(i/3, -i/3, 1, 1, 1, 1) \approx 6.0058731199379896917, $$
  which exceeds $6$. Indeed, the graph of $u \mapsto \pi^{-1} I(iu, -iu, 1, 1, 1, 1)$ is given by



2. Preliminary
The following theorem plays a crucial role in proving Proposition 1:

Theorem 3. Let $x_0, x_1, \cdots, x_d \in \Bbb{R}$ and $c_1, \cdots, c_d > 0$. Then the function
  $$ \phi(t) = t - x_0 - \sum_{j=1}^d \frac{c_j}{t - x_j} $$
  is a measure-preserving transformation. Consequently, for any $f \in L^1(\Bbb{R})$ we have
  $$ \int_{-\infty}^{\infty} f(t) \, \mathrm{d}t = \int_{-\infty}^{\infty} f(\phi(t)) \, \mathrm{d}t. $$

We only give a sketch of proof (which is outlined in orangekid's answer): For each $u \in \Bbb{R}$, there exists exactly $d+1$ real solutions of $\phi(t) = u$. If we denote them in increasing order by $t_0(u), \cdots, t_d(u)$, then it is easy to check that


*

*$\sum_{j=0}^d t_j (u) = u + \sum_{j=0}^d x_j $,

*$ \phi^{-1}([u, v]) = \sum_{j=0}^d (t_j(v) - t_j(u)) = v-u$.


This proves that $\phi$ preserves the measure of compact intervals. Since the family of compact intervals generate the Borel $\sigma$-algebra on $\Bbb{R}$, this completes the proof. ■

3. Proof of Proposition 1
By continuity, it is enough to prove for $\mathrm{x} = (x_1, \cdots, x_d)$ such that $x_j \neq x_k$ whenever $j \neq k$. Then $p'(t) = p'(\mathrm{x}, t)$ has $d-1$ distinct real zeros and thus we can write
$$ p'(t) = d(t-y_1)\cdots(t-y_{d-1}). $$
Then by the partial fraction decompositon, we get
$$ \frac{p(t)}{p'(t)} = \frac{t}{d} - y_0 - \sum_{j=1}^{d-1} \frac{c_j}{t - y_j} $$
for some $y_0, c_1, \cdots, c_{d-1} \in \Bbb{R}$. In order to make use of Theorem 3, we need to prove that each $c_j$ is positive. Indeed,
$$ c_j = -\lim_{t\to y_j} \frac{p(t)}{p'(t)}(t - y_j) = -\frac{p(y_j)}{p''(y_j)} = \left(\frac{p(y_j)}{p''(y_j)}\right)^2 \frac{p'(y_j)^2 - p(y_j)p''(y_j)}{p(y_j)^2}. $$
Now by observing that
$$ \frac{p'(y_j)^2 - p(y_j)p''(y_j)}{p(y_j)^2} = \left. -\frac{\mathrm{d}}{\mathrm{d}t}\frac{p'(t)}{p(t)} \right|_{t=y_j} = \sum_{k=1}^{d} \frac{1}{(y_j - x_k)^{2}} > 0, $$
we indeed have $c_j > 0$. Then by Theorem 3, we have
$$ \quad I(\mathrm{x}) = \int_{-\infty}^{\infty} \frac{\mathrm{d}t}{1 + (p(t)/p'(t))^2} = \int_{-\infty}^{\infty} \frac{\mathrm{d}t}{1 + (t/d)^2} = \pi d $$
as desired. ■

4. Addendum - A possibly useful bound
In order to simplify the notation, we introduce the following function
$$ f(\mathrm{z}, t) = \frac{p'(\mathrm{z}, t)^2}{p(\mathrm{z}, t)^2 + p'(\mathrm{z}, t)^2}. $$
Also, if we are given $z_1, \cdots, z_d \in \Bbb{C}$ and a non-zero subset $J = \{j_1, \cdots, j_k\} \subset \{1, \cdots, d\} =: [d]$, let us denote 
$$ \mathrm{z} = (z_1, \bar{z}_1, \cdots, z_d, \bar{z}_d), \quad
\mathrm{z}_J = (\Re (z_{j_1}), \Re (z_{j_1}), \cdots, \Re (z_{j_k}), \Re (z_{j_k})). $$
In effect, $\mathrm{z}_J$ corresponds to the parameter which we obtain by taking limit as $\Im(z_j) \to 0$ for $j \in J$ and $\Im(z_j) \to \infty$ for $j \notin J$. That is, we can check that
$$ \lim_{\substack{\Im(z_j) \to 0; j \in J \\ \Im(z_j) \to \infty; j \notin J}} f(\mathrm{z}, t) = f(\mathrm{z}_J, t). $$
Then we can prove the following pointwise bound:
$$ f(\mathrm{z}, t) \leq \max_{J \subset [d]} f(\mathrm{z}_J, t). \tag{2} $$
In particular, if $\Re(z_j)$ are close to each other then performing numerical integration over the bound $(\text{2})$ gives a better upper bound of $I(\mathrm{z})$. For instance, if we denote $\alpha = \min_j \Re(z_j)$ and $\beta = \max_j \Re(z_j)$, then
\begin{align*}
t \in \Bbb{R}\setminus[\alpha, \beta]
&\quad \Longrightarrow \quad
 t - \Re(z_j) \text{ have the same sign for all } j \\
&\quad \Longrightarrow \quad
\left|\frac{p'(\mathrm{z}_{J}, t)}{p(\mathrm{z}_{J}, t)}\right| \leq \left|\frac{p'(\mathrm{z}_{[d]}, t)}{p(\mathrm{z}_{[d]}, t)}\right| \\
&\quad \Longrightarrow \quad
 f(\mathrm{z}_{J}, t) \leq f(\mathrm{z}_{[d]}, t).
\end{align*}
Consequently we get a simple bound
\begin{align*}
I(\mathrm{z})
&\leq (\beta - \alpha) + \int_{\Bbb{R}\setminus[\alpha, \beta]} f(\mathrm{z}_{[d]}, t) \, \mathrm{d}t \\
&\leq (\beta - \alpha) + 2\pi d.
\end{align*}
