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.
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\).
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:
\[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.
The method
- Find the eigenvalues from the characteristic equation.
- 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.
- Build \(P\) from the eigenvectors as columns, and \(D\) from the eigenvalues in the same order.
- Find \(P^{-1}\) (or use \(P^T\) after normalising, for a symmetric matrix), and check \(P^{-1}AP = D\) or the quicker \(AP = PD\).
Solved examples
Example 1: A 2×2 matrix
EasyDiagonalise \(A = \begin{bmatrix} 4 & 1 \\ 2 & 3 \end{bmatrix}\).
- From the eigenvalues lesson: \(\lambda = 5\) with \((1, 1)^T\), and \(\lambda = 2\) with \((1, -2)^T\).
- \(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}\).
- 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ⁿ
MediumFor the matrix of Example 1, find \(A^n\).
- \(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}\)
- First \(PD^n = \begin{bmatrix} 5^n & 2^n \\ 5^n & -2\cdot 2^n \end{bmatrix}\). Then multiply by \(P^{-1}\).
- 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
MediumDiagonalise \(A = \begin{bmatrix} 1 & 0 & -1 \\ 1 & 2 & 1 \\ 2 & 2 & 3 \end{bmatrix}\).
- 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\).
- \[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}\]
- 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
MediumIs \(A = \begin{bmatrix} 2 & 2 & 1 \\ 1 & 3 & 1 \\ 1 & 2 & 2 \end{bmatrix}\) diagonalisable? If so, diagonalise it.
- 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.
- \[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
MediumShow that \(A = \begin{bmatrix} 1 & 1 \\ -1 & 3 \end{bmatrix}\) is not diagonalisable.
- \(\operatorname{tr}A = 4\), \(|A| = 3 + 1 = 4\). \(\lambda^2 - 4\lambda + 4 = (\lambda - 2)^2 = 0\), so \(\lambda = 2\) twice.
- \(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\).
- A 2×2 matrix needs two independent eigenvectors to fill \(P\).
AnswerNot diagonalisable.
Example 6: Orthogonal diagonalisation
Exam levelDiagonalise the symmetric matrix \(A = \begin{bmatrix} 8 & -6 & 2 \\ -6 & 7 & -4 \\ 2 & -4 & 3 \end{bmatrix}\) by an orthogonal transformation.
- Eigenvalues \(0, 3, 15\) with eigenvectors \((1, 2, 2)^T\), \((2, 1, -2)^T\), \((2, -2, 1)^T\). They are mutually perpendicular.
- 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}\]
- \(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 levelFor \(A = \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix}\), find \(A^n\) and hence \(A^8\).
- \(\lambda^2 - 2\lambda - 3 = 0\), so \(\lambda = 3\) with \((1, 1)^T\), and \(\lambda = -1\) with \((1, -1)^T\).
- \(P = \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}\), \(P^{-1} = \tfrac{1}{2}\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}\).
- \[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}\]
- \(n = 8\): \(\tfrac{1}{2}(6561 + 1) = 3281\) and \(\tfrac{1}{2}(6561 - 1) = 3280\).
- This agrees with \(A^8 = 1640A + 1641I\) from the Cayley–Hamilton lesson.
Answer\(A^8 = \begin{bmatrix} 3281 & 3280 \\ 3280 & 3281 \end{bmatrix}\)
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.
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\).
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\).
Bring it to a free demo class and work through it with Vipul Sir. Book on WhatsApp.
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.