Diagonalization: A = PDP⁻¹

April 13, 2026

Problem

Diagonalize A = [[4,1],[2,3]]. Construct P (eigenvectors) and D (eigenvalues), verify A = PDP⁻¹, and use it to compute Aⁿ quickly.

Explanation

What is diagonalization?

A square matrix AA is diagonalizable if there exists an invertible PP and diagonal DD with A=PDP1A = P D P^{-1}

The columns of PP are eigenvectors of AA; the diagonal entries of DD are the corresponding eigenvalues.

Equivalently, AA is diagonalizable iff it has nn linearly independent eigenvectors. A matrix is defective (not diagonalizable) if it lacks enough independent eigenvectors for some eigenvalue.

Why diagonalize?

Powers become cheap. Using A=PDP1A = P D P^{-1}: An=PDnP1A^n = P D^n P^{-1}

and DnD^n is just each diagonal entry raised to the nn. One matrix multiplication becomes one diagonal multiplication — for big nn, the savings are huge.

Other uses: solving linear ODEs, matrix exponentials, Markov-chain steady states, principal-axis theorems.

Step-by-step

A=(4123)A = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix} (same matrix as problem 355).

Step 1 — Find eigenvalues.

From problem 355: λ1=5\lambda_1 = 5, λ2=2\lambda_2 = 2.

Step 2 — Find eigenvectors.

From problem 355: v1=(1,1)T\mathbf{v}_1 = (1, 1)^T for λ1=5\lambda_1 = 5; v2=(1,2)T\mathbf{v}_2 = (1, -2)^T for λ2=2\lambda_2 = 2.

Step 3 — Build PP and DD.

Columns of PP = eigenvectors (in any order, as long as DD matches). P=(1112),D=(5002)P = \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}, \quad D = \begin{pmatrix} 5 & 0 \\ 0 & 2 \end{pmatrix}

Step 4 — Compute P1P^{-1}.

detP=(1)(2)(1)(1)=3\det P = (1)(-2) - (1)(1) = -3. By the 2×2 inverse formula: P1=13(2111)=13(2111)P^{-1} = \dfrac{1}{-3} \begin{pmatrix} -2 & -1 \\ -1 & 1 \end{pmatrix} = \dfrac{1}{3} \begin{pmatrix} 2 & 1 \\ 1 & -1 \end{pmatrix}

Step 5 — Verify PDP1=AP D P^{-1} = A.

DP1=(5002)13(2111)=13(10522)D P^{-1} = \begin{pmatrix} 5 & 0 \\ 0 & 2 \end{pmatrix} \cdot \dfrac{1}{3} \begin{pmatrix} 2 & 1 \\ 1 & -1 \end{pmatrix} = \dfrac{1}{3} \begin{pmatrix} 10 & 5 \\ 2 & -2 \end{pmatrix}

PDP1=(1112)13(10522)=13(12369)=(4123)=AP D P^{-1} = \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix} \cdot \dfrac{1}{3} \begin{pmatrix} 10 & 5 \\ 2 & -2 \end{pmatrix} = \dfrac{1}{3} \begin{pmatrix} 12 & 3 \\ 6 & 9 \end{pmatrix} = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix} = A ✓

Using diagonalization to compute AnA^n

Compute A10A^{10} without diagonalizing: multiply AA by itself 9 times. Slow.

With diagonalization: A10=PD10P1A^{10} = P D^{10} P^{-1}

D10=(51000210)=(9,765,625001,024)D^{10} = \begin{pmatrix} 5^{10} & 0 \\ 0 & 2^{10} \end{pmatrix} = \begin{pmatrix} 9{,}765{,}625 & 0 \\ 0 & 1{,}024 \end{pmatrix}. One matrix multiplication on each side and you're done.

When diagonalization works

AA is diagonalizable if any of these holds:

  • AA has nn distinct eigenvalues (no repeats).
  • AA is symmetric (then it's orthogonally diagonalizable — see spectral theorem).
  • AA is normal (AA=AAA A^* = A^* A) — true of symmetric, Hermitian, unitary, orthogonal matrices.

Repeated eigenvalues don't automatically make AA defective — you have to check if the eigenspace has the right dimension.

The defective case

Example: A=(1101)A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}. Characteristic polynomial: (1λ)2(1 - \lambda)^2. Only eigenvalue is λ=1\lambda = 1 with algebraic multiplicity 2. But the eigenspace is spanned by (1,0)T(1, 0)^T only — geometric multiplicity 1 < 2. Not diagonalizable. For this case, use the Jordan canonical form.

Common mistakes

  • Mismatching columns of PP with diagonal of DD. Column ii of PP must be the eigenvector of the eigenvalue diid_{ii}.
  • Using the wrong P1P^{-1}. Always double-check by computing PP1=IP P^{-1} = I.
  • Assuming every square matrix diagonalizes. Many important ones do not (shear matrices, nilpotent matrices).

Try it in the visualization

Slide the matrix entries; eigenvalues/eigenvectors update live. P,D,P1P, D, P^{-1} are displayed and their product is compared against AA — red when not diagonalizable, green when verified.

Interactive Visualization

Parameters

4.00
1.00
2.00
3.00
3.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Diagonalization: A = PDP⁻¹ | MathSpin