Every square matrix over a commutative ring satisfies its own characteristic equation
In linear algebra, the Cayley–Hamilton theorem (named after the mathematicians Arthur Cayley and William Rowan Hamilton) states that every square matrix over a commutative ring (such as the real or complex numbers or the integers) satisfies its own characteristic equation.
The characteristic polynomial of an "n" × "n" matrix A is defined as formula_1, where det is the determinant operation, λ is a variable scalar element of the base ring, and "In" is the "n" × "n" identity matrix. Since each entry of the matrix formula_2 is either constant or linear in λ, the determinant of formula_2 is a degree-n monic polynomial in λ, so it can be written as 
formula_4 By replacing the scalar variable λ with the matrix A, one can define an analogous matrix polynomial expression, formula_5
The Cayley–Hamilton theorem states that this polynomial expression is equal to the zero matrix, which is to say that formula_9 that is, the characteristic polynomial formula_10 is an annihilating polynomial for formula_11 
One use for the Cayley–Hamilton theorem is that it allows An to be expressed as a linear combination of the lower matrix powers of A: 
formula_12
When the ring is a field, the Cayley–Hamilton theorem is equivalent to the statement that the minimal polynomial of a square matrix divides its characteristic polynomial.
A special case of the theorem was first proved by Hamilton in 1853 in terms of inverses of linear functions of quaternions. This corresponds to the special case of certain 4 × 4 real or 2 × 2 complex matrices. Cayley in 1858 stated the result for 3 × 3 and smaller matrices, but only published a proof for the 2 × 2 case. As for "n" × "n" matrices, Cayley stated “..., I have not thought it necessary to undertake the labor of a formal proof of the theorem in the general case of a matrix of any degree”. The general case was first proved by Ferdinand Frobenius in 1878.
Examples.
1 × 1 matrices.
For a 1 × 1 matrix "A" = ("a"), the characteristic polynomial is given by "p"("λ") = "λ" − "a", and so "p"("A") = ("a") − "a"(1) = 0 is trivial.
2 × 2 matrices.
As a concrete example, let
formula_13
Its characteristic polynomial is given by
formula_14
The Cayley–Hamilton theorem claims that, if we "define"
formula_15
then
formula_16
We can verify by computation that indeed,
formula_17
For a generic 2 × 2 matrix,
formula_18
the characteristic polynomial is given by "p"("λ") = "λ"2 − ("a" + "d")"λ" + ("ad" − "bc"), so the Cayley–Hamilton theorem states that
formula_19
which is indeed always the case, evident by working out the entries of "A"2.
 ;templatestyles src="Math_proof/styles.css" / ;Proof
