Linear Algebra & DE · Unit 1 · Topic 06

Diagonalisation: the right axes make a matrix simple.

Short answer

If an \(n\times n\) matrix \(A\) has \(n\) independent eigenvectors, put them in the columns of \(P\). Then \(P^{-1}AP = D\), the diagonal matrix of eigenvalues, and \(A^n = PD^nP^{-1}\).

For \(A = \begin{bmatrix} 4 & 1 \\ 2 & 3 \end{bmatrix}\): \(P = \begin{bmatrix} 1 & 1 \\ 1 & -2 \end{bmatrix}\) gives \(D = \operatorname{diag}(5, 2)\).

Engineering MathsB Tech / BEBSc
01

What diagonalisation means

Before you start: you need to find eigenvalues and eigenvectors and test vectors for linear independence.

Diagonal matrices are the easiest matrices there are. To square one, square its diagonal entries; to find its eigenvalues, read them off. Diagonalisation turns a general matrix into a diagonal one by changing to a better set of axes: the eigenvectors.

Diagonalisation

Let \(A\) be \(n\times n\) with eigenvalues \(\lambda_1, \dots, \lambda_n\) and eigenvectors \(X_1, \dots, X_n\). Put the eigenvectors in the columns of \(P = [X_1\ X_2\ \cdots\ X_n]\). If \(P\) is invertible, then \[P^{-1}AP = D = \operatorname{diag}(\lambda_1, \lambda_2, \dots, \lambda_n)\]

\(P\) is called the modal matrix and \(D\) the spectral matrix.

When it works

\(A\) is diagonalisable \(\iff\) it has \(n\) linearly independent eigenvectors. Distinct eigenvalues always give that. For a repeated eigenvalue repeated \(m\) times, you need \(n - \rho(A - \lambda I) = m\).

Why it works: \(AX_i = \lambda_iX_i\) for every column, so \(AP = PD\). Multiplying on the left by \(P^{-1}\) gives \(P^{-1}AP = D\). The eigenvalues in \(D\) must be in the same order as their eigenvectors in \(P\).

02

Powers of a matrix

From \(P^{-1}AP = D\) we get \(A = PDP^{-1}\). In \(A^2 = PDP^{-1}PDP^{-1}\) the middle \(P^{-1}P\) cancels, and the same happens in every power:

Powers

\[A^n = PD^nP^{-1}, \qquad D^n = \operatorname{diag}(\lambda_1^n, \dots, \lambda_k^n)\]

This gives a formula for \(A^n\) for every \(n\) at once. It is how engineers solve systems of linear differential equations and step-by-step models like Markov chains.

Orthogonal diagonalisation of a symmetric matrix

If \(A\) is real and symmetric, its eigenvectors for different eigenvalues are perpendicular. Divide each eigenvector by its length, and \(P\) becomes an orthogonal matrix: \(P^{-1} = P^T\). Then

\[P^TAP = D\]

No inverse to calculate. Every real symmetric matrix can be diagonalised this way, even with repeated eigenvalues. This is the step behind reducing a quadratic form to its canonical form.

03

The method

  1. Find the eigenvalues from the characteristic equation.
  2. Find an eigenvector for each. For a repeated eigenvalue, check \(\rho(A - \lambda I)\) to see how many independent ones exist. If there are not enough, stop: \(A\) is not diagonalisable.
  3. Build \(P\) from the eigenvectors as columns, and \(D\) from the eigenvalues in the same order.
  4. Find \(P^{-1}\) (or use \(P^T\) after normalising, for a symmetric matrix), and check \(P^{-1}AP = D\) or the quicker \(AP = PD\).
04

Solved examples

Example 1: A 2×2 matrix

Easy

