TExcelTAD
Home › Linear Algebra & Matrix Theory › The Fundamental Theorem of Algebra

The Fundamental Theorem of Algebra

Every non-constant polynomial with complex coefficients has a complex root. This single fact is why every square matrix has an eigenvalue over C\mathbb{C}, why characteristic polynomials always factor completely, and, turned around, how np.roots actually finds roots.

The statement

Fundamental theorem of algebra. If p(z)=anzn+⋯+a1z+a0p(z) = a_nz^n + \cdots + a_1z + a_0 with complex coefficients, n≥1n \ge 1 and an≠0a_n \ne 0, then pp has at least one root in C\mathbb{C}.

Applying it repeatedly gives the factored form. If p(c)=0p(c) = 0, polynomial division gives p(z)=(z−c)q(z)p(z) = (z - c)q(z) with deg⁡q=n−1\deg q = n - 1; now apply the theorem to qq, and so on:

p(z)=an(z−c1)(z−c2)⋯(z−cn)p(z) = a_n (z - c_1)(z - c_2) \cdots (z - c_n)

So a degree-nn polynomial has exactly nn complex roots, counted with multiplicity (how many times each factor repeats). Compare with R\mathbb{R}, where x2+1x^2 + 1 has no roots at all: C\mathbb{C} is algebraically closed, R\mathbb{R} is not.

Why it is true (sketch)

There are many proofs; all need some analysis or topology, not just algebra. One intuitive picture uses winding:

  • On a huge circle ∣z∣=R\lvert z \rvert = R, the leading term anzna_nz^n dominates, so as zz goes once around, p(z)p(z) winds nn times around 0.
  • On a tiny circle ∣z∣=ε\lvert z \rvert = \varepsilon (if a0≠0a_0 \ne 0), p(z)p(z) stays near a0a_0 and winds 0 times around 0.
  • Shrinking the circle from RR to ε\varepsilon changes the winding number from nn to 0. A winding number can only change when the curve p(circle)p(\text{circle}) passes through 0, so some zz has p(z)=0p(z) = 0.

Note: The theorem says roots exist, not how to write them. Quadratics, cubics and quartics have formulas with radicals; by the Abel–Ruffini theorem, general polynomials of degree 5 and higher do not. In practice roots are computed numerically.

Real polynomials

If the coefficients are real, non-real roots come in conjugate pairs c,cˉc, \bar{c} (see The Complex Numbers). Each pair multiplies to a real quadratic:

(z−c)(z−cˉ)=z2−2Re⁡(c) z+∣c∣2(z - c)(z - \bar{c}) = z^2 - 2\operatorname{Re}(c)\, z + \lvert c \rvert^2

So every real polynomial factors into real linear factors and real irreducible quadratics. In particular, a real polynomial of odd degree always has a real root.

python · try it yourself
from sympy import symbols, factor, roots, expand, I

x = symbols("x")
p = x**4 - 2*x**3 + 6*x**2 - 2*x + 5
print("roots with multiplicity:", roots(p, x))
print("over the reals:  ", factor(p))
print("over Q(i):       ", factor(p, extension=I))
q = expand((x - 1)**3 * (x + 2))
print(q, "->", roots(q, x))
roots with multiplicity: {1 - 2*I: 1, 1 + 2*I: 1, -I: 1, I: 1}
over the reals:   (x**2 + 1)*(x**2 - 2*x + 5)
over Q(i):        (x - I)*(x + I)*(x - 1 - 2*I)*(x - 1 + 2*I)
x**4 - x**3 - 3*x**2 + 5*x - 2 -> {-2: 1, 1: 3}

SymPy prints x**4 for x4x^4. The root 1 of (x−1)3(x+2)(x - 1)^3(x + 2) has multiplicity 3.

Consequences for matrices

The eigenvalues of an n×nn \times n matrix are the roots of its characteristic polynomial det⁡(A−λI)\det(A - \lambda I), which has degree nn (Finding Eigenvalues). So:

  • Every square complex matrix has at least one eigenvalue and exactly nn counted with (algebraic) multiplicity. Over R\mathbb{R} this fails: a 90° rotation has none.
  • The product of all nn eigenvalues is det⁡A\det A and their sum is trace⁡A\operatorname{trace} A (compare the coefficients of the factored characteristic polynomial).
  • Results such as the spectral theorem and the Cayley-Hamilton theorem start from "pick an eigenvalue", which is only possible because of this theorem.

Roots via eigenvalues

Here the logic runs backwards in numerical practice. Finding roots of a high-degree polynomial is done by building a companion matrix whose characteristic polynomial is pp, then computing its eigenvalues with the robust QR algorithm. That is exactly what np.roots does.

For monic p(z)=zn+an−1zn−1+⋯+a0p(z) = z^n + a_{n-1}z^{n-1} + \cdots + a_0, one companion matrix has −an−1,…,−a0-a_{n-1}, \ldots, -a_0 in the first row and ones just below the diagonal.

