Algebra & Functions · Complex roots of polynomials

Complex roots of polynomials

A complex root of a polynomial p is a complex number z with p(z) = 0; the real roots are the ones on the real line. Raise the graph off the x-axis and watch two real roots meet, then leave the real line as a pair of complex conjugates.

Complex roots in this visualization

A root of a polynomial is a number x that makes it 0. The graph of y=p(x)y = p(x) 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 p(x)+c=0p(x) + c = 0. 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 a+bia + bi. 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.

The fundamental theorem of algebra: with leading coefficient 1, p factors into n linear factors over the complex numbers
xn+⋯+a1x+a0=(x−z1)(x−z2)⋯(x−zn)x^n + \dots + a_1 x + a_0 = (x - z_1)(x - z_2)\cdots(x - z_n)

Take x2−2x+cx^2 - 2x + c, whose roots are 1±1−c1 \pm \sqrt{1 - c}. As c rises to 1 the two real roots slide together and meet at x = 1, where the graph just touches the axis: x2−2x+1=(x−1)2x^2 - 2x + 1 = (x - 1)^2, a double root. Past c = 1 the number under the square root is negative and the roots become 1±ic−11 \pm i\sqrt{c - 1}. 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 p(z)+c=0p(z) + c = 0 gives p(zˉ)+c=0p(\bar z) + c = 0, so if z is a root, so is zˉ\bar z: 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 (x−z1)⋯(x−zn)(x - z_1)\cdots(x - z_n), the coefficient of xn−1x^{n-1} is −(z1+⋯+zn)-(z_1 + \dots + z_n). Moving c changes only the constant term, so the sum of the roots never moves. For x3−3xx^3 - 3x 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: x4−4x2+cx^4 - 4x^2 + c 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.

Related