Diagonalise \(A = \begin{bmatrix} 4 & 1 \\ 2 & 3 \end{bmatrix}\).

  1. From the eigenvalues lesson: \(\lambda = 5\) with \((1, 1)^T\), and \(\lambda = 2\) with \((1, -2)^T\).
  2. \(P = \begin{bmatrix} 1 & 1 \\ 1 & -2 \end{bmatrix}\), \(|P| = -3\), \(P^{-1} = -\tfrac{1}{3}\begin{bmatrix} -2 & -1 \\ -1 & 1 \end{bmatrix} = \tfrac{1}{3}\begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix}\).
  3. Check: \(AP = \begin{bmatrix} 5 & 2 \\ 5 & -4 \end{bmatrix} = PD\) with \(D = \begin{bmatrix} 5 & 0 \\ 0 & 2 \end{bmatrix}\). ✓

Answer\(P^{-1}AP = \begin{bmatrix} 5 & 0 \\ 0 & 2 \end{bmatrix}\) with \(P = \begin{bmatrix} 1 & 1 \\ 1 & -2 \end{bmatrix}\)

Example 2: A formula for Aⁿ

Medium

For the matrix of Example 1, find \(A^n\).

  1. \(A^n = PD^nP^{-1} = \begin{bmatrix} 1 & 1 \\ 1 & -2 \end{bmatrix}\begin{bmatrix} 5^n & 0 \\ 0 & 2^n \end{bmatrix}\cdot\tfrac{1}{3}\begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix}\)
  2. First \(PD^n = \begin{bmatrix} 5^n & 2^n \\ 5^n & -2\cdot 2^n \end{bmatrix}\). Then multiply by \(P^{-1}\).
  3. Test with \(n = 1\): \(\tfrac{1}{3}(10 + 2) = 4\), \(\tfrac{1}{3}(5 - 2) = 1\), \(\tfrac{1}{3}(10 - 4) = 2\), \(\tfrac{1}{3}(5 + 4) = 3\). That is \(A\). ✓

Answer\[A^n = \frac{1}{3}\begin{bmatrix} 2\cdot 5^n + 2^n & 5^n - 2^n \\ 2\cdot 5^n - 2\cdot 2^n & 5^n + 2\cdot 2^n \end{bmatrix}\]

Example 3: A 3×3 matrix, distinct eigenvalues

Medium

Diagonalise \(A = \begin{bmatrix} 1 & 0 & -1 \\ 1 & 2 & 1 \\ 2 & 2 & 3 \end{bmatrix}\).

  1. Eigenvalues 1, 2, 3 are distinct, so \(A\) is diagonalisable. Eigenvectors (from the eigenvalues lesson): \((1, -1, 0)^T\), \((-2, 1, 2)^T\), \((1, -1, -2)^T\).
  2. \[P = \begin{bmatrix} 1 & -2 & 1 \\ -1 & 1 & -1 \\ 0 & 2 & -2 \end{bmatrix}, \quad |P| = 2, \quad P^{-1} = \frac{1}{2}\begin{bmatrix} 0 & -2 & 1 \\ -2 & -2 & 0 \\ -2 & -2 & -1 \end{bmatrix}\]
  3. Multiplying out gives \(P^{-1}AP = \operatorname{diag}(1, 2, 3)\).

Answer\(P^{-1}AP = \operatorname{diag}(1, 2, 3)\)

Example 4: A repeated eigenvalue that still works

Medium

Is \(A = \begin{bmatrix} 2 & 2 & 1 \\ 1 & 3 & 1 \\ 1 & 2 & 2 \end{bmatrix}\) diagonalisable? If so, diagonalise it.

  1. Eigenvalues \(5, 1, 1\). For \(\lambda = 1\), \(\rho(A - I) = 1\), so there are \(3 - 1 = 2\) independent eigenvectors: \((-2, 1, 0)^T\) and \((-1, 0, 1)^T\). With \((1, 1, 1)^T\) for \(\lambda = 5\), that makes three.
  2. \[P = \begin{bmatrix} 1 & -2 & -1 \\ 1 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix}, \quad |P| = 4, \quad P^{-1} = \frac{1}{4}\begin{bmatrix} 1 & 2 & 1 \\ -1 & 2 & -1 \\ -1 & -2 & 3 \end{bmatrix}\]

