Linear Algebra

Lesson 9 of 11

Diagonalization and the Spectral Theorem

Write A = PΛP⁻¹ to take any power of a matrix in one step, use the orthogonal version A = QΛQᵀ for symmetric matrices, and find PageRank as the eigenvector with eigenvalue 1.

Diagonalization: switch to the eigenvector basis

Suppose an n×nn \times n matrix AA has nn independent eigenvectors v1,…,vn\mathbf{v}_1, \dots, \mathbf{v}_n with eigenvalues λ1,…,λn\lambda_1, \dots, \lambda_n. Put the eigenvectors in the columns of PP and the eigenvalues on the diagonal of Λ\Lambda. The nn equations Avi=λiviA\mathbf{v}_i = \lambda_i\mathbf{v}_i stack into one matrix equation AP=PΛAP = P\Lambda, and because the columns of PP are independent, PP is invertible:

A=PΛP−1A = P\Lambda P^{-1}

This is diagonalization. Read it right to left as three moves: P−1P^{-1} rewrites a vector in eigenvector coordinates, Λ\Lambda scales each coordinate by its own eigenvalue, and PP translates back. In the eigenvector basis the matrix is a list of separate scalings.

Example: A=(4123)A = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix} has trace 7 and determinant 10, so λ2−7λ+10=0\lambda^2 - 7\lambda + 10 = 0 gives λ=5,2\lambda = 5, 2. Solving (A−5I)v=0(A - 5I)\mathbf{v} = \mathbf{0} gives (1,1)(1, 1), and (A−2I)v=0(A - 2I)\mathbf{v} = \mathbf{0} gives (1,−2)(1, -2). So

P=(111−2),Λ=(5002),P−1=13(211−1)P = \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}, \quad \Lambda = \begin{pmatrix} 5 & 0 \\ 0 & 2 \end{pmatrix}, \quad P^{-1} = \frac13\begin{pmatrix} 2 & 1 \\ 1 & -1 \end{pmatrix}

When does it fail? Eigenvectors for distinct eigenvalues are independent, so any matrix with nn distinct eigenvalues is diagonalizable. Failure needs a repeated eigenvalue with too few eigenvectors. The shear (1101)\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} has λ=1\lambda = 1 twice, but A−IA - I has rank 1, so its only eigenvectors are multiples of (1,0)(1, 0). Such a matrix is called defective. A repeated eigenvalue on its own is harmless: 2I2I has λ=2\lambda = 2 twice and is already diagonal.