Tutorials › Linear Algebra › Diagonalizability as Similarity to a Diagonal Matrix

Diagonalization · Tutorial 516 of 1000

Diagonalizability as Similarity to a Diagonal Matrix

See how similarity expresses a matrix in new coordinates, where a diagonal form acts by independent scaling.

Intermediate 10 min read

What You'll Learn

  • Define diagonalizability using similarity to a diagonal matrix.
  • Derive the matrix formula for expressing a linear map in a new basis.
  • Interpret diagonal entries as separate coordinate scalings.
  • Verify diagonal forms with exact matrix calculations.
  • Recognize why the order of basis vectors affects the displayed diagonal matrix.
  • Correct the common error of reversing the change-of-basis factors.

What Diagonalizability Means

A diagonal matrix acts in a particularly simple way: each coordinate is multiplied by its own scalar, with no mixing between coordinates. A matrix that is not diagonal in the standard coordinates may still describe an action of this kind when the same linear map is written in a different basis. Diagonalizability gives a precise language for that simplification: it asks whether a matrix is similar to a diagonal matrix.

Throughout, matrices and vectors have real entries, and vectors are columns. Two \(n\times n\) matrices are called similar when one is obtained from the other by an invertible change of coordinates. The matrix that performs the coordinate change must be invertible: without an inverse, the new coordinates could not be converted back uniquely.

Definition: A matrix \(\mathbf{A}\in\mathbb{R}^{n\times n}\) is diagonalizable over \(\mathbb{R}\) if there are an invertible matrix \(\mathbf{P}\in\mathbb{R}^{n\times n}\) and a diagonal matrix \(\mathbf{D}\in\mathbb{R}^{n\times n}\) such that \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\). In that case, \(\mathbf{A}\) and \(\mathbf{D}\) are similar. Equivalently, multiplying the equation on the left by \(\mathbf{P}^{-1}\) gives \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\mathbf{D}\).

The order of the factors matters. The matrix \(\mathbf{P}\) converts coordinates in the chosen basis to standard coordinates, while \(\mathbf{P}^{-1}\) converts standard coordinates back to the chosen basis. Thus \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) describes the same action as \(\mathbf{A}\), but using the new coordinates. A diagonal result means that the action separates into coordinate-by-coordinate scalings in that basis.

How a Change of Basis Changes the Matrix

Let \(T:\mathbb{R}^n\to\mathbb{R}^n\) be a linear map, and let \(\mathbf{A}\) be its matrix in standard coordinates. An ordered basis \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\) determines a matrix \(\mathbf{P}\) whose \(j\)th column is \(\mathbf{b}_j\). If \(\mathbf{x}_{\mathcal{B}}\) is the coordinate column of a vector in this basis, then the vector in standard coordinates is \(\mathbf{P}\mathbf{x}_{\mathcal{B}}\). The matrix \(\mathbf{P}\) is invertible because the basis vectors are linearly independent and span \(\mathbb{R}^n\).

Theorem (Change-of-basis formula): With \(T\), \(\mathbf{A}\), \(\mathcal{B}\), and \(\mathbf{P}\) as above, the matrix of \(T\) in the basis \(\mathcal{B}\) is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\).

Proof. Let \(\mathbf{x}_{\mathcal{B}}\) be the coordinate vector of any input. Its standard-coordinate vector is \(\mathbf{P}\mathbf{x}_{\mathcal{B}}\). Applying \(T\), whose standard-coordinate matrix is \(\mathbf{A}\), gives the standard-coordinate output \(\mathbf{A}\mathbf{P}\mathbf{x}_{\mathcal{B}}\). To express that output in basis \(\mathcal{B}\), multiply by \(\mathbf{P}^{-1}\). The output coordinates are therefore \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\mathbf{x}_{\mathcal{B}}\). Since this holds for every input coordinate vector, the matrix of \(T\) in \(\mathcal{B}\) is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\). \(\square\)

This formula explains the definition: \(\mathbf{A}\) is diagonalizable exactly when there is a basis in which its matrix is diagonal. In using this statement, the basis—and therefore \(\mathbf{P}\)—must be the same on both sides of \(\mathbf{A}\). The left factor changes the output back to the chosen coordinates; the right factor first converts the input to standard coordinates.

Proposition: If \(\mathbf{D}=\operatorname{diag}(d_1,\dots,d_n)\) is diagonal, then \(\mathbf{D}\mathbf{x}=(d_1x_1,\dots,d_nx_n)^{\top}\) for every \(\mathbf{x}=(x_1,\dots,x_n)^{\top}\in\mathbb{R}^n\). In particular, \(\mathbf{D}\) scales each standard coordinate direction separately.

