I am interested in counting the purely imaginary roots of $P(x)$ which has integer coefficients and $P(x) \ne 0$.
I consider 3 cases:
The powers of $x$ in the terms of $P$ are odd. The imaginary roots of $P(x)$ correspond to the real roots of $P(ix)$. But since all powers of $x$ are odd, the $i$ will appear in every term except the constant term, $c$, to give $c + iS(x)$. This is real when $S(x)=0$...but it can never be zero. So if the powers are all odd there are no purely imaginary roots.
When the powers share a common divisor, $d$, let $R(x^d) = P(x)$. Counting the number of imaginary roots reduces to two cases: a. if $d$ is even, count the positive (or negative) roots of $R(x)$ when $d/2$ is even (or odd) and multiplying by 2. Example: for $x^4 + 10x^2 + 1$, $d=2$ and there are 4 imaginary roots, two each for the negative roots of $x^2 + 10x + 1$. b. if $d$ is odd, there will be an imaginary root for $P(x)$ for each imaginary root of $R(x)$. Example: for $x^12 + 10x^6 + 1$, $d=3$ and there are 4 imaginary roots, each corresponding (though not equal) to the imaginary roots of $R(x) = x^4 + 10*x^2 + 1$
When the exponents are mixed (even and odd), and share no common divisor, then let $P(ix) = E(x) + x^m i e(x)$ where $E(x)$ has all even powers of $P$ (including the constant term) and $m$ is the smallest odd exponent in $P$, e.g. for $P(x) = x^5 + 2x^4 + x^3 - 1$, $E(x) = 2x^4 - 1$, $m = 3$ and $e(x) = x^2 - 1$. The real roots of $P(ix)$ are the real roots in common between $E(x)$ and $x^me(x)$. Since $E(x)$ includes the constant term, $E(0) \ne 0$ so the $x^m$ can be disregarded. So whether or not $P(x)$ has imaginary roots depends on whether or not $E(x)$ and $e(x)$ will share any real roots in common. In general, yes. For example, using the expression from this post we have $P(x) = x^5 - 6x^4 + 15x^3 - 34x^2 + 36x - 48$ from which we identify $E(x) = -6x^4 + 34x^2 - 48$ and $e(x) = x^4 - 15x^2 + 36$ which share the common roots of $x^2 = 3$. But this would have been evident if the expression had been factored at the outset to show that $x^2 + 3$ was a factor giving rise to two imaginary roots.
The question I have continues from (3) by adding the constraint that $P(x)$ is irreducible over $\mathbb{Q}$. Will irreducible $P(x)$ (in which the $gcd$ of the powers of $x$ is 1 and both even and odd exponents are present) have any imaginary roots or, equivalently, will $E(x)$ and $e(x)$ share any real roots in common?
Note: although we know that two irreducibles share no roots in common, $E(x)$ and $e(x)$ might no longer be irreducible as demonstrated by the first irreducible expression given in (3) which produced $E(x) = 2x^4 - 1$ and $e(x) = x^2 - 1$ (which, though they have real roots, have no common real factor so there are no purely imaginary roots for $x^5 + 2x^4 + x^3 - 1$.)
Thanks for any help.
You have a full algorithm to determine the existence of pure imaginary roots.
The number obtained in step 3 is the number of pure imaginary roots of $P$.
You asked if there are irreducible polynomials (I assume over $\mathbb{Q}$) with pure imaginary roots.
Yes, many $P(x)= x^2+a$ for $a$ a non-square in $\mathbb{Q}$.
If $ia$ is algebraic then its minimal polynomial is of the form $\prod_k(x^2+a_k)$, where $a_k$ are the conjugates of $a^2$. Therefore, all terms of $P$ have even degree.