For a square matrix , the minimal polynomial is the monic polynomial of least degree such that . It divides the characteristic polynomial and shares the same roots, yet reflects deeper information about repeated eigenvalues and the structure of .
For a 2×2 matrix, the characteristic polynomial takes the form . Let the eigenvalues be and . If they are distinct, . If equals , the minimal polynomial is either or depending on whether is diagonalizable.
The calculator first computes the trace and determinant of your matrix. From these it derives the eigenvalues using the quadratic formula. If the eigenvalues are distinct, the minimal polynomial coincides with the characteristic polynomial. When they coincide, the script checks whether is the zero matrix. If not, the minimal polynomial is squared to reflect the defective nature of the matrix.
Take = . The eigenvalue calculation yields a repeated root . Because is not already , the minimal polynomial is . Applying the polynomial to indeed produces the zero matrix.
The minimal polynomial reveals the size of Jordan blocks associated with each eigenvalue. In turn, this information determines whether the matrix is diagonalizable and helps classify linear transformations up to similarity. The polynomial also enters the Cayley–Hamilton theorem, matrix functions, and solution formulas for differential equations.
By exploring various matrices, you can see how repeated eigenvalues alter the minimal polynomial and connect to geometric multiplicity. This understanding is fundamental when analyzing systems that cannot be fully diagonalized.
Using the tool is straightforward, but walking through the process illuminates how each field affects the result:
math.js
library to handle complex arithmetic. Eigenvalues with imaginary components are displayed in a + bi
format.The algorithm follows a classic path taught in most introductory linear algebra courses. For a matrix , the trace is and the determinant is . Those two quantities fully define the characteristic polynomial, which the calculator expresses as .
The discriminant determines the eigenvalues. A positive yields two real roots. A zero discriminant means a repeated root, while a negative discriminant produces a complex conjugate pair. JavaScript’s built‑in Math.sqrt
cannot handle negative inputs, so the calculator uses math.sqrt
from the math.js library, which seamlessly returns complex numbers. Each eigenvalue is computed as .
When the eigenvalues are distinct, the minimal polynomial must be of degree two, and the calculator reports it in both coefficient and factored forms. For repeated eigenvalues, the script constructs the matrix and checks whether every entry is zero. If so, the matrix is already and the minimal polynomial is linear. Otherwise, the polynomial is , signaling a defective eigenvalue with a single linearly independent eigenvector.
Seeing the procedure in action makes the concept tangible. The following examples demonstrate the three broad outcomes you may encounter.
Consider the matrix . The trace is 5 and the determinant is 6. The discriminant is , so the eigenvalues are 3 and 2. The minimal polynomial matches the characteristic polynomial: or, in factored form, .
Let = . The trace is 4 and the determinant is 4, giving a zero discriminant. The eigenvalue is 2 with multiplicity two. Subtracting from leaves , which is not the zero matrix. Therefore, the minimal polynomial is . This polynomial encodes the fact that the matrix has a single eigenvector, making it similar to a Jordan block.
Take , a rotation matrix representing a 90‑degree turn. The trace is 0 and the determinant is 1, yielding a discriminant of . The eigenvalues are and , a complex conjugate pair. The minimal polynomial is . The calculator outputs the factored form and notes the corresponding quadratic expression, letting you verify the behavior of rotation matrices.
Minimal polynomials show up throughout mathematics and applied science. In control theory, they describe the dynamics of linear systems and help engineers design stabilizing feedback controllers. In differential equations, they aid in finding closed‑form solutions to systems with constant coefficients. Computer graphics and robotics rely on them when decomposing transformation matrices into simpler components. Even in cryptography and coding theory, minimal polynomials of companion matrices play a role in constructing error‑correcting codes and pseudorandom number generators.
Beyond pure computation, understanding the minimal polynomial sharpens intuition about how linear transformations act. The degree of the polynomial indicates the number of steps required to reduce a matrix to a simpler form using its own powers. This insight is invaluable when optimizing repeated matrix operations or when analyzing algorithms that leverage matrix exponentials.
This calculator focuses on 2×2 matrices, which cover many educational examples but not all real‑world scenarios. Larger matrices require more advanced techniques such as rational canonical forms or the use of computer algebra systems. Rounding errors can also creep in when working with floating‑point numbers. If a result looks suspicious, try entering exact integers or fractions and see how the output changes. When studying theoretical properties, it is often helpful to keep calculations symbolic before substituting numerical values.
Does the order of matrix entries matter?
Yes. The first row is entered left to right in the top fields, and the second row in the bottom fields. Swapping numbers changes the trace and determinant, leading to a different minimal polynomial.
What if the matrix is already diagonal?
Diagonal matrices are easy: the minimal polynomial is the product of the distinct diagonal entries minus . When both diagonal entries match, the polynomial collapses to a single factor or its square depending on whether the off‑diagonal entries are zero.
Can the calculator handle fractions?
Yes. You can input values such as 1/3
or 0.25
. The underlying math.js library interprets them as numbers, and the algorithm proceeds normally. However, the output is rounded to four decimal places for readability.
How do complex results affect interpretation?
Complex eigenvalues often indicate rotational behavior in dynamical systems. The calculator reports them as ordered pairs, and the resulting polynomial typically resembles . Even though the eigenvalues are complex, the polynomial itself has real coefficients.
Where can I learn more?
Textbooks on linear algebra, particularly chapters covering Jordan canonical form or invariant subspaces, delve deeper into minimal polynomials. Online resources such as lecture notes, video tutorials, and interactive algebra systems provide additional practice and context.
Compute the characteristic polynomial of a 2x2 or 3x3 matrix and learn how it relates to eigenvalues.
Divide one polynomial by another using the long division algorithm and obtain the quotient and remainder.
Compute the greatest common divisor of two polynomials using the Euclidean algorithm.