Ways to find the sum of complex roots with only positive imaginary parts? I have an $n$-th order polynomial which has either 1 real root with $(n-1)$ complex roots for $n$ odd, or only complex roots for $n$ even. Is there a way to obtain the sum of all positive imaginary roots?
For example, here is a method to attempt to get there:
Let $r_1,...,r_n$ be be the roots of the polynomial $f(x)=(x-r_1)...(x-r_n)=\sum_{k=0}^{n} c_k x^k$.
Using vieta's formulas, $\sum_{k=1}^{n} r_k = -c_{n-1}/c_n$. Since the complex roots are conjugate, and the real parts repeat in the conjugate roots, it can be derived that the real positives which show up twice while the imaginary parts cancel out, for $n$ even sum up to $\frac{1}{2}\sum_{k=1}^{n}r_k=-\frac{c_{n-1}}{2c_n}$. If $n$ is odd, then the additional real root is excluded from this sum. Is there a way to obtain something like this with a fairly simple formula but only for the imaginary parts? Or can this not be done? This is what i'm asking in summary
$$
\sum_{k=1}^{n}\{r_k|Im(r_k)>0\}=?
$$
 A: This is pretty much as hard as finding the roots individually, for the following reason. Suppose there was some simple procedure (say some simple function of the coefficients) which produced, from a polynomial $f(x)$, the sum of the roots of $f$ with positive imaginary part. Then if we apply the procedure to $f(x - bi)$, we'd get the sum of the complex roots of $f$ with imaginary part greater than $b$. This already shows that the procedure can't be a continuous function of the coefficients, since this sum changes discontinuously as $b$ increases and crosses the imaginary part of a root. By varying $b$ and watching where the sum changes we can isolate the imaginary parts of every root (either exactly or to arbitrary precision depending on how "simple" the simple procedure is). This already gets us every root generically, although not if multiple roots share exactly the same imaginary part. But in that case we can consider modifications like $f(e^{i \theta} (x - bi))$ which have the effect of rotating the roots.