Proof. In row \(i\) of the product \(\mathbf{D}\mathbf{x}\), the only possibly nonzero entry of \(\mathbf{D}\) is \(d_i\) in column \(i\). Thus the \(i\)th output entry is \(d_i x_i\). This holds for each \(i=1,\dots,n\), so the product has the stated form. Taking \(\mathbf{x}=\mathbf{e}_i\), the \(i\)th standard basis vector, gives \(\mathbf{D}\mathbf{e}_i=d_i\mathbf{e}_i\): that coordinate direction is scaled by \(d_i\), with no contribution from other directions. \(\square\)

Worked Similarity Calculations

Worked Example: A Non-Diagonal Matrix with a Diagonal Form

Verify that \(\mathbf{A}=\begin{bmatrix}2&3\\0&5\end{bmatrix}\) is similar to \(\mathbf{D}=\begin{bmatrix}2&0\\0&5\end{bmatrix}\), using \(\mathbf{P}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\).

First compute the inverse. Since \(\begin{bmatrix}1&1\\0&1\end{bmatrix}\begin{bmatrix}1&-1\\0&1\end{bmatrix}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\), we have \(\mathbf{P}^{-1}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\). Now multiply in the order required by the definition:

$$ \mathbf{P}\mathbf{D} = \begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}2&0\\0&5\end{bmatrix} = \begin{bmatrix}2&5\\0&5\end{bmatrix}, $$
$$ \mathbf{P}\mathbf{D}\mathbf{P}^{-1} = \begin{bmatrix}2&5\\0&5\end{bmatrix} \begin{bmatrix}1&-1\\0&1\end{bmatrix} = \begin{bmatrix}2&-2+5\\0&5\end{bmatrix} = \begin{bmatrix}2&3\\0&5\end{bmatrix} =\mathbf{A}. $$

Thus \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\), so \(\mathbf{A}\) is diagonalizable. As a check in the other direction, \(\mathbf{A}\mathbf{P}=\begin{bmatrix}2&5\\0&5\end{bmatrix}=\mathbf{P}\mathbf{D}\), and multiplying by \(\mathbf{P}^{-1}\) on the left gives \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\mathbf{D}\).

Worked Example: A Repeated Diagonal Entry

Let \(\mathbf{P}=\begin{bmatrix}1&1&0\\0&1&1\\0&0&1\end{bmatrix}\) and \(\mathbf{D}=\begin{bmatrix}2&0&0\\0&2&0\\0&0&5\end{bmatrix}\). Compute the similar matrix \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\).

Multiplying \(\mathbf{P}\) by \(\mathbf{D}\) scales its columns, giving \(\begin{bmatrix}2&2&0\\0&2&5\\0&0&5\end{bmatrix}\). The inverse of \(\mathbf{P}\) is \(\begin{bmatrix}1&-1&1\\0&1&-1\\0&0&1\end{bmatrix}\), as direct multiplication with \(\mathbf{P}\) gives \(\mathbf{I}_3\). Therefore

$$ \mathbf{A} = \begin{bmatrix}2&2&0\\0&2&5\\0&0&5\end{bmatrix} \begin{bmatrix}1&-1&1\\0&1&-1\\0&0&1\end{bmatrix} = \begin{bmatrix}2&0&0\\0&2&3\\0&0&5\end{bmatrix}. $$

Check the change-of-basis identity by multiplying \(\mathbf{A}\mathbf{P}\):

$$ \mathbf{A}\mathbf{P} = \begin{bmatrix}2&0&0\\0&2&3\\0&0&5\end{bmatrix} \begin{bmatrix}1&1&0\\0&1&1\\0&0&1\end{bmatrix} = \begin{bmatrix}2&2&0\\0&2&5\\0&0&5\end{bmatrix} = \mathbf{P}\mathbf{D}. $$

Since \(\mathbf{P}\) is invertible, this verifies \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}=\mathbf{D}\). The repeated entry \(2\) presents no obstacle to this calculation: the definition asks for an invertible change of basis and a diagonal matrix, not for all diagonal entries to be different.

Worked Example: Reordering the Diagonal Entries

Let \(\mathbf{A}=\begin{bmatrix}4&0\\0&-1\end{bmatrix}\). Show that the same matrix has a diagonal representation with the diagonal entries in the opposite order.

Take \(\mathbf{P}=\begin{bmatrix}0&1\\1&0\end{bmatrix}\). Since \(\mathbf{P}^2=\mathbf{I}_2\), its inverse is \(\mathbf{P}\). Set \(\mathbf{D}=\begin{bmatrix}-1&0\\0&4\end{bmatrix}\). Then

