Back to the on-screen lesson ·

Diagonalisation

Why $AP = PD$ holds when the columns of $P$ are eigenvectors, what makes $P$ invertible, and how comparing geometric with algebraic multiplicity decides whether a matrix can be diagonalised at all.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to derive $AP = PD$ from the definition of an eigenvector and say what extra condition turns it into $A = PDP^{-1}$, build $P$ and $D$ from an eigenbasis with their orders locked together, decide whether a matrix is diagonalisable by summing the dimensions of its eigenspaces, explain why distinct eigenvalues are sufficient and not necessary, recognise a defective matrix, check a diagonalisation with $AP = PD$ rather than by inverting anything, and build a matrix from prescribed eigenvalues and eigenvectors.

2. The two things now in hand

Each eigenvalue of $A$ has an eigenspace, and its dimension — the geometric multiplicity — is at least one and at most the algebraic multiplicity. Eigenvectors belonging to distinct eigenvalues are independent. This lesson does one thing with those facts: it counts the eigenvectors, and asks whether there are enough of them to be a basis.

3. What the words mean here

$A$ is diagonalisable when $A = PDP^{-1}$ for some invertible $P$ and some diagonal $D$ — equivalently, when $\mathbb{R}^{n}$ has a basis of eigenvectors of $A$, which is called an eigenbasis. $P$ is the matrix whose columns are that basis; $D$ carries the matching eigenvalues down its diagonal. A matrix that is not diagonalisable is defective. Since $B = P^{-1}AP$ is what similarity means, diagonalisable is the same as similar to a diagonal matrix.

4. One identity, and the counting question behind it

Suppose $v_1, \dots, v_n$ are eigenvectors of $A$ with $Av_i = \lambda_i v_i$, and let $P$ be the matrix whose columns are those vectors. Multiplying a matrix by $P$ acts column by column, so

$$AP = \begin{pmatrix} | & & | \\ Av_1 & \cdots & Av_n \\ | & & | \end{pmatrix} = \begin{pmatrix} | & & | \\ \lambda_1 v_1 & \cdots & \lambda_n v_n \\ | & & | \end{pmatrix} = PD,$$

where $D = \operatorname{diag}(\lambda_1, \dots, \lambda_n)$. Scaling the $i$th column of $P$ by $\lambda_i$ is exactly what right-multiplication by that diagonal matrix does.

So $AP = PD$ holds whenever the columns are eigenvectors. To get from there to $A = PDP^{-1}$ one extra thing is needed, and it is the whole content of the lesson: $P$ must be invertible, which means its columns must be independent, which means the eigenvectors must be a basis.

That is the counting question. Independence between different eigenvalues is free. Independence within one eigenvalue is the dimension of its eigenspace. So the test is

$$\sum_{\lambda} \dim E_\lambda = n,$$

and since each term is at most the algebraic multiplicity and the algebraic multiplicities already sum to $n$, this holds exactly when every geometric multiplicity equals its algebraic one. One deficient eigenvalue is enough to spoil it.

Another way: picture

$PDP^{-1}$ read right to left is a three-act description of the map. $P^{-1}$ takes a vector's ordinary coordinates and re-expresses them in the eigenbasis; $D$ stretches each of those coordinates by its own factor, and does nothing else at all; $P$ translates back. Diagonalising is choosing the axes along which the map is nothing but a set of independent stretches — and a defective matrix is one for which no such set of axes exists, because there are not enough special directions to make a full set.

Another way: steps

  1. Find every eigenvalue and its algebraic multiplicity.
  2. For each, row-reduce $A - \lambda I$ and get a basis of the eigenspace.
  3. Add up the dimensions. Short of $n$: defective, stop.
  4. Equal to $n$: put the basis vectors in as the columns of $P$.
  5. Put their eigenvalues down the diagonal of $D$, in the same order.
  6. Check with $AP = PD$, which needs no inverse.

5. Distinct eigenvalues, and why they are only a sufficient condition

