Ma · Mathematics

How to Diagonalize a 3×3 Matrix

Published By the 9to5Science editorial team

At a glance

  1. 1. Find eigenvalues

    Solve det(A − λI) = 0 to find the matrix’s eigenvalues.

  2. 2. Find eigenvectors

    For each eigenvalue, solve (A − λI)v = 0 and choose a basis for its eigenspace.

  3. 3. Check independence

    Select three linearly independent eigenvectors; without three, the matrix is not diagonalizable.

  4. 4. Build and verify

    Put the eigenvectors in P’s columns, place their eigenvalues in D, and check AP = PD.

To diagonalize a 3×3 matrix, you need to find its eigenvalues and eigenvectors, then check whether you can choose three linearly independent eigenvectors. If you can, those vectors form the columns of a matrix that changes the matrix into diagonal form.

The method works over a specified number system, usually the real or complex numbers. A matrix with real entries may have complex eigenvalues, so it may be diagonalizable over the complex numbers even when it is not diagonalizable over the reals.

What diagonalization means

A matrix AA is diagonalizable if it can be written as

A=PDP−1,A=PDP^{-1},

where PP is invertible and DD is diagonal. The columns of PP are eigenvectors of AA, in the same order as their corresponding eigenvalues appear on the diagonal of DD.

Equivalently, AP=PDAP=PD. This form is often convenient for checking your result. If AA is diagonalizable, its powers are also easy to compute: An=PDnP−1A^n=PD^nP^{-1}.

Step-by-step method

  1. Find the characteristic polynomial. Calculate det⁡(A−λI)\det(A-\lambda I) and solve det⁡(A−λI)=0\det(A-\lambda I)=0. The solutions are the eigenvalues. Using det⁡(λI−A)\det(\lambda I-A) instead is also standard; it gives the same eigenvalues.
  2. Find each eigenspace. For each eigenvalue λ\lambda, solve (A−λI)v=0(A-\lambda I)v=0. The nonzero solutions are its eigenvectors.
  3. Choose three independent eigenvectors. For each eigenvalue, find a basis for its eigenspace. Altogether, you need three linearly independent vectors in R3\mathbb{R}^3 (or C3\mathbb{C}^3).
  4. Form PP and DD. Put your chosen eigenvectors in the columns of PP. Put the matching eigenvalues on the diagonal of DD, in the same order.
  5. Check the result. Confirm that PP is invertible and that AP=PDAP=PD. If both hold, then A=PDP−1A=PDP^{-1}.

A 3×3 matrix with three distinct eigenvalues is always diagonalizable over a field containing those eigenvalues. If some eigenvalues repeat, diagonalizability depends on the number of independent eigenvectors, not just the characteristic polynomial.

Worked example

Consider

A=(410020003).A=\begin{pmatrix} 4&1&0\\ 0&2&0\\ 0&0&3 \end{pmatrix}.

Because AA is triangular, its eigenvalues are its diagonal entries: 44, 22, and 33. They are distinct, so the matrix is diagonalizable. Find an eigenvector for each one by solving (A−λI)v=0(A-\lambda I)v=0.

For λ=4\lambda=4, the equations give y=z=0y=z=0, so choose v1=(1,0,0)Tv_1=(1,0,0)^T. For λ=2\lambda=2, the first row gives 2x+y=02x+y=0 and the third gives z=0z=0; choose v2=(−1,2,0)Tv_2=(-1,2,0)^T. For λ=3\lambda=3, the equations give x=y=0x=y=0, so choose v3=(0,0,1)Tv_3=(0,0,1)^T.

Use these vectors as the columns of PP, keeping their eigenvalues in the corresponding order in DD:

P=(1−10020001),D=(400020003).P=\begin{pmatrix} 1&-1&0\\ 0&2&0\\ 0&0&1 \end{pmatrix}, \qquad D=\begin{pmatrix} 4&0&0\\ 0&2&0\\ 0&0&3 \end{pmatrix}.

The determinant of PP is 22, so PP is invertible. Its inverse is

P−1=(11200120001).P^{-1}=\begin{pmatrix} 1&\tfrac12&0\\ 0&\tfrac12&0\\ 0&0&1 \end{pmatrix}.

Each column of PP is an eigenvector, so multiplying AA by that column scales it by its eigenvalue. Thus AP=PDAP=PD, and the diagonalization is A=PDP−1A=PDP^{-1}.

When a 3×3 matrix is not diagonalizable

A matrix is not diagonalizable if its eigenspaces do not together provide three linearly independent eigenvectors. For example, a repeated eigenvalue does not automatically prevent diagonalization. The identity matrix has the single eigenvalue 11 with a three-dimensional eigenspace, so it is already diagonal. But a repeated eigenvalue whose eigenspace has too few independent vectors can make diagonalization impossible.

For each eigenvalue, its algebraic multiplicity is how many times it occurs as a root of the characteristic polynomial. Its geometric multiplicity is the dimension of its eigenspace. A 3×3 matrix is diagonalizable precisely when the dimensions of its eigenspaces add up to 3. For each eigenvalue, geometric multiplicity cannot exceed algebraic multiplicity.

Common mistakes

  • Using eigenvalues as the columns of PP. The columns must be eigenvectors; the eigenvalues go on the diagonal of DD.
  • Mismatching the order. If a column of PP is an eigenvector for λ\lambda, the corresponding diagonal entry of DD must be λ\lambda.
  • Assuming repeated eigenvalues rule out diagonalization. Check the eigenspace dimensions instead.
  • Assuming three eigenvalues counted with repetition guarantee diagonalization. You need three independent eigenvectors, not merely three roots of the characteristic polynomial.
  • Trying to invert a singular PP. If your three selected vectors are dependent, they cannot form a diagonalizing matrix.
  • Forgetting the number system. Check whether the required eigenvalues and eigenvectors are real or whether complex numbers are needed.

References

  1. Linear Algebra Done Right, Sheldon Axler

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.