Advanced maths

Matrix minimal polynomial calculator

Find the monic polynomial of smallest degree annihilating a rational matrix and verify the complete zero-matrix residual.

Your numbers

One matrix row per line; commas or spaces separate columns. Use integers, decimals with up to six places, or fractions. Entries and fraction components are bounded by 1,000,000.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The minimal polynomial encodes the shortest polynomial relation satisfied by a square matrix. Its variable is replaced by the whole matrix, and the constant term multiplies the identity matrix. This page constructs successive powers I, A, A² and so on, then finds the first exact linear dependence among their entries. Exact rational row reduction determines the monic coefficients, and substitution checks that every entry of the resulting matrix polynomial is zero.

THE FORMULAm(A) = 0; m is monic and has the smallest possible positive degree.

A worked example

For A = [[2,1],[0,2]], the minimal polynomial is (x−2)² = x²−4x+4. Although the only eigenvalue is two, A−2I is a nonzero nilpotent matrix. Squaring A−2I gives zero. Returning only x−2 would therefore fail the defining annihilation check. For the diagonal matrix 2I, by contrast, x−2 is sufficient.

Good to know

Supports rational square matrices up to 6×6 with bounded exact-fraction growth. Entries are interpreted literally, with no tolerance for approximate zero. This page does not compute a Jordan basis or a characteristic-polynomial factorization. Near-equal measured values are not merged into repeated eigenvalues; an exact algebraic relation can change under a small perturbation.

The matrix must satisfy the polynomial entry by entry

A scalar eigenvalue test is not enough. In the default upper-triangular matrix, inserting the eigenvalue two into x−2 gives zero as a scalar, but inserting A gives a matrix with a one above the diagonal. The minimal polynomial needs the repeated factor to eliminate that nilpotent part. The result table shows m(A) itself, so the check is applied to the operator rather than merely to its eigenvalues.

The constant four in x²−4x+4 means 4I when evaluated on A. Adding four to every matrix entry would be a different operation and would not verify the relation. Matrix multiplication is used for powers, and the same square dimension is retained throughout. The first dependence is normalized to leading coefficient one, making the polynomial unique.

The Jordan-type two by two matrix needs a squared factor to annihilate itA − 2I = [[0,1],[0,0]]A − 2I ≠ 0; (A − 2I)² = 0m(x) = x² − 4x + 4
For A = [[2,1],[0,2]], A−2I is nonzero but (A−2I)² is zero. Thus the minimal polynomial is x²−4x+4 rather than x−2.

The Matrix exponential calculator e^(At) evaluates another matrix function; a minimal-polynomial relation can simplify matrix-function expressions.

Minimal and characteristic polynomials carry different information

The characteristic polynomial always has degree equal to the matrix order, while the minimal polynomial can have a lower degree. A 4×4 identity matrix has characteristic polynomial (x−1)⁴ but minimal polynomial x−1. The minimal polynomial divides every polynomial that annihilates A, including the characteristic polynomial. It records the needed powers of factors rather than simply repeating algebraic multiplicities.

Testing degrees in increasing order establishes minimality: every smaller candidate degree has been checked for consistency before a relation is returned. Exact arithmetic avoids a floating rank cutoff in that search, but it also treats a tiny nonzero fraction as genuinely nonzero. If the matrix came from measurements, that literal exact relation may not be stable under uncertainty. The matrix power calculator evaluates specified powers; this page instead discovers a shortest relation among them.

A few questions, answered

Can the zero matrix have a constant minimal polynomial?

No nonzero constant polynomial annihilates the identity factor in its evaluation. The zero matrix has minimal polynomial x, of degree one.

Does a repeated eigenvalue always require a repeated factor?

No. A scalar diagonal block needs only a simple factor. A larger Jordan-type nilpotent component can require a higher factor power.

Find your calculator

Start typing to explore the library.