AnswerYes: \(P^{-1}AP = \operatorname{diag}(5, 1, 1)\)

Example 5: A matrix that can't be diagonalised

Medium

Show that \(A = \begin{bmatrix} 1 & 1 \\ -1 & 3 \end{bmatrix}\) is not diagonalisable.

  1. \(\operatorname{tr}A = 4\), \(|A| = 3 + 1 = 4\). \(\lambda^2 - 4\lambda + 4 = (\lambda - 2)^2 = 0\), so \(\lambda = 2\) twice.
  2. \(A - 2I = \begin{bmatrix} -1 & 1 \\ -1 & 1 \end{bmatrix}\) has rank 1, so there is only \(2 - 1 = 1\) independent eigenvector, \((1, 1)^T\).
  3. A 2×2 matrix needs two independent eigenvectors to fill \(P\).

AnswerNot diagonalisable.

Example 6: Orthogonal diagonalisation

Exam level

Diagonalise the symmetric matrix \(A = \begin{bmatrix} 8 & -6 & 2 \\ -6 & 7 & -4 \\ 2 & -4 & 3 \end{bmatrix}\) by an orthogonal transformation.

  1. Eigenvalues \(0, 3, 15\) with eigenvectors \((1, 2, 2)^T\), \((2, 1, -2)^T\), \((2, -2, 1)^T\). They are mutually perpendicular.
  2. Each has length \(\sqrt{1 + 4 + 4} = 3\). Normalise by dividing by 3: \[P = \frac{1}{3}\begin{bmatrix} 1 & 2 & 2 \\ 2 & 1 & -2 \\ 2 & -2 & 1 \end{bmatrix}\]
  3. \(P\) is orthogonal, so \(P^{-1} = P^T\) and no inverse needs computing.

Answer\(P^TAP = \operatorname{diag}(0, 3, 15)\)

Example 7: Aⁿ for a symmetric 2×2 matrix

Exam level

For \(A = \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix}\), find \(A^n\) and hence \(A^8\).

  1. \(\lambda^2 - 2\lambda - 3 = 0\), so \(\lambda = 3\) with \((1, 1)^T\), and \(\lambda = -1\) with \((1, -1)^T\).
  2. \(P = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}\), \(P^{-1} = \tfrac{1}{2}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}\).
  3. \[A^n = \frac{1}{2}\begin{bmatrix} 3^n + (-1)^n & 3^n - (-1)^n \\ 3^n - (-1)^n & 3^n + (-1)^n \end{bmatrix}\]
  4. \(n = 8\): \(\tfrac{1}{2}(6561 + 1) = 3281\) and \(\tfrac{1}{2}(6561 - 1) = 3280\).
  5. This agrees with \(A^8 = 1640A + 1641I\) from the Cayley–Hamilton lesson.

Answer\(A^8 = \begin{bmatrix} 3281 & 3280 \\ 3280 & 3281 \end{bmatrix}\)

Vipul Sir's tip

Checking \(P^{-1}AP = D\) means two matrix products and an inverse. Check \(AP = PD\) instead: column \(i\) of \(AP\) must be \(\lambda_i\) times column \(i\) of \(P\). It catches the same errors in half the time.

05

Common mistakes

1. Putting eigenvectors in the rows of P

The eigenvectors go in the columns of \(P\). With rows you get \(P^T\), and \((P^T)^{-1}AP^T\) is not diagonal in general.

2. Mixing up the order

If \(P = [X_1\ X_2\ X_3]\), then \(D = \operatorname{diag}(\lambda_1, \lambda_2, \lambda_3)\) in the same order. Swap two eigenvectors and you must swap the eigenvalues too.

3. Forgetting to normalise for an orthogonal P

\(P^{-1} = P^T\) only after each column has length 1. In Example 6, without the factor \(\tfrac{1}{3}\), \(P^TP = 9I\), not \(I\).

06

Practice questions

Try each one on paper before you open the answer.

