Lecture 39 · Week 10· 17:01
Diagonalisation
A = P D P−1, criteria, independent eigenvectors.
Saved in this browser only. No account needed.
TranscriptThe full text of the lecture. Click any sentence to play the video from there.
Today: when is a matrix diagonal in disguise?
Welcome back. In the last two lectures we met eigenvectors, the nonzero vectors that a matrix only stretches, and we learned to find them with the characteristic polynomial. Today we put them to work. Start with the easiest matrices of all, the diagonal ones. A diagonal matrix D stretches each coordinate axis by its own factor. This one stretches the first axis by three, shrinks the second axis to half its length, and does nothing else. Everything is easy for D. Its powers just raise the diagonal entries to that power. And its determinant is the product of the diagonal entries: three times one half, which is three halves.
Most matrices are not diagonal. But in lecture thirty two we saw that a matrix A, and the similar matrix P inverse A P, are the matrices of the same linear map in two different bases. So today's question is this. Is there a basis in which the map of A has a diagonal matrix? If there is, then A is a diagonal matrix in disguise. Here is the plan. First the definition, and a theorem that says exactly which basis to use. Then a full example, and two matrices where it fails. Then a test for distinct eigenvalues, and finally the multiplicity test, which decides every case.
Diagonalisable matrices
Here is the definition. An n by n matrix A over a field F is diagonalisable if A equals P D P inverse, for an invertible matrix P and a diagonal matrix D, both over F. Multiply by P inverse on the left and by P on the right, and this says that D equals P inverse A P. So A is diagonalisable exactly when it is similar to a diagonal matrix. For a linear map T from a vector space V to itself, of finite dimension at least one, the definition reads: T is diagonalisable if V has a basis in which the matrix of T is diagonal.
Now the main theorem. Take vectors p one up to p n in F n, and numbers lambda one up to lambda n in F. Let P be the matrix with the columns p one up to p n, and let D be the diagonal matrix with the entries lambda one up to lambda n. Then P is invertible and A equals P D P inverse, exactly when the p's form a basis of F n, and A times p j is lambda j times p j, for every j. In words: A is diagonalisable exactly when F n has a basis of eigenvectors of A. The eigenvectors are the columns of P, and their eigenvalues sit on the diagonal of D, in the same order.
The proof is short. By the definition of the matrix product, the columns of A P are A times each column of P: A p one, up to A p n. And column j of P D is P times column j of D. That column is lambda j times e j, and P times it is lambda j times p j, since P times e j is the column p j. So A P equals P D exactly when the columns match: A p j equals lambda j p j, for every j.
By the invertible matrix theorem, P is invertible exactly when its columns are linearly independent and span F n, that is, when they form a basis. And for an invertible P, the equation A P equals P D is the same as A equals P D P inverse: multiply on the right by P inverse, and by P to go back. That proves the theorem. For a map T the argument is the same. Column j of the matrix of T is the coordinate vector of T of b j, so the matrix is diagonal exactly when every basis vector b j is an eigenvector of T.
A first example
Let's diagonalise the matrix A with the rows (four, one), and (two, three). We met it in lecture thirty eight, so the first two steps are a quick repeat. First the eigenvalues. The characteristic polynomial is the determinant of A minus t I, which is four minus t, times three minus t, minus one times two. That is t squared, minus seven t, plus ten, which factors as t minus five, times t minus two. So the eigenvalues are five and two.
Next the eigenvectors. For lambda equal to five, A minus five I has the rows (minus one, one), and (two, minus two). Adding twice the first row to the second leaves one equation: minus x one, plus x two, equals zero. So E five is spanned by p one, the vector (one, one). For lambda equal to two, A minus two I has the rows (two, one), and (two, one). Subtracting the first row from the second leaves one equation: two x one, plus x two, equals zero. So E two is spanned by p two, the vector (one, minus two). These two vectors form a basis of R two. The matrix with the columns p one and p two has determinant one times minus two, minus one times one, which is minus three, and that is not zero.
So by the theorem, A equals P D P inverse. The columns of P are p one and p two, and D has five and two on its diagonal, in the same order. Let's check that A P equals P D, one column at a time. A times p one: in the first coordinate, four plus one is five, and in the second, two plus three is five. That is five times p one. A times p two: in the first coordinate, four minus two is two, and in the second, two minus six is minus four. That is two times p two.
And P D multiplies each column of P by its eigenvalue, so its columns are five p one and two p two as well. So A P equals P D. Here is the picture. The eigenvectors draw a slanted grid in the plane. Now apply A. The direction of p one is stretched by five, and the direction of p two by two, so the shaded cell becomes a block of five by two cells, and its sides stay on the grid lines. In this grid, A acts exactly like the diagonal matrix D. Read A equals P D P inverse from right to left: P inverse finds the coordinates of a vector in the eigenvector basis, D stretches each coordinate, and P turns the coordinates back into a vector.
The choices are not unique. Swapping the columns of P swaps the diagonal entries of D, and any nonzero multiple of an eigenvector works just as well. But the diagonal of D always holds the same eigenvalues, up to their order.
When it fails
Not every matrix is diagonalisable. Take the shear S with the rows (one, one), and (zero, one). It is triangular, so its characteristic polynomial is one minus t, squared, and one is its only eigenvalue. And S minus I has the rows (zero, one), and (zero, zero). So the eigenvectors are the nonzero vectors with x two equal to zero: E one is the line spanned by e one. Watch the shear move the plane. Only the horizontal line stays on itself. Every eigenvector lies on this one line, so no two eigenvectors are linearly independent, and R two has no basis of eigenvectors. So the shear is not diagonalisable.
Now the quarter turn, with the rows (zero, minus one), and (one, zero). Its characteristic polynomial is t squared plus one, which has no real roots. No line through the origin is turned onto itself, so there are no real eigenvectors at all. So the quarter turn is not diagonalisable over the real numbers. Over the complex numbers it has the eigenvalues i and minus i, and there it is diagonalisable. We return to complex eigenvalues in lecture forty one. So there are two ways to fail: too few eigenvalues in the field, or an eigenvalue with too few independent eigenvectors. By the end of this lecture we will see that these are the only two.
Distinct eigenvalues
To build a basis of eigenvectors, we need eigenvectors that are linearly independent. Lecture thirty seven gave us the tool. Recall the theorem. Let T be an operator on V, let lambda one up to lambda k be distinct eigenvalues of T, and let v i be an eigenvector for lambda i. Then v one up to v k are linearly independent. The idea of the proof: applying T to a linear relation multiplies each term by its own eigenvalue.
Subtracting lambda k times the relation removes the last term, but not the others, because their eigenvalues are different. So a relation can be shortened one vector at a time, until nothing is left. Here is the payoff. If an n by n matrix A has n distinct eigenvalues in F, then A is diagonalisable. Indeed, one eigenvector for each eigenvalue gives n linearly independent vectors in F n, and n independent vectors in an n dimensional space form a basis. It is a basis of eigenvectors, so the theorem applies.
For example, take the matrix C whose first row is (one, two, three), its second row is (zero, four, five), and its third row is (zero, zero, six). It is upper triangular, so by lecture thirty seven its eigenvalues are its diagonal entries: one, four and six. These are three distinct eigenvalues, so C is diagonalisable, before we compute a single eigenvector. The converse is false. For n at least two, the identity matrix is already diagonal, so it is diagonalisable, but it has only one eigenvalue. With repeated eigenvalues, we have to look at the eigenspaces.
Combining eigenspaces
First, the theorem of lecture thirty seven grows. Take distinct eigenvalues lambda one up to lambda k of T, and in each eigenspace E lambda i, a linearly independent list. Put all the lists one after the other. Then the combined list is still linearly independent. Here is why. Suppose a linear combination of the combined list is zero. Group its terms by eigenvalue, and call the group of lambda i, u i. Each u i lies in the eigenspace E lambda i, and the groups add up to zero. If some groups were nonzero, they would be eigenvectors for distinct eigenvalues that add up to zero, which the theorem of lecture thirty seven forbids. So every group u i is zero. Then every coefficient is zero, because each list is linearly independent.
The multiplicity test
Now recall the two multiplicities from the last lecture. The algebraic multiplicity m i of lambda i is the largest number m such that t minus lambda i, to the power m, divides the characteristic polynomial. The geometric multiplicity g i is the dimension of the eigenspace E lambda i. We proved that g i is at least one and at most m i. And the m's add up to at most n, with equality exactly when the characteristic polynomial splits into linear factors over F. Here is the multiplicity test. Let A be an n by n matrix over F, with distinct eigenvalues lambda one up to lambda k in F, algebraic multiplicities m i, and geometric multiplicities g i. Then three statements are equivalent.
First, A is diagonalisable. Second, the geometric multiplicities add up to n. Third, the characteristic polynomial splits over F, and g i equals m i for every i. Here is the proof, and it is worth taking slowly. Combine bases of all the eigenspaces. By the last theorem, this is a linearly independent list in F n, with as many vectors as the sum of the g's. So the sum of the g's is at most n. If the sum equals n, the combined list has n linearly independent vectors, so it is a basis of eigenvectors, and A is diagonalisable. So the second statement gives the first.
Conversely, take a basis of eigenvectors. The basis vectors with eigenvalue lambda i are linearly independent vectors in E lambda i, so there are at most g i of them. Counting all n basis vectors, n is at most the sum of the g's. So the first statement gives the second. For the third statement, chain the inequalities. The sum of the g's is at most the sum of the m's, which is at most n. So the g's add up to n exactly when both are equalities: when the polynomial splits, and every g i equals its m i.
Two examples
Let's use the test. Take the matrix A whose first row is (three, one, minus one), its second row is (one, three, minus one), and its third row is (zero, zero, two). Expand the determinant of A minus t I along the third row. Only its last entry, two minus t, is not zero, and its minor keeps the first two rows and columns. So the characteristic polynomial is two minus t, times three minus t, squared, minus one. Three minus t, squared, minus one, factors as two minus t, times four minus t. So the polynomial is two minus t, squared, times four minus t. It splits, and the eigenvalue two has algebraic multiplicity two, while four has algebraic multiplicity one.
For lambda equal to two, the first and second rows of A minus two I are both (one, one, minus one), and its third row is zero. Subtracting the first row from the second leaves one equation: x one, plus x two, minus x three, equals zero, with the free variables x two and x three. So E two is a plane, and g is two, which matches m. Solving for x one, every solution is x two times (minus one, one, zero), plus x three times (one, zero, one), and these two vectors are a basis of E two. For lambda equal to four, the algebraic multiplicity is one, so g is one as well, and the eigenspace is a line. It is spanned by the vector (one, one, zero), since A times this vector is the vector (four, four, zero).
The geometric multiplicities add up to two plus one, which is three. So A is diagonalisable. The three eigenvectors are the columns of P, and D has two, two and four on its diagonal. Now change one entry. The matrix B has the first row (three, one, zero), and the same second and third rows as A. Expanding along the third row exactly as before, it has the same characteristic polynomial. But for lambda equal to two, B minus two I has the first row (one, one, zero), the second row (one, one, minus one), and a zero third row. Subtracting the first row from the second leaves the row (zero, zero, minus one). So there are two pivots, and only one free variable.
So E two is only a line, spanned by the vector (minus one, one, zero), and g is one, less than m, which is two. So B is not diagonalisable. The characteristic polynomial alone cannot decide: the eigenspaces do.
How to diagonalise
So here is the recipe. First, find the characteristic polynomial and its roots in F. If it does not split, stop: the matrix is not diagonalisable over F. Second, find a basis of each eigenspace by row reduction. If some geometric multiplicity is smaller than the algebraic one, stop. An eigenvalue of algebraic multiplicity one needs no check. Third, put the bases side by side as the columns of P, and the matching eigenvalues, in the same order, on the diagonal of D. Then A equals P D P inverse.
Why go to this trouble? Because A to the k is P D to the k P inverse: in the product, each P inverse meets a P and cancels. So powers of A become easy, and next lecture uses this for Markov chains and linear recurrences. And later in the course we meet a second test, through the minimal polynomial, and we will see that every real symmetric matrix is diagonalisable. Before the next lecture, read section eight point three of the course book, try the problems on sheet ten about diagonalisation, and do the lecture check on this lecture's page at Open Semester dot com. Next time: eigenvalues in action, with matrix powers, Markov chains and linear recurrences. See you there.
In this lecture
Materials
Check yourself
3 questions, from warm-up to stretch
Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.
- Question 1 of 3 Warm-up
Let . Find its two eigenvalues. Then with diagonal, its smaller eigenvalue first on the diagonal, and : find .
Hint 1 of 2
The eigenvalues are the roots of . By Theorem 8.3.2, the second column of is an eigenvector for the second diagonal entry of .
Hint 2 of 2
. For , solve with .
Worked solution
- . So the eigenvalues are and .
- So . By Theorem 8.3.2, exactly when the columns of are linearly independent eigenvectors, the first for and the second for , in that order.
- For : gives , so is an eigenvector: the first column of fits.
- For : gives , so is an eigenvector, and .
- Check: , and .
- Question 2 of 3 Core
Let over . Find the algebraic multiplicity and the geometric multiplicity of the eigenvalue . Is diagonalisable?
Hint 1 of 2
Expand along the first row: only its first entry is not zero. Then , and the multiplicity test (Theorem 8.3.10) decides.
Hint 2 of 2
. And : how many pivots?
Worked solution
- Expand along the first row (Lecture 35): only its first entry is not zero, so .
- So splits, the eigenvalue has algebraic multiplicity and the eigenvalue has .
- . With the rows become , , : two pivots, so one free variable (). Then , , and , so .
- By the multiplicity test (Theorem 8.3.10), is diagonalisable only if for every eigenvalue. Here , so is not diagonalisable. The geometric multiplicities add up to only .
- Question 3 of 3 Stretch
Let . Diagonalise , and use to find the entries in the first row of .
Hint 1 of 2
Find the eigenvalues from , an eigenvector for each, and put them as the columns of . Then , where cubes the diagonal entries.
Hint 2 of 2
The eigenvalues are and , with eigenvectors and . So , and .
Worked solution
- : two distinct eigenvalues, so is diagonalisable (Corollary 8.3.7).
- For : gives , so . For : gives , so .
- So , , and .
- : first , then .
- Check by multiplying directly: and .
How did it go?