Diagonalizing matrices isn't as bad as textbooks make it look

I've diagonalized enough matrices over the years that the process is basically muscle memory now. The standard method works fine for most cases you'll encounter in a linear algebra course or in actual computational work. Here's how it actually goes.

How To Diagonalize A Matrix

Start by finding the eigenvalues. Set the characteristic polynomial equal to zero: det(A - I) = 0. For a 3x3 matrix this gives you a cubic equation. For a 2x2 it's quadratic. Solve for . You'll usually get two or three roots, possibly repeated. These are your eigenvalues and they're the diagonal entries of the target diagonal matrix D. Once you have the eigenvalues, plug each one back into (A - I)v = 0 and solve for the eigenvectors. This is just Gaussian elimination on a slightly singular matrix. The null space gives you the eigenvectors. If an eigenvalue has algebraic multiplicity 2 but the null space only has dimension 1, the matrix is defective and you can't diagonalize it. I ran into this exact situation with a 4x4 block matrix in a control systems project a few years ago. The matrix looked perfectly diagonalizable on paper, but one eigenvalue had a single eigenvector when two were needed. The workaround was to compute the Jordan normal form instead, which handles the generalized eigenvector case. It wasn't pretty but it got the job done. Assemble the eigenvectors as columns into a matrix P. Then D = P^(-1)AP. That's the decomposition. The whole point is that D becomes diagonal with the eigenvalues, and P contains the eigenvectors that transform between the standard basis and the eigenbasis.

One thing beginners consistently mess up is the order. The columns of P must correspond to the same eigenvalues in D, in the same order. Swap two columns in P without swapping the matching diagonal entries and everything breaks. I've seen this cost people entire grades on exams and it takes maybe thirty seconds to verify. Another practical detail: if your matrix is symmetric, everything gets nicer. Real eigenvalues, orthogonal eigenvectors, and P becomes an orthogonal matrix so P^(-1) = P^T. This matters because computing the inverse of a general matrix introduces rounding errors that compound quickly. With a symmetric matrix you skip the inversion entirely and just transpose. For a 100x100 matrix this difference is the gap between a calculation that finishes in minutes and one that fails due to numerical instability. The main bottleneck in practice is solving the characteristic polynomial. For anything past 2x2 or 3x3, symbolic solutions get messy fast. Numerical libraries like LAPACK's DSYEV routine bypass the characteristic polynomial altogether and use the QR algorithm to find eigenvalues directly. If you're doing this computationally, don't write your own root finder. Use an existing implementation.

Not every matrix can be diagonalized. A nontrivial Jordan block like [[2, 1], [0, 2]] has eigenvalue 2 with algebraic multiplicity 2 but geometric multiplicity 1. It's not diagonalizable. Defective matrices show up more often than students expect, especially in Markov chain applications and differential equations where repeated eigenvalues are common. When you hit a defective case, the Schur decomposition or Jordan form are the proper tools. Diagonalization simply doesn't apply. For the actual hand-calculation process, keep your arithmetic clean. Fraction arithmetic is cleaner than decimal until the final step. Cross-multiplying to check eigenvectors back into the original equation takes twenty seconds and catches about half the mistakes I see from people rushing through this.

Get the Full Details

How to Diagonalize a Matrix: Step-by-Step Guide and Example
How to Diagonalize a Matrix: Step-by-Step Guide and Example