In linear algebra, the \'Cayley-Hamilton theorem' (named after the mathematicians Arthur Cayley and William Hamilton) states that every square matrix over a commutative ring, e.g. over the real or complex field, satisfies its own characteristic equation. This means the following: if A is the given square matrix and

is its characteristic polynomial (a polynomial in the variable t), then replacing t by the matrix A results in the zero matrix:

Consider for example the matrix
.
The characteristic polynomial is given by
The Cayley-Hamilton theorem then claims that
which one can quickly verify in this case.

As a result of this, the Cayley-Hamilton theorem allows us to calculate powers of matrices more simply than by direct multiplication.

Taking the result above

Then, for example, to calculate A4, observe

The theorem is also an important tool in calculating eigenvectors.