formula_20
Applications.
Determinant and inverse matrix.
For a general "n" × "n" invertible matrix A, i.e., one with nonzero determinant, A−1 can thus be written as an order polynomial expression in A: As indicated, the Cayley–Hamilton theorem amounts to the identity 
formula_21
The coefficients "c""i" are given by the elementary symmetric polynomials of the eigenvalues of A. Using Newton identities, the elementary symmetric polynomials can in turn be expressed in terms of power sum symmetric polynomials of the eigenvalues: 
formula_22 
where tr("A""k") is the trace of the matrix A"k". Thus, we can express "c""i" in terms of the trace of powers of A.
In general, the formula for the coefficients "c""i" is given in terms of complete exponential Bell polynomials as 
formula_23
In particular, the determinant of "A" equals (−1)"n""c"0. Thus, the determinant can be written as the trace identity:
formula_24
Likewise, the characteristic polynomial can be written as
formula_25
and, by multiplying both sides by "A"−1 (note −(−1)"n" = (−1)"n"−1), one is led to an expression for the inverse of A as a trace identity,
formula_26
Another method for obtaining these coefficients "c""k" for a general "n" × "n" matrix, provided no root be zero, relies on the following alternative expression for the determinant,
formula_27
Hence, by virtue of the Mercator series,
formula_28
where the exponential "only" needs be expanded to order "λ"−"n", since "p"("λ") is of order "n", the net negative powers of "λ" automatically vanishing by the C–H theorem. (Again, this requires a ring containing the rational numbers.) Differentiation of this expression with respect to λ allows one to express the coefficients of the characteristic polynomial for general n as determinants of "m" × "m" matrices,
formula_29
For instance, the first few Bell polynomials are "B"0 = 1, "B"1("x"1) = "x"1, "B"2("x"1, "x"2) = "x" + "x"2, and "B"3("x"1, "x"2, "x"3) = "x" + 3 "x"1"x"2 + "x"3.
Using these to specify the coefficients "ci" of the characteristic polynomial of a 2 × 2 matrix yields
formula_30
The coefficient "c"0 gives the determinant of the 2 × 2 matrix, "c"1 minus its trace, while its inverse is given by
formula_31
It is apparent from the general formula for "c""n"−"k", expressed in terms of Bell polynomials, that the expressions
formula_32
always give the coefficients "c""n"−1 of "λ""n"−1 and "c""n"−2 of "λ""n"−2 in the characteristic polynomial of any "n" × "n" matrix, respectively. So, for a 3 × 3 matrix A, the statement of the Cayley–Hamilton theorem can also be written as
formula_33
where the right-hand side designates a 3 × 3 matrix with all entries reduced to zero. Likewise, this determinant in the "n" = 3 case, is now
formula_34
This expression gives the negative of coefficient "c""n"−3 of "λ""n"−3 in the general case, as seen below.
Similarly, one can write for a 4 × 4 matrix A,
formula_35
where, now, the determinant is "c""n"−4,
formula_36
and so on for larger matrices. The increasingly complex expressions for the coefficients "c""k" is deducible from Newton's identities or the Faddeev–LeVerrier algorithm.
"n"-th power of matrix.
The Cayley–Hamilton theorem always provides a relationship between the powers of A (though not always the simplest one), which allows one to simplify expressions involving such powers, and evaluate them without having to compute the power A"n" or any higher powers of A.
As an example, for formula_37 the theorem gives 
formula_38
Then, to calculate "A"4, observe
formula_39
Likewise,
formula_40
Notice that we have been able to write the matrix power as the sum of two terms. In fact, matrix power of any order "k" can be written as a matrix polynomial of degree at most "n" − 1, where "n" is the size of a square matrix. This is an instance where Cayley–Hamilton theorem can be used to express a matrix function, which we will discuss below systematically.
Matrix functions.
Given an analytic function
formula_41
and the characteristic polynomial "p"("x") of degree "n" of an "n" × "n" matrix A, the function can be expressed using long division as 
formula_42
where "q"("x") is some quotient polynomial and "r"("x") is a remainder polynomial such that 0 ≤ deg "r"("x") ; "n".
By the Cayley–Hamilton theorem, replacing x by the matrix A gives "p"("A") = 0, so one has
formula_43
Thus, the analytic function of the matrix "A" can be expressed as a matrix polynomial of degree less than "n".
Let the remainder polynomial be
formula_44
Since "p"("λ") = 0, evaluating the function "f"("x") at the "n" eigenvalues of "A" yields
formula_45
This amounts to a system of "n" linear equations, which can be solved to determine the coefficients "ci". Thus, one has 
formula_46
When the eigenvalues are repeated, that is "λi = λj" for some "i ≠ j", two or more equations are identical; and hence the linear equations cannot be solved uniquely. For such cases, for an eigenvalue "λ" with multiplicity "m", the first "m" – 1 derivatives of "p"("x") vanish at the eigenvalue. This leads to the extra "m" – 1 linearly independent solutions 
formula_47
which, combined with others, yield the required "n" equations to solve for "ci".
Finding a polynomial that passes through the points ("λi",  "f" ("λi")) is essentially an interpolation problem, and can be solved using Lagrange or Newton interpolation techniques, leading to Sylvester's formula.
For example, suppose the task is to find the polynomial representation of 
formula_48
The characteristic polynomial is "p"("x") = ("x" − 1)("x" − 3) = "x"2 − 4"x" + 3, and the eigenvalues are "λ" = 1, 3. Let "r"("x") = "c"0 + "c"1"x". Evaluating "f"("λ") = "r"("λ") at the eigenvalues, one obtains two linear equations, "e""t" = "c"0 + "c"1 and "e"3"t" = "c"0 + 3"c"1.
Solving the equations yields "c"0 = (3"e""t" − "e"3"t")/2 and "c"1 = ("e"3"t" − "e""t")/2. Thus, it follows that
formula_49
If, instead, the function were "f"("A") = sin "At", then the coefficients would have been "c"0 = (3 sin "t" − sin 3"t")/2 and "c"1 = (sin 3"t" − sin "t")/2; hence
formula_50
As a further example, when considering
formula_51
then the characteristic polynomial is "p"("x") = "x"2 + 1, and the eigenvalues are "λ" = ±"i".
As before, evaluating the function at the eigenvalues gives us the linear equations "eit = c0 + i c1" and "e"−"it" = "c"0 − "ic"1; the solution of which gives, "c"0 = ("e""it" + "e"−"it")/2 = cos "t" and "c"1 = ("e""it" − "e"−"it")/2"i" = sin "t". Thus, for this case,
formula_52
which is a rotation matrix.
Standard examples of such usage is the exponential map from the Lie algebra of a matrix Lie group into the group. It is given by a matrix exponential,
formula_53
Such expressions have long been known for SU(2),
formula_54
where the σ are the Pauli matrices and for SO(3),
formula_55
which is Rodrigues' rotation formula. For the notation, see 3D rotation group#A note on Lie algebras.
More recently, expressions have appeared for other groups, like the Lorentz group SO(3, 1), O(4, 2) and SU(2, 2), as well as GL("n", R). The group O(4, 2) is the conformal group of spacetime, SU(2, 2) its simply connected cover (to be precise, the simply connected cover of the connected component SO+(4, 2) of O(4, 2)). The expressions obtained apply to the standard representation of these groups. They require knowledge of (some of) the eigenvalues of the matrix to exponentiate. For SU(2) (and hence for SO(3)), closed expressions have been obtained for "all" irreducible representations, i.e. of any spin.
Algebraic number theory.
The Cayley–Hamilton theorem is an effective tool for computing the minimal polynomial of algebraic integers. For example, given a finite extension formula_56 of formula_57 and an algebraic integer formula_58 which is a non-zero linear combination of the formula_59 we can compute the minimal polynomial of formula_60 by finding a matrix representing the formula_57-linear transformation
formula_62
If we call this transformation matrix formula_6, then we can find the minimal polynomial by applying the Cayley–Hamilton theorem to formula_6.
Proofs.
The Cayley–Hamilton theorem is an immediate consequence of the existence of the Jordan normal form for matrices over algebraically closed fields, see . In this section, direct proofs are presented.
As the examples above show, obtaining the statement of the Cayley–Hamilton theorem for an "n" × "n" matrix
formula_65
requires two steps: first the coefficients "c""i" of the characteristic polynomial are determined by development as a polynomial in "t" of the determinant
formula_66
and then these coefficients are used in a linear combination of powers of "A" that is equated to the "n" × "n" zero matrix:
formula_67
The left-hand side can be worked out to an "n" × "n" matrix whose entries are (enormous) polynomial expressions in the set of entries "a""i","j" of "A", so the Cayley–Hamilton theorem states that each of these "n"2 expressions equals 0. For any fixed value of "n", these identities can be obtained by tedious but straightforward algebraic manipulations. None of these computations, however, can show why the Cayley–Hamilton theorem should be valid for matrices of all possible sizes "n", so a uniform proof for all "n" is needed.
Preliminaries.
If a vector "v" of size "n" is an eigenvector of "A" with eigenvalue "λ", in other words if "A"⋅"v" = "λv", then
formula_68
which is the zero vector since "p"("λ") = 0 (the eigenvalues of "A" are precisely the roots of "p"("t")). This holds for all possible eigenvalues "λ", so the two matrices equated by the theorem certainly give the same (null) result when applied to any eigenvector. Now if "A" admits a basis of eigenvectors, in other words if "A" is diagonalizable, then the Cayley–Hamilton theorem must hold for "A", since two matrices that give the same values when applied to each element of a basis must be equal. 
formula_69
formula_70
formula_71
formula_72
formula_73
Consider now the function formula_74 which maps "n" × "n" matrices to "n" × "n" matrices given by the formula formula_75, i.e. which takes a matrix formula_6 and plugs it into its own characteristic polynomial. Not all matrices are diagonalizable, but for matrices with complex coefficients many of them are: the set formula_77 of diagonalizable complex square matrices of a given size is dense in the set of all such square matrices (for a matrix to be diagonalizable it suffices for instance that its characteristic polynomial not have any multiple roots). Now viewed as a function formula_78(since matrices have formula_79 entries) we see that this function is continuous. This is true because the entries of the image of a matrix are given by polynomials in the entries of the matrix. Since
formula_80
and since the set formula_77 is dense, by continuity this function must map the entire set of "n" × "n"