Matrix diagonalization is the process of rewriting a complex transformation matrix into its simplest form using eigenvectors and eigenvalues. If you have ever wondered how to turn a tangled mix of rotation and stretching into a clean stretch along clear axes, this is the technique that gets you there, and it is essential for anyone working with linear algebra in engineering, data science, or computer graphics.
How do eigenvectors simplify a transformation?
Think back to the idea of a change of basis: the same vector can have different coordinates depending on the language you use to describe it. A complex transformation, like a rotation combined with a stretch, looks messy in the standard basis formed by i and j. But in the right basis, it becomes almost trivial.
That ideal basis is built from the eigenvectors of the matrix. Take the first eigenvector V1: the transformation only stretches it by a factor of λ1. Take V2: it gets stretched by λ2. No rotation, no shear, just pure scaling along each axis [00:42].
What is a diagonal matrix? It is a matrix whose only nonzero entries sit on the main diagonal. Its only effect is scaling along its own axes, with no rotation or shearing involved.
When you write the matrix in this new language, you get a clean diagonal form D with λ1 and λ2 on the diagonal and zeros everywhere else. That is the purest version of the original transformation.
What is the diagonalization formula?
The translation between the messy standard view and the clean eigenvector view is captured in one elegant equation:
A = P · D · P⁻¹
Each piece has a clear job, and you will notice the structure mirrors the change of basis formula from earlier in the course [02:20]:
- P is the change of basis matrix. Its columns are the eigenvectors of A, and it translates from the standard language to the eigenvector language.
- D is the diagonal matrix containing the eigenvalues. This is the simple, pure scaling version of your transformation.
- P⁻¹ is the inverse change of basis. It translates the result back into the standard language.
How do you diagonalize a matrix step by step?
Let's apply the formula to the matrix A = [[3, 1], [0, 2]] from the previous lesson [03:05].
- Build D with the eigenvalues on the diagonal: D = [[3, 0], [0, 2]].
- Build P with the eigenvectors as columns: P = [[1, 1], [0, -1]].
- Compute P⁻¹ using the inverse formula, 1/det(P) times the adjusted matrix. The determinant is -1, so P⁻¹ = [[1, 1], [0, -1]].
When you multiply P · D · P⁻¹ from right to left, you recover exactly the original A = [[3, 1], [0, 2]]. The diagonalization works perfectly.
Why is diagonalization useful in real problems?
One of the most powerful applications is computing powers of a matrix. Imagine you need A raised to the 100. Multiplying A by itself a hundred times sounds painful, and it is.
With diagonalization, the trick becomes almost effortless. Watch what happens when you square A:
A² = (P · D · P⁻¹)(P · D · P⁻¹)
Group the middle terms: P⁻¹ · P equals the identity matrix, which disappears from the product. You are left with P · D² · P⁻¹.
How do you compute powers of a matrix using diagonalization? Use the formula Aᵏ = P · Dᵏ · P⁻¹. Since D is diagonal, raising it to any power just means raising each diagonal entry to that power.
This generalizes beautifully: Aᵏ = P · Dᵏ · P⁻¹ for any integer k [06:30]. Because D is diagonal, you only raise the diagonal numbers to the k-th power, and the heavy lifting collapses into a couple of matrix products. Try it yourself with the matrix from the example: square it using diagonalization and watch how fast it resolves.
When can a matrix be diagonalized?
Not every matrix gets to enjoy this clean treatment. The whole process depends on being able to construct P, and P only exists if you have enough independent eigenvectors to fill its columns.
The rule is precise: an n×n matrix A is diagonalizable if and only if it has n linearly independent eigenvectors [07:45]. There is also a friendly shortcut, when an n×n matrix has n distinct eigenvalues, its eigenvectors are guaranteed to be linearly independent, so the matrix is automatically diagonalizable. That is exactly what happened in the example above.
Are all matrices diagonalizable? No. If a matrix has repeated eigenvalues, it might not have enough independent eigenvectors to form P, and in that case it cannot be diagonalized.
The trouble appears when eigenvalues repeat. A repeated eigenvalue does not always come with enough independent eigenvectors, and without that full set, you cannot build the ideal basis P. The matrix simply refuses to diagonalize.
You started this journey thinking of a vector as a simple arrow, and now you can read the deeper structure behind transformations, the same structure that powers video games, engineering simulations, and data analysis. Linear algebra is the foundation for almost every quantitative field, so keep exploring. ¿Qué tema te gustaría profundizar a continuación? Cuéntanos en los comentarios.