Minimal Polynomial Calculator

Find the smallest polynomial that annihilates a matrix and compare it with the characteristic polynomial.

Results are calculated automatically as you enter data.

Matrix data
Rows:
3
Columns:
3

Formula and interpretation
Result Enter a matrix to compute its exact minimal polynomial.

▼ See explanations and tips below ▼

What Is a Minimal Polynomial?

A minimal polynomial is the smallest monic polynomial that captures the algebraic behavior of an object.

A polynomial is monic when its highest-degree coefficient is \(1\). For a square matrix \(A\), the minimal polynomial is the lowest-degree monic polynomial \(m_A(x)\) such that substituting the matrix into the polynomial gives the zero matrix:

$$ m_A(A) = 0 $$

For an algebraic number \(\alpha\) over \(\mathbb{Q}\), the minimal polynomial is the lowest-degree monic irreducible polynomial with rational coefficients that has \(\alpha\) as a root.

These two situations look different, but the idea is the same: among all polynomial equations the matrix or number satisfies, the minimal polynomial is the simplest one that fully records the essential algebraic relation.


Why Minimal Polynomials Matter

Minimal polynomials are useful because they often give a more compact description than the characteristic polynomial.

For matrices, the minimal polynomial helps answer questions such as:

  • Which polynomial relations does the matrix satisfy?
  • How can high powers of the matrix be reduced to lower powers?
  • Does the matrix have repeated eigenfactor behavior?
  • Is the matrix diagonalizable, assuming the factorization is complete over the field being used?

For algebraic numbers, the minimal polynomial identifies the irreducible rational-coefficient equation that defines the number. For example, \(\sqrt{2}\) is not rational, but it is algebraic because it satisfies \(x^2 - 2 = 0\).


Key Terms to Know

  • Monic polynomial: A polynomial whose leading coefficient is \(1\).
  • Annihilating polynomial: A polynomial \(p(x)\) such that \(p(A)=0\) for a matrix \(A\).
  • Characteristic polynomial: For an \(n \times n\) matrix \(A\), this is usually written as \(\chi_A(x)=\det(xI-A)\). It always annihilates \(A\) by the Cayley-Hamilton theorem.
  • Minimal polynomial of a matrix: The monic annihilating polynomial of least degree.
  • Minimal polynomial of an algebraic number: The unique monic irreducible polynomial over the chosen field, often \(\mathbb{Q}\), that has the number as a root.
  • Irreducible polynomial: A polynomial that cannot be factored into lower-degree nonconstant polynomials over the field being used.
  • Relative root residual: A scale-adjusted numerical check used only to match a real root approximation to an already certified exact factor. Matrix identities are verified with exact rational arithmetic instead.
  • Square-free polynomial: A polynomial with no repeated factors. For matrices whose minimal polynomial splits into linear factors, repeated factors are closely tied to non-diagonalizable behavior.

How Minimal Polynomials Work

Matrix minimal polynomials

If

$$ p(x)=a_d x^d+a_{d-1}x^{d-1}+\cdots+a_1x+a_0, $$

then applying \(p\) to a square matrix \(A\) means

$$ p(A)=a_d A^d+a_{d-1}A^{d-1}+\cdots+a_1A+a_0I, $$

where \(I\) is the identity matrix of the same size as \(A\).

The minimal polynomial of \(A\) is the monic polynomial of smallest degree that makes this matrix expression equal to the zero matrix:

$$ m_A(A)=0. $$

For an \(n \times n\) matrix, the minimal polynomial has degree at most \(n\). The characteristic polynomial also annihilates the matrix:

$$ \chi_A(A)=0. $$

That is why the minimal polynomial must divide the characteristic polynomial. The characteristic polynomial may have degree \(n\), while the minimal polynomial may be smaller.

