JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Diagonalization: A Matrix in Its Simplest Form

If a matrix has enough independent eigenvectors, you can switch to a coordinate system built from them — an eigenbasis — where the matrix becomes a simple diagonal scaling. This is diagonalization, A = P*D*P^(-1), and it turns the painful job of computing A^k into trivial arithmetic.

Choose axes the matrix loves

In standard coordinates a matrix can look tangled. But suppose we use its eigenvectors as the new axes — an eigenbasis. Along each axis the matrix does nothing but scale by that axis's eigenvalue. In those coordinates the matrix is diagonal: zeros everywhere except scale factors on the diagonal.

A = P * D * P^(-1)

P  = eigenvectors as columns
D  = eigenvalues on the diagonal, e.g. [[2,0],[0,3]]
P^(-1) translates standard coords -> eigen coords
The diagonalization recipe: change in, scale, change back.

Why this makes powers trivial

Computing A^k directly means multiplying messy matrices over and over. With diagonalization, the inner P^(-1) and P cancel between repeats, leaving just D^k — and raising a diagonal matrix to a power means raising each diagonal entry to that power. That's it.

A^k = P * D^k * P^(-1)

D = [[2,0],[0,3]]
D^10 = [[1024,0],[0,59049]]   (just 2^10 and 3^10)
The middle Ps cancel, so only the diagonal entries get raised to the power.

An honest caveat: not every matrix is diagonalizable

The whole trick needs P to be invertible, which means you need enough independent eigenvectors to fill the basis — n of them for an n-by-n matrix. Some matrices simply do not have that many, and they cannot be diagonalized over the reals.

  1. Take the shear A = [[1,1],[0,1]] and solve det(A - lambda*I) = (1-lambda)^2 = 0.
  2. The only eigenvalue is lambda = 1, repeated twice — but it yields just one direction of eigenvectors, (1,0).
  3. One independent eigenvector cannot fill a 2D basis, so P is not invertible and the shear is not diagonalizable.