A diagonalizable matrix can be factored as PDP⁻¹, where D is the diagonal matrix of eigenvalues and P is the matrix of eigenvectors. This factorization strips away the complexity of the original matrix, reducing powers, exponentials, and differential equations to operations on individual eigenvalues. Diagonalization is possible when and only when the eigenvectors form a basis — and for symmetric matrices, this is always the case.
What Diagonalization Means
An n×nmatrixA is diagonalizable if there exists an invertible matrix P and a diagonal matrix D such that
What Diagonalization Means
A=PDP−1
The columns of P are eigenvectors of A. The diagonal entries of D are the corresponding eigenvalues, in the same order. The factorization says that in the basis of eigenvectors, the transformation acts by pure scaling along each axis — the most transparent possible description.
Equivalently, A is diagonalizable if and only if Rn has a basis consisting entirely of eigenvectors of A. The matrix P converts between the standard basis and this eigenvector basis, and D is the matrix of the transformation in the eigenvector basis.
Diagonalizing does not change the map, only the point of view: in the eigenvector basis it is pure stretching.
Diagonalization Notation
Notation
Diagonalization Notation
Three letters in a fixed arrangement, where the two outer factors are inverses of each other and the middle one holds everything the matrix really does — plus a silent pairing requirement between them, and a one-word name for the matrices that refuse. All catalogued among the linear algebra symbols.
A factors as P, times a diagonal D, times P inverse
A letter contract in the decomposition family: P holds the eigenvectors as columns, D the eigenvalues on its diagonal, and the outer factors are inverses so the product is a change of coordinates and back — the same matrix seen in a basis where it merely scales.
CasesThe arrangement is also written P−1AP=D, which reads as an instruction rather than a factorisation: conjugating Adiagonalises it. Both say one thing, and which appears depends on whether the author is building A or simplifying it.
Do not confusePDP−1 with P−1DP. The two are different matrices — swapping them inverts the change of basis — and since both are "P and its inverse around a diagonal", the error survives a casual look at the shape.
column j of P↔ entry j of D
the j-th eigenvector must sit above the j-th eigenvalue
A requirement the notation states nowhere: Constructing the Diagonalization below says to place them "in matching order", and nothing in A=PDP−1 records that the pairing has been respected. The letters look correct whether or not the columns line up.
CasesThe order itself is otherwise free — permuting the pairs consistently gives a different but equally valid P and D, which is why the factorisation is not unique and why "the" diagonalisation is a loose phrase.
Do not confuseTreating D as sorted. There is no convention forcing eigenvalues into increasing order here — unlike the singular values of an SVD, which carry a built-in ordering — so a D that looks unsorted is not thereby wrong.
defective
a matrix with too few independent eigenvectors to diagonalise
The one-word name for failure, and it is a statement about counts: a matrix is defective when some eigenvalue's geometric multiplicity falls short of its algebraic one, so the eigenvectors cannot fill a basis — When Diagonalization Fails below.
CasesThe word is unusually specific: it never means singular, ill-conditioned, or wrong. A defective matrix can be invertible and perfectly well behaved; it simply has no P, and the Jordan form is what replaces D when it does not exist.
Do not confuseHaving a repeated eigenvalue. Repetition is necessary for defectiveness but not sufficient — the identity matrix repeats an eigenvalue n times and is already diagonal; it is the multiplicity gap, not the repetition, that defeats the construction.
The eigenvectors are being loaded in as the columns of P and their eigenvalues placed on the diagonal of D in the matching order. The order is a free choice, but it must be the same choice in both — column three of P has to belong to the third diagonal entry of D. Assemble it yourself on the diagonalization visualizer.
Mismatching the order is the most common error here, and it produces a factorisation that silently fails to reconstruct the original.
When Is a Matrix Diagonalizable?
The definitive necessary and sufficient condition:
Diagonalizability Condition
A diagonalizable⟺mg(λ)=ma(λ) for every eigenvalue λ
Eigenvectors for distinct eigenvalues are linearly independent, so n distinct eigenvalues produce n independent eigenvectors — exactly enough for a basis.
When eigenvalues repeat, diagonalizability depends on the eigenspaces. A repeated eigenvalue λ with algebraic multiplicity k must have a k-dimensional eigenspace. If the eigenspace falls short — dimension less than k — there are not enough eigenvectors, and the matrix cannot be diagonalized.
Example of Failure
A=(2012) has eigenvalue λ=2 with ma=2, but A−2I=(0010) has null space of dimension 1. Only one independent eigenvector exists, so P cannot be built. The matrix is defective.
Pitfall: Treating a repeated eigenvalue as failure
Calling A=311131113 defective because its eigenvalues 5,2,2 repeat skips the eigenspace check. Here A−2I has rank 1, so mg(2)=2=ma(2) and A is diagonalizable.
The test therefore runs one eigenvalue at a time. For each repeated eigenvalue λ, the dimension of its eigenspace is n−rank(A−λI), and this number is compared with the multiplicity of λ as a root of the characteristic polynomial. An eigenvalue that occurs only once needs no check, since its eigenspace always has dimension exactly 1.
Matrix Powers
The primary computational payoff of diagonalization is the simplification of matrix powers:
Matrix Powers
Ak=PDkP−1=Pdiag(λ1k,λ2k,…,λnk)P−1
Raising a diagonal matrix to a power means raising each diagonal entry independently. The entire cost of Ak, for any k, is one matrix inversion and two matrix multiplications — the same cost regardless of whether k is 2 or 2 million.
Worked Example
Using the diagonalization from section 2: P−1=31(1−211).
Raising each entry of A=(1423) to the fourth power gives (12561681), which is not A4. Only the diagonal factor D is powered entry by entry, and PD4P−1=(209416208417).
Without diagonalization, computing A4 requires three sequential matrix multiplications.
Those multiplications are still the quickest check on the result. Squaring A gives A2=(916817), and squaring A2 lands on the same A4 as the diagonal route. Each entry of these products combines a whole row with a whole column, so every entry of A has a share in every entry of A4.
The determinant runs (−5)k and the trace runs 5k+(−1)k — the eigenvalues of A raised to the power, and nothing else. Neither reads the entries. That is why a closed form exists at all: the growth was never a property of the sixteen numbers on display, only of the two hiding behind them.
The diagram is the route the formula replaces, and it is worth seeing once because the cost is invisible in the formula. Each state above costs a full matrix multiplication and each depends on the one before it, so reaching A20 means nineteen of them, while PD20P−1 costs exactly what A4 did — one inversion and two products, whatever the exponent.
The invariant columns are the sharper point. The determinant runs −5,25,−125,625 and the trace runs 4,26,124,626 — these are (−5)k and 5k+(−1)k, computed from the eigenvalues alone. The entries of Ak grow unpredictably; the two numbers that describe the matrix do not. Diagonalization is what moves that regularity out of the invariants and into the matrix itself.
A power collapsing to a diagonal power
Every interior pair of P and its inverse has cancelled, leaving one P, the diagonal raised to the power, and one inverse. Raising a diagonal matrix to a power is entrywise, so an expensive repeated multiplication has become a handful of scalar powers. Push the exponent higher and watch the cost stay flat on the diagonalization visualizer.
This is the reason diagonalisation is worth the trouble: it turns repeated matrix multiplication into arithmetic on a diagonal.
Systems of Differential Equations
The linear system x′=Ax has a clean solution when A is diagonalizable. In the eigenvector basis, the system decouples into n independent scalar equations yi′=λiyi, each with solution yi(t)=cieλit.
Converting back to the original basis, the general solution is
Systems of Differential Equations
x(t)=c1eλ1tv1+c2eλ2tv2+⋯+cneλntvn
Each eigenvalue determines the behavior along its eigenvector direction. Positive eigenvalues produce exponential growth, negative eigenvalues produce decay, and zero eigenvalues produce constant components. Complex eigenvalues produce oscillatory terms involving sines and cosines modulated by exponential envelopes.
Pitfall: Reading the constants off the initial vector
With A from section 2 and x(0)=(1,0)T, taking c1=1, c2=0 from the entries gives a solution that starts at (1,2)T. Solving c1(1,2)T+c2(−1,1)T=(1,0)T gives c1=31, c2=−32.
The constants c1,…,cn are determined by the initial condition x(0): express x(0) as a linear combination of the eigenvectors and read off the coefficients.
In matrix form, finding the constants is a single linear system. Collecting them in a vector c=(c1,…,cn)T, the solution at t=0 reads Pc=x(0), so c=P−1x(0) holds the coordinates of the starting point in the eigenvector basis. This is the same change of basis that the factorization A=PDP−1 performs, applied to one vector.
When A is diagonalizable, x′=Ax decouples into independent equations yi′=λiyi with solutions cieλit. Each eigenvalue decides the behavior along its own eigenvector.
Along eigenvector vi
cieλitvi
split by the eigenvalue λi
↑
Case 1
λi>0
Exponential growth
↓
Case 2
λi<0
Decay
=
Case 3
λi=0
Constant component
~
Case 4
λi complex
Oscillation
sines and cosines modulated by exponential envelopes; see complex eigenvalues
Takeaway
The constants c1,…,cn come from the initial condition: write x(0) as a combination of the eigenvectors and read off the coefficients.
The discrete system xn+1=Axn has solution xn=Anx0. When A is diagonalizable, this becomes
Recurrence Relations
xn=PDnP−1x0=c1λ1nv1+c2λ2nv2+⋯+cnλnnvn
RULE
The dominant eigenvalue — the eigenvalue with the largest absolute value — determines the long-term growth rate.
As n→∞, the term ciλinvi with the largest ∣λi∣ dominates all others.
Fact: Rounding gives every Fibonacci number
Since ∣ϕ^n∣≤1 and 5>2, the term ϕ^n/5 is always smaller than 21 in size. So Fn is simply ϕn/5 rounded to the nearest whole number: ϕ10/5≈55.004, and F10=55.
The Fibonacci sequence provides a classic application. The recurrence Fn+1=Fn+Fn−1 translates to (Fn+1Fn)=(1110)n(10). The matrix has eigenvalues ϕ=21+5 and ϕ^=21−5. Diagonalization gives the Binet formula: Fn=5ϕn−ϕ^n, a closed-form expression for the n-th Fibonacci number.
The second eigenvalue is ϕ^≈−0.618, smaller than 1 in size, so ϕ^n shrinks toward zero with alternating sign while ϕn grows. The dominant eigenvalue takes over within a few steps: already F11/F10=89/55≈1.618 agrees with ϕ to three decimals.
A Markov matrix after eight steps
The recurrence xn+1 = Axn with a Markov matrix A. Written through the diagonalization, A8 = PD8P−1: the eigenvalue 1 stays 1 at every power while the other eigenvalue, smaller than 1 in size, dies away. After eight steps A8 is already close to its limit — every column near the steady state, the eigenvector for λ = 1. Change the power on the matrix diagonalization visualizer.
In a recurrence, the eigenvalues decide the long run: those below 1 in size fade, and what is left is the eigenvector of the largest.
The Spectral Theorem for Symmetric Matrices
Every real symmetric matrix is diagonalizable. This is guaranteed — no conditions need to be checked.
The result is stronger than ordinary diagonalizability. The diagonalizing matrix P can be chosen orthogonal (P−1=PT):
Each term λiqiqiT is the eigenvalue times the projection matrix onto the line spanned by qi, which is the whole eigenspace only when λi is a simple eigenvalue. The matrix A is decomposed into a sum of rank-one projections, weighted by eigenvalues.
The spectral theorem is the most powerful diagonalization result in real linear algebra. It guarantees real eigenvalues, orthogonal eigenvectors, and a decomposition that simultaneously diagonalizes and orthogonalizes.
Both write A as a diagonal matrix conjugated by an eigenvector matrix. Symmetry upgrades every line of the comparison — the eigenvectors, the eigenvalues, the guarantee, and the cost of inverting.
Every improvement traces to one hypothesis. Symmetry forces real eigenvalues, forces eigenvectors for distinct eigenvalues to be orthogonal, and forces enough of them to exist — so the spectral theorem is not a special case so much as the case where nothing can go wrong.
Read across and every row improves in the same direction, which is unusual — most comparisons trade one advantage for another. Here symmetry costs nothing: the eigenvalues become real, the eigenvectors orthonormal, the inverse a transpose, and the existence question disappears entirely. That is why the symmetric case is worth recognising before any computation begins, and why so many algorithms go out of their way to produce symmetric matrices.
Matrix Exponential
For a diagonalizable matrix, the matrix exponential eAt — central to solving x′=Ax — has an explicit form:
The exponential of a diagonal matrix is the diagonal matrix of exponentials. The full matrix exponential is computed from n scalar exponentials, one per eigenvalue.
The solution to x′=Ax with initial condition x(0)=x0 is then x(t)=eAtx0. This is the matrix-level analogue of the scalar solution x(t)=eatx0 to x′=ax.
When A has complex eigenvalues a±bi, the exponentials e(a±bi)t=eat(cosbt±isinbt) combine in conjugate pairs to produce real oscillatory terms eatcosbt and eatsinbt in the final solution.
Problem
Diagonalized form
Closed-form solution
Matrix power Ak
P · diag(λ1k, …, λnk) · P−1
one inversion + two multiplications, independent of k
When a matrix is not diagonalizable — when some eigenvalue has geometric multiplicity strictly less than its algebraic multiplicity — the best achievable form under similarity is the Jordan normal form.
The Jordan form is block diagonal, with each block a Jordan block:
When Diagonalization Fails
Jk(λ)=λ0⋮001λ01⋱⋯⋯⋱λ00⋮1λ
Fact: A millionth makes the shear diagonalizable
Change the corner entry of (1011) to 1.000001 and the two eigenvalues become distinct, so the matrix diagonalizes. Its eigenvectors (1,0) and (1,0.000001) are then almost parallel: the missing eigenvector returns as a near copy of the first.
A k×k Jordan block has the eigenvalue λ on the diagonal and ones on the superdiagonal. A diagonalizable eigenvalue contributes 1×1 Jordan blocks. A defective eigenvalue contributes blocks larger than 1×1.
The smallest defective matrix is the single block J2(1)=(1011), the horizontal shear. It slides each point sideways by its height, so the horizontal axis is the only line that keeps its direction, and the repeated eigenvalue 1 has just one eigenvector, (1,0).
THEOREM
The Jordan form is unique up to the ordering of blocks and is the canonical representative of the similarity class.
Powers and exponentials of Jordan blocks can still be computed explicitly, but the formulas involve polynomial correction terms (tkeλt instead of just eλt) reflecting the defective structure. The full Jordan theory belongs to advanced linear algebra.
Too few independent eigenvectors to fill P
There are not enough independent eigenvectors to make up the columns of P, so P cannot be inverted and the factorisation never forms. Diagonalisation fails for this reason alone — never because the eigenvalues were awkward, only because the directions ran out. See which matrices hit this wall on the diagonalization visualizer.
The Jordan form exists precisely to give these matrices a canonical shape when a diagonal one is out of reach.
Diagonalizability at a Glance
Several quick tests determine or suggest diagonalizability.
A matrix with n distinct eigenvalues is always diagonalizable — distinctness forces independence of eigenvectors.
A real symmetric matrix is always diagonalizable, and orthogonally so. This is the spectral theorem.
A matrix satisfying mg(λ)=ma(λ) for every eigenvalue is diagonalizable. This is the definitive necessary and sufficient condition.
A matrix with any eigenvalue where mg<ma is not diagonalizable. The shortfall means there are not enough eigenvectors to form a basis.
Matrices that are already diagonal are trivially diagonalizable (P=I). The identity matrix, all scalar matrices cI, and all diagonal matrices fall here.
The zero matrix is diagonalizable (it is already diagonal with all eigenvalues zero). A nilpotent matrix is diagonalizable if and only if it is the zero matrix — any other nilpotent matrix is defective.
The rows below are not six independent facts. One of them — the multiplicity comparison — decides the question completely, and the group above it collects the cases where the answer can be seen without doing that work. Reading the middle group as the definition and the others as shortcuts is what keeps the sufficient conditions from being mistaken for necessary ones.
One condition decides it and everything else is a shortcut to checking that condition. The multiplicity test is necessary and sufficient; the rows above it are sufficient only, and the rows below are what failure looks like.
6cases
Sufficient — settles it without computing eigenvectors3
Eigenvectors for distinct eigenvalues are automatically independent, so n of them form a basis. The converse fails and the failure is common — the identity matrix has one eigenvalue repeated n times and diagonalizes trivially.
The spectral theorem. Symmetry guarantees not only diagonalizability but an orthonormal eigenvector basis, so P−1 is PT and nothing needs inverting. No computation required to know it applies.
Degenerate but worth stating, because it is the counterexample to distinctness being necessary. A scalar matrix cI has one eigenvalue of multiplicity n and every vector is an eigenvector.
Geometric multiplicity is dimNull(A−λI), algebraic is the root multiplicity in the characteristic polynomial. Geometric never exceeds algebraic, so the test is whether any eigenvalue falls short — and one shortfall is enough to fail.
Not enough independent eigenvectors to form a basis, so no P exists. The Jordan form is the substitute — as close to diagonal as the matrix permits, with ones on the superdiagonal recording exactly how many eigenvectors are missing.
Every eigenvalue is zero, so a diagonalization would force D=O and hence A=PDP−1=O. The zero matrix is the only diagonalizable nilpotent — which makes shears and other nilpotent-plus-identity matrices the standard examples of defectiveness.
Everything reduces to counting eigenvectors. A matrix diagonalizes exactly when it has n independent ones, and the multiplicity comparison is that count performed eigenvalue by eigenvalue. The shortcuts are worth knowing because they settle the common cases without computing a single eigenvector.
That distinction is where the usual error lives. Distinct eigenvalues guarantee diagonalizability, and it is tempting to read the guarantee backwards — but the identity matrix has a single eigenvalue repeated n times and diagonalizes trivially, since every vector is an eigenvector. Repetition is not the problem; a repeated eigenvalue whose eigenspace is smaller than its multiplicity is.
When the test fails there is nothing to compute a way around, because the eigenvectors genuinely are not there. The Jordan form is what replaces diagonalization in that case: block diagonal rather than diagonal, with ones on the superdiagonal counting precisely how many eigenvectors each eigenvalue is missing. A nonzero nilpotent matrix is the extreme case — every eigenvalue is zero, so diagonalizing it would force the matrix itself to be zero.
Common Pitfalls
Five mistakes account for many wrong answers when a matrix is diagonalized and the factorization is put to use. Four are marked with a box where they happen in the sections above, and the first, the order of the columns, is flagged in the construction section. Here each is worked through in full, with the wrong and the right working side by side.
Mismatching the order of P and D
The eigenvectors are placed in P in one order and the eigenvalues in D in another, so column j of P no longer belongs to the j-th diagonal entry of D. The product PDP−1 is still defined, but it is a different matrix.
Wrong working: for A=(1423) from section 2, keep P=(12−11), whose first column belongs to λ=5, but write the eigenvalues in the other order:
P(−1005)P−1=(3−4−21)=A
Right working: the first diagonal entry is the eigenvalue of the first column.
P(500−1)P−1=(1423)=A
Why it happens: the order of the eigenvalues is a free choice, so it feels as if any order will do. The freedom is real, but the same order has to be used in P and in D, and nothing in the letters PDP−1 shows whether it was.
How to check: compare AP with PD column by column. Here AP=(5101−1), while the mismatched PD=(−1−2−55). The trace and the determinant do not catch this slip: the wrong product still has trace 4 and determinant −5, the same as A.
Treating a repeated eigenvalue as failure
The characteristic polynomial has a repeated root, so the distinct-eigenvalue test does not apply, and the matrix is declared not diagonalizable without the eigenspace being computed.
Wrong working: A=311131113 has eigenvalues 5,2,2. Since 2 is a double root, A has only two distinct eigenvalues for a 3×3 matrix, and the conclusion drawn is that A is defective.
Right working: A−2I is the matrix with every entry 1, of rank 1, so the eigenspace of λ=2 has dimension 3−1=2, spanned by (1,−1,0)T and (1,0,−1)T. With (1,1,1)T for λ=5,
P=1111−1010−1,D=500020002
and AP=PD=5552−2020−2, with det(P)=3=0. The matrix is diagonalizable.
Why it happens: the sufficient condition, distinct eigenvalues, is read as if it were also necessary, and the standard example of failure, (2012), happens to have a repeated eigenvalue.
How to check: for every repeated eigenvalue, compute n−rank(A−λI) and compare it with the multiplicity. A real symmetric matrix, like this A, never needs the check: by the spectral theorem it is always diagonalizable.
Powering the entries of A
Once Dk has been found by raising each diagonal entry to the k-th power, the same shortcut is applied to A itself, and every entry of A is raised to the k-th power.
Wrong working:
A4=(14442434)=(12561681)
Right working: power only the diagonal factor.
A4=P(625001)P−1=(209416208417)
Why it happens: for a diagonal matrix the entrywise power and the matrix power are the same thing, and the examples used to introduce powers are often diagonal. For any other matrix, the off-diagonal entries mix in every product.
How to check: the trace of Ak is 5k+(−1)k and the determinant is (−5)k. For k=4 these are 626 and 625. The entrywise answer has trace 82 and determinant 81−4096=−4015.
Reading the constants off the initial vector
In the solution of x′=Ax, the constants c1,…,cn are taken to be the entries of x(0), instead of the coefficients of x(0) in the eigenvector basis.
Wrong working: with A from section 2 and x(0)=(1,0)T, take c1=1 and c2=0:
x(t)=e5t(12),x(0)=(12)=(10)
Right working: solve c1(1,2)T+c2(−1,1)T=(1,0)T, that is c1−c2=1 and 2c1+c2=0. Adding the equations gives 3c1=1, so c1=31 and c2=−32:
x(t)=31e5t(12)−32e−t(−11)
Why it happens: in the standard basis the coordinates of a vector are its entries, so reading them off is a habit. In the eigenvector basis the coordinates have to be computed, as c=P−1x(0).
How to check: put t=0 into the solution. The right one gives 31(1,2)T−32(−1,1)T=(1,0)T; the wrong one gives (1,2)T.
Skipping the normalization
For a symmetric matrix, the eigenvectors are placed in Q as they come out of row reduction, and QT is then used as the inverse. The transpose is the inverse only when the columns are unit vectors.
Wrong working: A=(2112) has eigenvalues 3 and 1 with eigenvectors (1,1)T and (1,−1)T. With these as columns,
Right working: divide each eigenvector by its length 2. Then q1q1T=21(1111), q2q2T=21(1−1−11), and
3q1q1T+1q2q2T=(2112)=A
Why it happens: with P−1, the length of each eigenvector does not matter, because scaling a column of P is undone by P−1. Using QT in place of the inverse removes that protection.
How to check: compute QTQ before using QT. It must be I; here the unnormalized Q gives 2I, which is why the result came out as 2A.
Diagonalization FAQ
Is PDP−1 the same as P−1DP?
+
No, they are different matrices, and swapping them inverts the change of basis. The error is easy to miss because both read as "P and its inverse wrapped around a diagonal", so the shape looks right at a glance. Keep the roles straight: A=PDP−1 builds A, while P−1AP=D simplifies it.Read more →
Do the eigenvalues in D have to be in order?
+
No convention forces any ordering. Permuting the eigenvalues along the diagonal is fine so long as the columns of P are permuted to match, which is why the factorisation is not unique and "the" diagonalisation is a loose phrase. Singular values in an SVD do carry a built-in ordering, but eigenvalues here do not.Read more →
Does a repeated eigenvalue make a matrix defective?
+
Not by itself. Repetition is necessary but nowhere near sufficient: the identity matrix repeats an eigenvalue n times and is already diagonal. What defeats the construction is a gap between algebraic and geometric multiplicity, meaning too few independent eigenvectors. Note that defective never means singular or ill-conditioned; such a matrix can be perfectly invertible.Read more →