If a matrix has eigenvalues \(\lambda_1, \lambda_2, \ldots\), its minimal polynomial includes the factors needed to make each eigenvalue's behavior vanish. Repeated factors matter: a repeated factor such as \((x-2)^2\) usually signals that the matrix has more than just ordinary diagonal behavior at the eigenvalue \(2\).

Algebraic-number minimal polynomials

For an algebraic number \(\alpha\), the minimal polynomial over \(\mathbb{Q}\) is the unique monic irreducible polynomial \(p(x) \in \mathbb{Q}[x]\) such that

$$ p(\alpha)=0. $$

If \(\alpha\) is known to be a root of a polynomial \(f(x)\), then the minimal polynomial is the irreducible factor of \(f(x)\) that contains that root. This calculator certifies rational linear factors exactly and certifies remaining quadratic or cubic factors after excluding every rational root. It refuses unresolved degree-four-or-higher factors instead of presenting them as irreducible. A decimal root approximation is used only to select among factors that were already certified exactly.


Examples of Minimal Polynomials in Practice

Example 1: A diagonal matrix

Consider the diagonal matrix

$$ A=\begin{pmatrix} 1 & 0 & 0\\ 0 & 2 & 0\\ 0 & 0 & 3 \end{pmatrix}. $$

Its diagonal entries are \(1\), \(2\), and \(3\). The polynomial

$$ (x-1)(x-2)(x-3) $$

becomes zero when applied to \(A\), because each diagonal entry is one of those roots. The minimal polynomial is therefore

$$ m_A(x)=(x-1)(x-2)(x-3). $$

In this case, the minimal polynomial has no repeated factors.


Example 2: A repeated eigenvalue with non-diagonal behavior

Now consider

$$ A=\begin{pmatrix} 2 & 1 & 0\\ 0 & 2 & 0\\ 0 & 0 & 3 \end{pmatrix}. $$

The eigenvalues are \(2\) and \(3\). The upper-left \(2 \times 2\) block has a repeated eigenvalue \(2\) with an off-diagonal \(1\), so a single factor \((x-2)\) is not enough to make that part vanish. The required factor is \((x-2)^2\).

A polynomial that annihilates the matrix is

$$ (x-2)^2(x-3). $$

So the minimal polynomial is

$$ m_A(x)=(x-2)^2(x-3). $$

This example shows why the minimal polynomial can reveal information that is not visible from the list of eigenvalues alone.


Example 3: An algebraic number

Let

$$ \alpha=\sqrt{2}. $$

Then

$$ \alpha^2-2=0, $$

so \(\alpha\) is a root of

$$ p(x)=x^2-2. $$

The rational root theorem gives only possible rational roots \(\pm 1\) and \(\pm 2\), and none of them is a root. Since a quadratic with no rational root is irreducible over \(\mathbb{Q}\), the minimal polynomial of \(\sqrt{2}\) over \(\mathbb{Q}\) is

$$ x^2-2. $$

Using the decimal approximation \(1.414213562\), the check is very close to zero:

$$ (1.414213562)^2-2 \approx -1.05 \times 10^{-9}. $$

The small relative value identifies the factor containing the supplied approximation; irreducibility of this quadratic is certified separately by the exact rational-root test.


Example 4: A one-by-one matrix

For a \(1 \times 1\) matrix

$$ A=\begin{pmatrix} a \end{pmatrix}, $$

the minimal polynomial is simply

$$ m_A(x)=x-a. $$

For example, if \(A=(0)\), then \(m_A(x)=x\).


How to Interpret the Result

A displayed main result is a verified matrix minimal polynomial or a certified algebraic-number minimal polynomial within the supported factorization scope.

In matrix mode, decimal and scientific-notation entries are interpreted as exact rational numbers. Exact row reduction finds the first linear dependence among \(I,A,A^2,\ldots\), and the result is accepted only after \(m_A(A)=0\), Cayley-Hamilton, and \(m_A\mid\chi_A\) are all verified exactly.

