Linear Algebra / Unit 5, Eigenvalues and Eigenvectors / Topic 5.3
Unit 5. Eigenvalues and Eigenvectors
This topic uses a basis of eigenvectors to write a matrix as A = PDP⁻¹, where D is a diagonal matrix. In that basis the map only stretches each coordinate, which makes powers of the matrix and many other calculations easy.
You need Topics 3.3, 4.6, 5.1, and 5.2 for this topic.
Topic 4.6 showed that the matrix of a map in a new basis is P⁻¹AP, where the columns of P are the new basis vectors. It also showed one example in which the new matrix was diagonal. That happens exactly when the basis vectors are eigenvectors.
Suppose that an n by n matrix A has n independent eigenvectors v₁, …, vₙ, with the eigenvalues λ₁, …, λₙ. Put the eigenvectors in the columns of a matrix P, and put the eigenvalues, in the same order, on the diagonal of a matrix D. The product AP has the columns Av₁, …, Avₙ, which are λ₁v₁, …, λₙvₙ. The product PD has the same columns, because multiplying P by a diagonal matrix on the right multiplies its columns by the diagonal entries.
AP = PDThe columns of P are independent, so P has an inverse. Multiplying by P⁻¹ on the right, or on the left, gives the two forms of the result.
A = PDP⁻¹ and D = P⁻¹APWriting A in this way is called diagonalizing A. A matrix that can be written in this way is called diagonalizable.
Topic 5.1 found the eigenvalues 2 and 5 for the matrix below, with the eigenvectors (1, −2) and (1, 1).
A = 4123 P = 11−21 D = 2005Check the equation AP = PD.
AP = 4123 11−21 = 25−45A times the eigenvectorsPD = 11−21 2005 = 25−45each column of P times its eigenvalueThe determinant of P is 3, and its inverse is
P⁻¹ = 1/3 1−121The matrices P and D are not unique. The eigenvectors can be scaled, and the columns can be put in a different order, as long as D follows the same order.
Read A = PDP⁻¹ from right to left, as in Topic 4.6. To apply A to a vector:
Step by step: the three factors of A
The matrix is A = PDP⁻¹ with the rows 2, 1 and 1, 2. Its eigenvectors are along the two dashed lines. Press Next to apply the three factors to the blue shape, one at a time. The gray outline is the original shape, and the green outline is the result of applying A directly.
The same statement can be made without matrices. Write a vector as a combination of the eigenvectors, x = c₁v₁ + c₂v₂. Then the map multiplies each term by its eigenvalue.
Ax = c₁λ₁v₁ + c₂λ₂v₂Writing a vector as a combination of eigenvectors, and then treating each term separately, is the central method of quantum mechanics. A state is written as a combination of the eigenvectors of the energy, and each term then changes in time in a simple way.
In the product A² = (PDP⁻¹)(PDP⁻¹), the factors P⁻¹P in the middle cancel. The same happens for any power.
Ak = PDkP⁻¹A power of a diagonal matrix is found by taking the same power of each diagonal entry. For the example, D³ has the entries 8 and 125.
A³ = PD³P⁻¹the power of a diagonalized matrixA³ = 11−21 800125 1/3 1−121D³ has the entries 2³ and 5³A³ = 1/3 8125−16125 1−121multiply P by D³A³ = 86397847multiply by P⁻¹The work is the same for A³ and for A¹⁰⁰. Topic 5.4 uses this to study what happens when a map is applied many times.
An n by n matrix is diagonalizable exactly when it has n independent eigenvectors.
| Matrix | Eigenvalues | Independent eigenvectors | Diagonalizable |
|---|---|---|---|
| 4123 | 2 and 5 | 2 | Yes |
| 3003 | 3, repeated | 2 | Yes. It is already diagonal |
| 1101 | 1, repeated | 1 | No |
| 0−110 | i and −i | None that are real | Not with real numbers |
The rotation in the last row is diagonalizable when complex numbers are allowed. The shear in the third row is not diagonalizable with any numbers.
Being diagonalizable and having an inverse are different properties. The matrix with the rows 1, 2 and 2, 4 has the eigenvalues 0 and 5. It is diagonalizable, and it has no inverse. The shear has an inverse, and it is not diagonalizable.
| Fact | Statement |
|---|---|
| Diagonalization | A = PDP⁻¹, with eigenvectors in the columns of P and eigenvalues on the diagonal of D |
| Condition | A has n independent eigenvectors |
| Enough, but not necessary | n different eigenvalues |
| Powers | Ak = PDkP⁻¹ |
| In the eigenvector basis | The map multiplies each coordinate by its eigenvalue |
Work each problem on paper first. Then open the answer to check your work.
P = 111−1 and D = 300−1.
Check: AP = 3−131 and PD = 3−131.
P⁻¹ = 1−101.
PD = 2303, and A = PDP⁻¹ = 2103.
The eigenvalue 2 is repeated. A − 2I = 0100, which gives y = 0.
The eigenvectors are only the multiples of (1, 0). There is 1 independent eigenvector, so the matrix is not diagonalizable.
D² = 40025square each diagonal entryPD² = 425−825multiply P by D²A² = 1/3 425−825 1−121multiply by P⁻¹A² = 1/3 54214233 = 1871411divide each entry by 3A² = 16 + 24 + 38 + 62 + 9 = 1871411the direct product, as a check
The eigenvalue 2 has the algebraic multiplicity 2. The matrix is diagonalizable exactly when the eigenspace of 2 has the dimension 2, which means that A − 2I has the rank 1.
c₁ + c₂ = 3the first components−2c₁ + c₂ = 0the second componentsc₁ = 1subtract the second equation from the first, then divide by 3c₂ = 2substitute c₁ = 1Ax = (1)(2)(1, −2) + (2)(5)(1, 1)each part is multiplied by its eigenvalueAx = (2, −4) + (10, 10) = (12, 6)
Check: the direct product is (12, 6).
The code below stores the matrices P and D from Part 2 of this topic and multiplies the three factors. The instruction np.linalg.inv calculates an inverse, np.diag builds a diagonal matrix from a list of its diagonal entries, and the @ sign multiplies matrices.
Python
The result is the matrix A with the rows 4, 1 and 2, 3. Python prints the entries as decimal numbers, and a very small rounding error in the last digits is normal.
In the next box, the columns of P are the eigenvectors (1, 1) and (1, −2), in that order. The eigenvalues in D are in the wrong order for this P, so the product is not A. Correct the second line.
Python
Python writes a power with two stars, so 2**3 is 2³ = 8. The code below calculates A³ in two ways: with the diagonal form, and with the instruction np.linalg.matrix_power, which multiplies a matrix by itself the given number of times.
Python
Both results have the rows 86, 39 and 78, 47, as in Part 4.
In the next box, change the code so that R is A¹⁰, calculated with the diagonal form. The last line prints the same power calculated directly, for comparison.
Python
From Topic 5.1, the instruction np.linalg.eig gives the eigenvalues and a matrix whose columns are eigenvectors. These are the diagonal of D and the matrix P.
Python
The first result is the diagonal matrix with the entries 5 and 2. The second result is A again.
Now diagonalize the matrix of Practice Problem 1, which has the rows 1, 2 and 2, 1.
Python
The shear from Part 5 has only one line of eigenvectors. The code below asks Python for its eigenvectors, and then prints the determinant of the matrix V.
Python
Both eigenvalues are 1. The two columns of V are on the same line, apart from a very small rounding error, and the determinant of V is a number such as 2.2e-16, which should be read as 0. So V has no inverse, and the shear cannot be written as PDP⁻¹. Python does not give a warning in this case. Check the determinant of V when a matrix has a repeated eigenvalue.
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. In the factorization A = PDP⁻¹, what are the columns of P?
The columns of P are independent eigenvectors of A. The diagonal entries of D are the eigenvalues, in the same order.
2. Let P = 1101 and D = 1004. Calculate A = PDP⁻¹.
P⁻¹ has the rows 1, −1 and 0, 1. The product PD has the rows 1, 4 and 0, 4. Multiplying by P⁻¹ gives the rows 1, 3 and 0, 4.
3. Which of these matrices is not diagonalizable?
The last matrix has the eigenvalue 1 twice, but its only eigenvectors are the multiples of (1, 0). A 2 by 2 matrix needs two independent eigenvectors to be diagonalizable.
4. Let D = 200−1. Find the two diagonal entries of D⁵.
A power of a diagonal matrix is found by taking the same power of each diagonal entry: 2⁵ = 32 and (−1)⁵ = −1.
5. A 3 by 3 matrix has the eigenvalues 1, 4, and 7. Is the matrix diagonalizable?
A matrix with n different eigenvalues is always diagonalizable, because eigenvectors of different eigenvalues are independent.