Given a cubic polynomial
$$ x^3 + c_2 x^2 + c_1 x + c_0 = 0 $$
We know that the coefficients can be factored into different functions of the roots, for example, given roots $r_1$, $r_2$, and $r_3$:
$$ c_0 = -r_1 r_2 r_3, \\c_1 = r_1r_2 + r_2r_3 + r_1 r_3 \\ c_2 = -(r_1 + r_2 + r_3) $$
For cubic equations with real coefficients I know that there is at least one real root. I can use the imaginary part of the $c_2$ equation to then give me that:
$$ r_{2i} = - r_{3i }$$
because $c_2$ and $r_1$ are real. However, this confuses me when I get to the $c_1$ equation and check:
$$ \text{Im}[c_1] = 0 = \text{Im} [ r_1 ( r_2 + r_3 ) + r_2 r_3 ] = \text{Im}[ r_2 r_3] = \text{Im}[r_{2r}r_{3r} + r_{2i}r_{3i} + i(r_{2r} r_{3i}+ r_{3r}r_{2i})] $$
Since $r_{3i} = - r_{2i}$, this would seem to imply that $r_{2r} = r_{3r}$, the roots are complex conjugates of each other. I know that this is the case when the other two roots are complex, but it's obviously not true when there are 3 real roots. Where am I going wrong here?
.
Yes, except when $r_{2i} = r_{3i}=0$, in which case $r_{2r}$ and $r_{3r}$ may assume arbitrary values, thus making $r_2$ and $r_3$ arbitrary real values, corresponding to the case of three real roots.
More precisely ,
$$\mbox{Im}[r_{2r}r_{3r}+r_{2i}r_{3i} + i(r_{2r}r_{3i} + r_{2i}r_{3r})] = r_{2r}r_{3i}+r_{2i}r_{3r} = r_{3i}(r_{2r} - r_{3r}) = 0$$
This means that $r_{2r} = r_{3r}$ only when $r_{3i} \neq 0$, or that $r_3$ is strictly complex. In that case, $r_2$ is also strictly complex, and $r_2$ and $r_3$ are complex conjugates of each other. If $r_{3i} = 0$, then $r_3$ is real, forcing $r_2$ to be real as well, but not related to $r_3$ in any way.