The characteristic polynomial is shown because it is the standard degree-\(n\) polynomial attached to an \(n \times n\) matrix and it always annihilates the matrix. The minimal polynomial must divide it, so comparing the two helps explain which factors and exponents are actually needed.

The factor view is useful for understanding repeated factors. If the minimal polynomial splits into distinct linear factors over the field being used, that supports diagonalizability. If a repeated factor appears, the matrix is not diagonalizable over that field.

The degree table records exact dependence tests:

  • “No exact dependence” means no monic polynomial of that degree annihilates the matrix.
  • “Exact zero” means the displayed relation evaluates to the zero matrix with rational arithmetic.
  • The first exact relation is reported as the minimal polynomial.

In algebraic mode, the selected factor must first have an exact rational-linear, quadratic, or cubic irreducibility certificate. Its scale-relative value at the supplied root approximation must then be at most \(10^{-8}\). Rough, ambiguous, or unresolved inputs produce no minimal-polynomial result.


Common Mistakes and Misconceptions

Confusing the characteristic polynomial with the minimal polynomial. The characteristic polynomial always has degree equal to the matrix size, but the minimal polynomial can have lower degree.

Using a rectangular matrix. A matrix polynomial such as \(A^2+3A+I\) only makes sense when \(A\) is square, because matrix powers require compatible dimensions.

Forgetting the identity matrix term. The constant term \(a_0\) in a matrix polynomial means \(a_0I\), not just the scalar \(a_0\).

Entering coefficients in the wrong order. In algebraic mode, coefficients are entered from highest degree to constant term. For \(x^2-2\), the coefficients are \(1, 0, -2\), not \(-2, 0, 1\).

Leaving blank matrix cells. A blank cell is not the same as zero. Enter \(0\) where a zero is intended.

Typing exact symbolic roots into a numeric root field. A text expression such as sqrt(2) is not the same as a finite decimal approximation such as 1.414213562.

Assuming every higher-degree factor can be certified here. Rational linear factors and irreducible quadratic or cubic remainders are supported. An unresolved factor of degree four or higher is deliberately rejected.

Treating the root approximation as the irreducibility proof. The approximation only selects a factor. Exact rational factor tests provide the certificate.


When to Use Minimal Polynomials

Use minimal polynomials when you want to:

  • Find the simplest polynomial relation satisfied by a matrix.
  • Compare a matrix's characteristic polynomial with the lower-degree relation it actually needs.
  • Study diagonalizability and repeated eigenfactor behavior.
  • Reduce high powers of a matrix to combinations of lower powers.
  • Identify the irreducible rational-coefficient polynomial defining an algebraic number.
  • Check which factor of a polynomial corresponds to a chosen root.

Minimal polynomials are common in linear algebra, matrix theory, abstract algebra, algebraic number theory, and courses that connect eigenvalues with polynomial factorization.


Limitations and Things to Keep in Mind

This calculator uses bounded exact rational arithmetic for coefficients and matrix entries, plus one scale-relative numerical check for selecting a certified factor from a real root approximation.

In matrix mode:

  • The matrix must be square.
  • The matrix size is limited to at most \(5 \times 5\).
  • Entries must use decimal or scientific notation and are interpreted as exact rational numbers.
  • Symbolic entries and complex numbers are not parsed.
  • Each token is limited to 50 characters, exponent magnitude is limited to 30, and intermediate exact integers are limited to 4096 bits.
  • Matrix-power dependence, \(m_A(A)=0\), Cayley-Hamilton, and divisibility into the characteristic polynomial are checked exactly.

In algebraic mode:

  • Coefficients must be exact decimals or scientific-notation values, entered from highest degree to constant term.
  • The root must be a finite real numeric approximation.
  • Exact expressions such as sqrt(2) and complex roots are not accepted as root inputs.
  • The selected certified factor must have a scale-relative root residual at most \(10^{-8}\).
  • Polynomial degree is limited to 12. Primitive integer coefficients used for certification must not exceed \(1{,}000{,}000\).
  • Rational linear factors and irreducible quadratic or cubic remainders are certified. An unresolved degree-four-or-higher factor returns no result.

Exact rational coefficients are displayed as integers or fractions and are never rounded to zero. The decimal root-selection residual is rounded only for display. For proofs, publications, exams, or high-stakes work, independently verify the stated input interpretation and supported factorization scope.


How to Use This Calculator

  1. Choose matrix mode or algebraic mode.
  2. In matrix mode, set the number of rows and columns, then enter exact decimal or scientific-notation values in the matrix grid or paste matrix data.
  3. Keep the matrix square and no larger than \(5 \times 5\).
  4. Read the main result as the matrix minimal polynomial \(m_A(x)\).
  5. Use the summary fields to compare the minimal degree, characteristic polynomial, exact verification, and diagonalizability over \(\mathbb C\).
  6. Use the result table to see the first degree at which an exact matrix-power dependence exists.
  7. In algebraic mode, enter polynomial coefficients from highest degree to constant term.
  8. Enter a finite numeric approximation of the chosen algebraic root.
  9. A main algebraic result appears only when the selected monic factor has an exact supported certificate and a relative root residual at most \(10^{-8}\).

Frequently Asked Questions

Is the minimal polynomial the same as the characteristic polynomial?

Not always. The characteristic polynomial always annihilates the matrix, but it may contain extra repeated factors that are not needed by the smallest annihilating polynomial. The minimal polynomial divides the characteristic polynomial and can have lower degree.


Why does the matrix have to be square?

Matrix powers such as \(A^2\), \(A^3\), and higher powers require a square matrix. Since matrix polynomials are built from matrix powers, the minimal polynomial of a matrix is defined for square matrices.


What does \(p(A)=0\) mean?

It means that after substituting the matrix \(A\) into the polynomial \(p(x)\), the result is the zero matrix. The constant term of the polynomial is treated as a multiple of the identity matrix.


What does a repeated factor mean?

A repeated factor such as \((x-2)^2\) means that a simple factor \((x-2)\) was not enough to annihilate the matrix. An exact repeated factor in the minimal polynomial means the matrix is not diagonalizable over \(\mathbb C\).


Can a minimal polynomial have degree \(1\)?

Yes. A scalar matrix \(A=aI\) has minimal polynomial \(x-a\). A \(1 \times 1\) matrix also has a degree-one minimal polynomial.


Why does algebraic mode need a root approximation?

A polynomial may have more than one certified factor, and different roots may belong to different factors. The approximation selects among those exact factors using a scale-relative evaluation; it does not establish irreducibility by itself.


Can this calculator prove irreducibility over \(\mathbb{Q}\)?

It proves the supported cases: rational linear factors and quadratic or cubic remainders with no rational root. It does not implement complete factorization for arbitrary degree-four-or-higher factors, and returns no minimal polynomial when such a factor remains unresolved.


Sources and References

Books

  1. Sheldon Axler. Linear Algebra Done Right. Fourth edition, Springer, 2024. Sections 5B, 8C, and 9C on minimal polynomials, characteristic polynomials, and the Cayley-Hamilton theorem. Open-access author PDF.
  2. Thomas W. Judson. Abstract Algebra: Theory and Applications. Annual Edition 2022, with Sage exercises by Robert A. Beezer. Chapter 21, “Fields,” especially Section 21.1 on algebraic elements and minimal polynomials. LibreTexts edition.
  3. OpenStax. College Algebra 2e. Section 5.5, “Zeros of Polynomial Functions,” for the Rational Zero Theorem and synthetic division context. OpenStax textbook section.

Online and Official Sources

  1. Eric W. Weisstein. “Matrix Minimal Polynomial.” Wolfram MathWorld. Accessed July 4, 2026. MathWorld page.
  2. Eric W. Weisstein. “Extension Field Minimal Polynomial.” Wolfram MathWorld. Accessed July 4, 2026. MathWorld page.