$$ \mathbf{P}\mathbf{D} = \begin{bmatrix}0&1\\1&0\end{bmatrix} \begin{bmatrix}-1&0\\0&4\end{bmatrix} = \begin{bmatrix}0&4\\-1&0\end{bmatrix}, $$
$$ \mathbf{P}\mathbf{D}\mathbf{P}^{-1} = \begin{bmatrix}0&4\\-1&0\end{bmatrix} \begin{bmatrix}0&1\\1&0\end{bmatrix} = \begin{bmatrix}4&0\\0&-1\end{bmatrix} =\mathbf{A}. $$

The check confirms that \(\mathbf{A}\) is similar to the diagonal matrix with entries \(-1,4\), even though \(\mathbf{A}\) itself displays \(4,-1\). The change in order reflects the chosen order of coordinates; similarity does not require the diagonal entries to appear in one fixed sequence.

Similarity and Common Errors

Similarity is an equivalence relation on the \(n\times n\) real matrices: every matrix is similar to itself, reversing a similarity gives another similarity, and successive similarities can be combined. These facts explain why a matrix can have more than one useful coordinate description.

Theorem: Similarity is reflexive, symmetric, and transitive on \(\mathbb{R}^{n\times n}\).

Proof. For reflexivity, \(\mathbf{A}=\mathbf{I}_n\mathbf{A}\mathbf{I}_n^{-1}\), so \(\mathbf{A}\) is similar to itself. For symmetry, suppose \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) for an invertible \(\mathbf{P}\). Rearranging gives \(\mathbf{A}=\mathbf{P}\mathbf{B}\mathbf{P}^{-1}\), so \(\mathbf{A}\) is similar to \(\mathbf{B}\). For transitivity, suppose \(\mathbf{B}=\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\) and \(\mathbf{C}=\mathbf{Q}^{-1}\mathbf{B}\mathbf{Q}\), where \(\mathbf{P}\) and \(\mathbf{Q}\) are invertible. Substitution gives \(\mathbf{C}=(\mathbf{P}\mathbf{Q})^{-1}\mathbf{A}(\mathbf{P}\mathbf{Q})\), because \((\mathbf{P}\mathbf{Q})^{-1}=\mathbf{Q}^{-1}\mathbf{P}^{-1}\). The product \(\mathbf{P}\mathbf{Q}\) is invertible, with inverse \(\mathbf{Q}^{-1}\mathbf{P}^{-1}\). Thus \(\mathbf{C}\) is similar to \(\mathbf{A}\). \(\square\)

Common pitfall: reversing the factors. In the first worked example, a tempting but incorrect calculation is to use \(\mathbf{P}\mathbf{A}\mathbf{P}^{-1}\) as the matrix in the new coordinates. In fact,

$$ \mathbf{P}\mathbf{A}\mathbf{P}^{-1} = \begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}2&3\\0&5\end{bmatrix} \begin{bmatrix}1&-1\\0&1\end{bmatrix} = \begin{bmatrix}2&6\\0&5\end{bmatrix}, $$

which is not the diagonal matrix \(\mathbf{D}\). The correct formula for the matrix in the new coordinates is \(\mathbf{P}^{-1}\mathbf{A}\mathbf{P}\), as follows from first converting the input to standard coordinates and then converting the output back. The equation \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\) is equivalent, but its factors are arranged to reconstruct the standard-coordinate matrix from the diagonal one.

Another useful distinction is between a matrix and the linear map it represents. Changing basis does not alter the underlying map; it changes the coordinate description of that map. Diagonalization matters because a diagonal description makes repeated applications straightforward: in the diagonal coordinates, applying \(\mathbf{D}\) twice multiplies coordinate \(i\) by \(d_i^2\), and applying it \(k\) times multiplies that coordinate by \(d_i^k\), for any positive integer \(k\). The same map may look less simple in standard coordinates, but the change-of-basis formula keeps the two descriptions linked.

Check Your Understanding

Use the definitions and coordinate formulas above to answer the following questions.

  1. State precisely what must exist for a real square matrix to be diagonalizable over \(\mathbb{R}\).
  2. If \(\mathbf{A}=\mathbf{P}\mathbf{D}\mathbf{P}^{-1}\), which expression gives the matrix in the coordinates determined by \(\mathbf{P}\)?
  3. For \(\mathbf{D}=\begin{bmatrix}3&0\\0&-2\end{bmatrix}\), compute \(\mathbf{D}\begin{bmatrix}a\\b\end{bmatrix}\) and describe the scaling of each coordinate.
  4. Verify that \(\begin{bmatrix}0&1\\1&0\end{bmatrix}^{-1}=\begin{bmatrix}0&1\\1&0\end{bmatrix}\), and explain its effect on the order of two coordinates.
  5. Explain why \(\mathbf{P}\mathbf{A}\mathbf{P}^{-1}\) is not the change-of-basis formula derived in the theorem.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon