Let A be a diagonalizable matrix, with a basis v1, v2, ..., vn of eigenvectors. Let p(λ) = det(A - λI) be the characteristic polynomial of A. Then for the eigenvalue λk of vk, we have
= p(λk)vk (this property)
= 0vk = 0. (eigenvalues are the roots of det(A - λI))
Since applying p(A) to any vector in the basis v1, v2, ..., vn gives us the zero vector, we conclude p(A) must be the zero matrix.
We just proved the following result for diagonalizable matrices. The result is called Cayley-Hamilton theorem, and is true for any square matrix.
p(λ) = p0 + p1λ + ... + pn-1λn-1 + pnλn.
Q(λ) = Q0 + λQ1 + ... + λq-1Qq-1 + λqQq, where Qq are constant matrices.
By the formula (adjA)A = (detA)I, we have
Q(λ)(A - λI) = p(λ)I = p0I + p1λI + ... + pn-1λn-1I + pnλnI.
On the other hand, we have
Q(λ)(A - λI) = Q0A + λ(Q1A - Q0) + ... + λq(QqA - Qq-1) - λq+1Qq.
Thus we get q = n -1 and
Q0A = p0I,
Q1A - Q0 = p1I,
Qn-1A - Qn-2 = pn-1I,
- Qn-1 = pnI.
Multiplying powers of A on the right sides, we get
Q0A = p0I,
Q1A2 - Q0A = p1A,
Qn-1An - Qn-2An-1 = pn-1An-1,
- Qn-1An = pnAn.
Adding all the equalities together, we get
p(A) = p0I + p1A + ... + pn-1An-1 + pnAn = O.
By this discussion, the characteristic polynmomial of a 2 by 2 matrix A is
det(A - λI) = detA - (trA)λ + λ2.
Therefore the Cayley-Hamilton theorem tells us
(detA)I - (trA)A + A2 = O.