Q1Diagonalise \(\begin{bmatrix} 1 & 4 \\ 2 & 3 \end{bmatrix}\).

\(\lambda = 5, -1\). \(P = \begin{bmatrix} 1 & 2 \\ 1 & -1 \end{bmatrix}\), \(D = \operatorname{diag}(5, -1)\).

Q2Is \(\begin{bmatrix} 3 & 1 \\ 0 & 3 \end{bmatrix}\) diagonalisable?

No. \(\lambda = 3\) twice, but \(A - 3I\) has rank 1, so there is only one independent eigenvector.

Q3Diagonalise \(\begin{bmatrix} 2 & 0 & 1 \\ 0 & 2 & 0 \\ 1 & 0 & 2 \end{bmatrix}\) by an orthogonal matrix.

Eigenvalues 1, 2, 3 with eigenvectors \((1, 0, -1)\), \((0, 1, 0)\), \((1, 0, 1)\). Divide the first and third by \(\sqrt{2}\). Then \(P^TAP = \operatorname{diag}(1, 2, 3)\).

Q4Find \(A^n\) for \(A = \begin{bmatrix} 5 & 4 \\ 1 & 2 \end{bmatrix}\).

\(\lambda = 6, 1\); \(P = \begin{bmatrix} 4 & 1 \\ 1 & -1 \end{bmatrix}\). \(A^n = \tfrac{1}{5}\begin{bmatrix} 4\cdot 6^n + 1 & 4\cdot 6^n - 4 \\ 6^n - 1 & 6^n + 4 \end{bmatrix}\).

Q5A 3×3 matrix has eigenvalues 1, 2, 2 and \(\rho(A - 2I) = 2\). Is it diagonalisable?

No. \(\lambda = 2\) is repeated twice but gives only \(3 - 2 = 1\) independent eigenvector, so there are only two in total.

Q6Diagonalise \(\begin{bmatrix} 6 & -2 & 2 \\ -2 & 3 & -1 \\ 2 & -1 & 3 \end{bmatrix}\).

\(\lambda = 8\): \((2, -1, 1)^T\). \(\lambda = 2\) (twice): \((0, 1, 1)^T\) and \((1, 1, -1)^T\). With these as columns of \(P\), \(P^{-1}AP = \operatorname{diag}(8, 2, 2)\). The three vectors are perpendicular, so you can also normalise and use \(P^T\).

Stuck on a question?

Bring it to a free demo class and work through it with Vipul Sir. Book on WhatsApp.

07

Frequently asked questions

When is a matrix diagonalisable?

When it has \(n\) linearly independent eigenvectors. Distinct eigenvalues guarantee this, and so does being real symmetric. With a repeated eigenvalue, check that \(n - \rho(A - \lambda I)\) equals the number of times it repeats.

What are the modal and spectral matrices?

The modal matrix \(P\) has the eigenvectors as its columns. The spectral matrix \(D\) is the diagonal matrix of the matching eigenvalues.

Is the diagonal form unique?

The eigenvalues on the diagonal are fixed, but their order and the choice of eigenvectors are not. Any non-zero multiple of an eigenvector works in \(P\), as long as \(D\) follows the same order.

What is the difference between similar and orthogonal diagonalisation?

In both, \(D = P^{-1}AP\). Orthogonal diagonalisation uses unit, mutually perpendicular eigenvectors so that \(P^{-1} = P^T\). It is possible exactly when \(A\) is real symmetric.

Related lessons

← All 12 Linear Algebra & DE topics
Vipul Sir
Written by Vipul Sir

Vipul Sir has taught mathematics for over 15 years to HSC, CBSE, ICSE, IGCSE/IB, Diploma, Engineering and BSc students at VVS Classes in Goregaon and Vile Parle, Mumbai. He teaches every class himself, concepts first and exam technique second.

Linear Algebra and Differential Equations

Get Linear Algebra & DE right, with Vipul Sir beside you.

Concept-first classes in small batches in Goregaon and Vile Parle, or online. Your first class is free.

WhatsApp↗