If an $n \times n$ matrix has $n$ distinct eigenvalues then each has algebraic multiplicity $1$, so each geometric multiplicity is squeezed between $1$ and $1$, the dimensions sum to $n$, and the matrix is diagonalisable. No eigenvector need be computed to know this.

It is worth being precise about the logic, because it is routinely misremembered as an equivalence. Distinct eigenvalues imply diagonalisable; diagonalisable does not imply distinct eigenvalues. The identity matrix is the clearest counterexample: one eigenvalue, repeated $n$ times, and already diagonal. Anything of the form $cI$ is the same story.

What a repeated eigenvalue does is reopen the question rather than answer it. $\begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}$ and $\begin{pmatrix} 2 & 1 \\ 0 & 2 \end{pmatrix}$ have the same characteristic polynomial and land on opposite sides: the first has a two-dimensional eigenspace and the second a one-dimensional one. Only the row reduction of $A - \lambda I$ tells them apart, which is why the characteristic polynomial alone can never decide diagonalisability.

A useful special case to carry forward: a symmetric real matrix is always diagonalisable, and by an orthogonal $P$ at that. That is a theorem of the last unit, and it is the reason symmetric matrices are so much better behaved than the rest.

6. Reading a diagonalisation, and what breaks without one

Once $A = PDP^{-1}$ is in hand, a great deal is free. $A^{k} = PD^{k}P^{-1}$, because the inner $P^{-1}P$ pairs cancel, and $D^{k}$ is just each diagonal entry raised to the power. The same trick evaluates any polynomial in $A$, and — taking limits — the matrix exponential that solves a linear system of differential equations. That is the next lesson.

It also makes several facts obvious that were opaque before. $\det A = \det D$ is the product of the eigenvalues; $\operatorname{tr} A = \operatorname{tr} D$ is their sum; $A$ is invertible exactly when no diagonal entry of $D$ is zero, and then $A^{-1} = PD^{-1}P^{-1}$ with the reciprocals down the diagonal.

$P$ is not unique, and neither is $D$. Reordering the columns of $P$ reorders the diagonal of $D$ to match, and scaling any column of $P$ changes nothing at all, since a scaled eigenvector is still an eigenvector. What is not allowed is moving one without the other: $P$ and $D$ are a matched pair, and the commonest error in this lesson is listing the eigenvalues in a tidy order while leaving the eigenvectors in the order they were found.

For a defective matrix there is no $D$, and the best available replacement is the Jordan form — almost diagonal, with some ones on the superdiagonal. It is beyond this course, but the shear $\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}$ is already in it, which is why that matrix keeps appearing.

7. Five things that go wrong

Eigenvectors as rows. They are the columns of $P$. The identity $AP = PD$ is about what $A$ does to columns, and a $P$ built from rows fails it outright.

$P$ and $D$ out of step. Column $i$ of $P$ and diagonal entry $i$ of $D$ must belong to each other. Sorting the eigenvalues into increasing order after building $P$ is a silent way of breaking this.

Believing a repeated eigenvalue is fatal. It is not; $cI$ has nothing but repeated eigenvalues and is already diagonal. A repeated eigenvalue means the question is still open, not that the answer is no.

Believing distinct eigenvalues are necessary. They are sufficient and nothing more.

$P^{-1}AP$ and $PAP^{-1}$ used interchangeably. $A = PDP^{-1}$ is the same statement as $D = P^{-1}AP$. Mixing the two puts the inverse on the wrong side and produces a different matrix — one that is usually not diagonal at all.

8. A diagonalisation, checked without an inverse

  1. $A = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix}$: eigenvalues $5$ and $2$, with eigenvectors $(1, 1)$ and $(1, -2)$ found in the last lesson.

    Two distinct eigenvalues, so no counting needed.

  2. $P = \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}$, $D = \begin{pmatrix} 5 & 0 \\ 0 & 2 \end{pmatrix}$ — columns and diagonal in the same order.

    Assemble the matched pair.

  3. Check $AP = PD$: $AP = \begin{pmatrix} 5 & 2 \\ 5 & -4 \end{pmatrix}$ and $PD = \begin{pmatrix} 5 & 2 \\ 5 & -4 \end{pmatrix}$. The inverse never had to be computed.

    Always check this way round.

