This tool lets you experiment with the Cayley–Hamilton theorem for a real 2×2 matrix. You enter the four entries of a matrix and (optionally) an integer power . The calculator then computes the characteristic polynomial of , verifies that satisfies its own polynomial, and helps you see how higher powers of can be reduced to a simple combination of and .
The page is designed for students in linear algebra, people reviewing for exams, and anyone who wants to see the Cayley–Hamilton theorem work out in concrete numerical examples.
For a general real 2×2 matrix the calculator works with two basic quantities:
The characteristic polynomial of is
The Cayley–Hamilton theorem states that if you substitute the matrix into its characteristic polynomial, you get the zero matrix:
where is the 2×2 identity matrix and denotes the 2×2 zero matrix.
For powers of , the key idea is that any polynomial in can be simplified using this relation. In particular, for a 2×2 matrix you can always reduce higher powers to a linear combination of and . For example, starting from
you can multiply both sides by to find
The calculator uses these same underlying formulas internally when it checks the theorem for the matrix you enter.
To run a basic verification:
If you supplied a power , the tool may also compute and, when possible, express it in terms of and using the Cayley–Hamilton relation.
When you run the calculator, you will typically see at least two pieces of output:
Conceptually, if the Cayley–Hamilton theorem holds and there is no rounding error, that verification matrix should be exactly the zero matrix:
Numerically, computers work with floating-point arithmetic, so you may see entries like 1.0×10−9 instead of 0. These are effectively zero for practical purposes and simply reflect limited precision.
If you also compute , you can compare the directly computed power with the value obtained by repeatedly applying the relation . Both approaches should agree up to rounding error, illustrating how Cayley–Hamilton turns high powers of a matrix into a simpler combination of and .
Consider a 2D rotation by 60°. The associated rotation matrix is
To test this matrix in the calculator:
The calculator will compute the trace and determinant:
So the characteristic polynomial is approximately . By Cayley–Hamilton, this implies
After running the computation, the displayed entries of should all be very close to zero. If you ask the tool to compute , you can then express it using the polynomial relation, confirming that repeated rotations still follow the same algebraic rules.
Different kinds of 2×2 matrices give different traces and determinants, but they all satisfy the same general Cayley–Hamilton pattern. The table below summarizes a few typical cases you can try in the calculator.
| Matrix type | Example | Trace | Determinant | Characteristic polynomial |
|---|---|---|---|---|
| Diagonal | ||||
| Scalar | ||||
| Rotation (orthogonal) | ||||
| Repeated eigenvalue, not diagonal |
You can enter each of these matrices into the calculator and verify that is numerically the zero matrix in every case, even when the matrix is not diagonalizable (as in the last example).
This demonstrator is intentionally simple and has a few built-in limitations you should keep in mind while interpreting results:
Within these constraints, the calculator should give a faithful numerical illustration of the Cayley–Hamilton theorem and how it controls powers and polynomials of a 2×2 matrix.