python · try it yourself
import numpy as np

coeffs = [1, -2, 6, -2, 5]                 # z^4 - 2z^3 + 6z^2 - 2z + 5
n = len(coeffs) - 1
C = np.zeros((n, n))
C[0, :] = -np.array(coeffs[1:]) / coeffs[0]
C[1:, :-1] = np.eye(n - 1)
print("companion matrix:\n", C)
ev = np.sort_complex(np.linalg.eigvals(C))
print("eigenvalues:", np.round(ev, 6) + 0)
print("np.roots   :", np.round(np.sort_complex(np.roots(coeffs)), 6) + 0)
print("product of roots =", np.round(np.prod(ev), 6), " (= a0 = 5 for even degree)")
companion matrix:
 [[ 2. -6.  2. -5.]
 [ 1.  0.  0.  0.]
 [ 0.  1.  0.  0.]
 [ 0.  0.  1.  0.]]
eigenvalues: [0.-1.j 0.+1.j 1.-2.j 1.+2.j]
np.roots   : [0.-1.j 0.+1.j 1.-2.j 1.+2.j]
product of roots = (5+0j)  (= a0 = 5 for even degree)

In software

  • Root finding. np.roots, MATLAB's roots and most polynomial libraries use companion-matrix eigenvalues.
  • Control and signal processing. A filter or controller is stable when all roots of its characteristic polynomial lie in the left half-plane (or inside the unit circle for digital filters); scipy.signal checks this.
  • Graphics. Ray–torus intersection is a quartic equation; all four roots exist in C\mathbb{C} and the real positive ones are the hits.
  • Recurrences and ODEs. Solving linear recurrences and differential systems starts by finding all roots of a characteristic polynomial, complex ones giving oscillations.

Exercises

Exercise 1: Count the roots

How many complex roots, with multiplicity, does z7−3z2+1z^7 - 3z^2 + 1 have? Must one of them be real?

Answer

Seven; and yes, at least one is real.

Solution

Degree 7 gives 7 roots with multiplicity. The coefficients are real, so non-real roots pair up; an odd number of roots cannot all be paired, so at least one is real.

Exercise 2: Rebuild from roots

Find the monic real polynomial of smallest degree with roots 2 and 1+i1 + i.

Answer

(z−2)(z2−2z+2)=z3−4z2+6z−4(z - 2)(z^2 - 2z + 2) = z^3 - 4z^2 + 6z - 4.

Solution

Real coefficients force 1−i1 - i to be a root too. (z−(1+i))(z−(1−i))=z2−2z+2(z - (1 + i))(z - (1 - i)) = z^2 - 2z + 2. Multiply by (z−2)(z - 2): z3−2z2+2z−2z2+4z−4=z3−4z2+6z−4z^3 - 2z^2 + 2z - 2z^2 + 4z - 4 = z^3 - 4z^2 + 6z - 4.

Exercise 3: Eigenvalues of a rotation

Find the eigenvalues of the 90° rotation [0−110]\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} over C\mathbb{C}, and check them against trace and determinant.

Answer

±i\pm i; sum 0=trace\text{sum } 0 = \text{trace}, product −i2=1=det⁡\text{product } -i^2 = 1 = \det.

Solution

det⁡(A−λI)=λ2+1=(λ−i)(λ+i)\det(A - \lambda I) = \lambda^2 + 1 = (\lambda - i)(\lambda + i). i+(−i)=0=tracei + (-i) = 0 = \text{trace}, i⋅(−i)=1=det⁡i \cdot (-i) = 1 = \det.

Exercise 4: Companion matrix (code)

Build a companion matrix for z3−6z2+11z−6z^3 - 6z^2 + 11z - 6 and compute its eigenvalues.

Answer

The eigenvalues are 1, 2, 3, so z3−6z2+11z−6=(z−1)(z−2)(z−3)z^3 - 6z^2 + 11z - 6 = (z - 1)(z - 2)(z - 3).

Solution

First row −(−6,11,−6)=(6,−11,6)-(-6, 11, -6) = (6, -11, 6), ones below the diagonal.

python · try it yourself
import numpy as np
C = np.array([[6.0, -11.0, 6.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]])
print(np.round(np.sort(np.linalg.eigvals(C).real), 6))
[1. 2. 3.]

Test yourself

What does the fundamental theorem of algebra guarantee?

  1. Every polynomial has a real root
  2. Every non-constant complex polynomial has a complex root
  3. Roots can always be written with radicals
  4. Every polynomial has distinct roots

Why does every real 3×33 \times 3 matrix have at least one real eigenvalue?

  1. Because 3×33 \times 3 matrices are invertible
  2. The characteristic polynomial has odd degree and real coefficients, so it has a real root
  3. Because the trace is real
  4. It is false

How does np.roots compute the roots of a polynomial?

  1. With the quadratic formula repeatedly
  2. As eigenvalues of a companion matrix
  3. By bisection on the real line
  4. Symbolically with radicals