Complex roots in this visualization
A root of a polynomial is a number x that makes it 0. The graph of has only real x, so it shows only the real roots, where the curve meets the x-axis. This page adds a constant c and solves . Raising c lifts the graph, and once it clears the axis the real roots seem to be gone. They are still there as complex numbers . The main view draws every root in the complex plane: real roots on the real axis, the others above or below it. The graph underneath shares its columns, so a real root on the curve sits straight below its dot in the plane.
Take , whose roots are . As c rises to 1 the two real roots slide together and meet at x = 1, where the graph just touches the axis: , a double root. Past c = 1 the number under the square root is negative and the roots become . They leave the real line at right angles, one up and one down, and from then on the vertex's height, c − 1, is the square of their imaginary part and its x is their real part. Two real roots meet the same way wherever the graph touches the axis at a low point, and raising c turns them into a pair; at a high point, such as the cubic's at c = −2, lowering c does. The link to the vertex is a property of quadratics, though, and does not carry over in general: on the cubic at c = 3 the pair has real part 1.052, while the graph's low point next to it is at x = 1.
The coefficients here are real. Taking the complex conjugate of gives , so if z is a root, so is : non-real roots come in pairs, mirrored across the real axis and joined on the plot by a dashed line. The fundamental theorem of algebra says that a polynomial of degree n has exactly n complex roots, counting each as many times as it repeats: a double root twice, the triple root of x³ at c = 0 three times. The red key checks it. As the cubic rises from c = −4 to 4 its real roots go 1, 3, 1, yet every row of the record adds up to 3. Since pairs come two at a time, an odd degree always keeps at least one real root.
Multiplying out , the coefficient of is . Moving c changes only the constant term, so the sum of the roots never moves. For it is 0 at every c: when the real root moves left the pair moves right, and at c = 3, −2.104 + 2 × 1.052 = 0. With Sum of roots on, a diamond marks the mean of the roots, and it stays put through any run.
Things to notice
- A polynomial can have all its roots real: has four for 0 < c < 4.
- With complex coefficients, roots need not come in conjugate pairs. The pairing comes from the real coefficients.
Controls
- Drag the red handle at (0, c), or the curve itself, to move the graph. c catches at the values where roots meet.
- Press Raise the graph to run c to the top of its range. Each root leaves a trail, and the record counts the real and non-real roots at every meeting.
- Turn on Sum of roots to mark the mean of the roots.