9. A repeated eigenvalue on each side of the line

  1. $M = \begin{pmatrix} 5 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 2 \end{pmatrix}$: eigenvalue $5$ with algebraic multiplicity $2$. $M - 5I$ has rank $1$, so its eigenspace has dimension $2$.

    Measure, do not assume.

  2. Dimensions $2 + 1 = 3$, so $M$ is diagonalisable — indeed it already is, and $P = I$ works.

    A repeated eigenvalue is not an obstacle by itself.

  3. $N = \begin{pmatrix} 5 & 1 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 2 \end{pmatrix}$ has the same characteristic polynomial, but $N - 5I$ has rank $2$, so the eigenspace for $5$ is only a line. Dimensions $1 + 1 = 2 < 3$: defective.

    One entry decides it.

10. Your turn: is $\begin{pmatrix} 6 & 0 \\ 0 & 6 \end{pmatrix}$ diagonalisable?

  1. The only eigenvalue is $6$, with algebraic multiplicity $2$ — so the question is genuinely open.

    A repeat means measure, not refuse.

  2. $A - 6I$ is the zero matrix, whose null space is the whole plane: geometric multiplicity $2$.

    Row-reduce and count.

  3. Your turn: work this step out. Its working is at the end of the packet.

    $2 = 2$, so yes — and obviously so, since it is already diagonal, with $P = I$ and $D = A$.

11. Guided practice

$A$ has eigenvector $(1, 4)$ for $\lambda = 7$ and $(1, 5)$ for $\lambda = 4$, and $P$ is built with those two as its first and second columns in that order. Write the matrix $D$ of $A = PDP^{-1}$.

This task has no paper form; do it on a device.

12. Guided practice

$A$ has eigenvector $(1, 2)$ for $\lambda = 5$ and $(1, 3)$ for $\lambda = 6$. Write the matrix $P$ for which $D = \begin{pmatrix} 5 & 0 \\ 0 & 6 \end{pmatrix}$ satisfies $A = PDP^{-1}$.

This task has no paper form; do it on a device.

13. Practice

Put the steps of diagonalising $A = \begin{pmatrix} 2 & 9 \\ 1 & 9 \end{pmatrix}$ into the order they have to be carried out in.

Number the steps in order (write the number in the box):

14. Practice

Is $\begin{pmatrix} 2 & 0 \\ 0 & 5 \end{pmatrix}$ diagonalisable?

15. Practice

A $5 \times 5$ matrix has just two eigenvalues: $6$, with algebraic multiplicity $2$, and $8$, with algebraic multiplicity $3$. Their eigenspaces have dimensions $2$ and $3$. How many independent eigenvectors has the matrix altogether?

Answer:

16. Somewhere new

Write the $2 \times 2$ matrix $A$ whose eigenvector for $\lambda = 3$ is $(1, 3)$ and whose eigenvector for $\lambda = 4$ is $(1, 4)$.

This task has no paper form; do it on a device.

17. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

18. Test question

$A$ has eigenvector $(1, 3)$ for $\lambda = 3$ and $(1, 4)$ for $\lambda = 2$, and $P$ is built with those two as its first and second columns in that order. Write the matrix $D$ of $A = PDP^{-1}$.

This task has no paper form; do it on a device.

19. What you can do now

You can decide whether a matrix is diagonalisable, assemble $P$ and $D$ in matching order, and check the pair without computing an inverse. Say in your own words why the columns of $P$ have to be independent. Next: what the decomposition is actually for — powers, recurrences and what happens after many steps.

Working for the steps left to you

10. Your turn: is $\begin{pmatrix} 6 & 0 \\ 0 & 6 \end{pmatrix}$ diagonalisable?, step 3

Repeated eigenvalues can be perfectly well behaved.