Question. Let $P_d = \{ p \in \mathbb{R}[x] : \deg p = d\}$ denote the set of all degree $d$ polynomials with real coefficients. Also, for $p \in \mathbb{R}[x]$, define
$$ I(p) = \frac{1}{\pi} \int_{-\infty}^{\infty}\frac{p'(x)^2}{p(x)^2+p'(x)^2}\,\mathrm{d}x. $$
Is it possible to identify the supremum of $I(\cdot)$ over $P_d$? In other words, what is
$$ C_d := \sup_{p \in P_d} I(p) = \ ? $$
This question is motivated by this posting. Here are some observations:
If $p \in P_d$ has only real zeros, then $I(p) = d$ holds. (See this and this.)
$I(p) \leq d^{3/2}$ for any $p \in P_d$. Indeed, write $p(x) = a (x - \alpha_1) \dots (x - \alpha_d)$. Then by the Cauchy-Schwarz inequality, $$ \left| \frac{p'(x)}{p(x)} \right|^2 = \left| \sum_{k=1}^{d} \frac{1}{x - \alpha_k} \right|^2 \leq d \sum_{k=1}^{d} \frac{1}{\left| x - \alpha_k \right|^2}. $$ Now by noting that the map $f(t) = \frac{t}{t+1}$ is increasing and subadditive for $t \geq 0$, \begin{align*} I(p) &= \frac{1}{\pi} \int_{-\infty}^{\infty} f\biggl( \left| \frac{p'(x)}{p(x)} \right|^2 \biggr) \, \mathrm{d}x \\ &\leq \sum_{k=1}^{d} \frac{1}{\pi} \int_{-\infty}^{\infty} f\biggl( \frac{d}{\left| x - \alpha_k \right|^2} \biggr) \,\mathrm{d}x \\ &\leq \sum_{k=1}^{d} \frac{1}{\pi} \int_{-\infty}^{\infty} f\biggl( \frac{d}{(x - \operatorname{Re}(\alpha_k))^2} \biggr) \,\mathrm{d}x \\ &= d^{3/2}. \end{align*} In particular, we learn that $d \leq C_d \leq d^{3/2}$.
When $d = 2$, we can show that $C_2 = 2$ by using the first part and a direct computation.
For $d \geq 4$, we seem to have $C_d > d$. Indeed, numerical experiments reveal that we can find $a, b > 0$ satisfying $$I((x^2+a^2)(x - b)^{d-2}) > d.$$ However, $C_d$ seems much smaller than $d^{3/2}$, differing from $d$ only by a tiny fraction.
A simple computation shows that $$ I(p) = d - 2 \sum_{\substack{\alpha : \operatorname{Im}(\alpha) < 0 \\ p(\alpha) = ip'(\alpha) }} \operatorname{Re} \biggl( \frac{1}{1+p''(\alpha)/p(\alpha)} \biggr). $$ This provides an alternative proof of part 1. Indeed, if $p$ has only real zeros, then $\operatorname{Im}\bigl(\frac{p'(z)}{p(z)}\bigr)$ and $\operatorname{Im}(z)$ always have the opposite signs, and so, the summation part in the above formula vanishes.