Skip to content
AI360Xpert
Beta

Matrix Diagonalization

Most square matrices act like simple scalings once you look along their eigenvector axes; diagonalization is the change of view that reveals it.

The matrix with eigenvalues 5 and 2 stretches its eigenvector grid lines by exactly 5 and 2: in the eigenvector view the same map is just a diagonal scaling with no mixing between axes
The matrix with eigenvalues 5 and 2 stretches its eigenvector grid lines by exactly 5 and 2: in the eigenvector view the same map is just a diagonal scaling with no mixing between axes

Why Does This Exist?

Matrix powers show up in Markov chains, recurrences, and repeated layer applications, and multiplying a matrix by itself 100 times is brutal. But a diagonal matrix powers trivially: square each diagonal entry and you are done. Diagonalization converts the hard problem into the easy one by viewing the matrix along its natural axes, and it explains why eigenvalues govern long-run behavior everywhere from PageRank to stability analysis.

Eigenvalues and eigenvectors finds the special axes and stretch factors. This page assembles them into the decomposition and shows the payoff.

The one idea you need first

An eigenvector vv of AA keeps its direction under AA: Av=λvAv = \lambda v for some stretch factor λ\lambda, the eigenvalue. If you can find nn independent eigenvectors for an n×nn \times n matrix, you have a full alternative coordinate system to work in.

Think of It Like This

A funhouse mirror measured along its own axes

A funhouse mirror stretches your reflection oddly: taller and thinner at once. Measured against the room's walls, the stretch mixes vertical and horizontal in a confusing matrix. But measure along the mirror's own tilt, its personal up and sideways, and the map is dead simple: double along one axis, halve along the other, no mixing.

Diagonalization finds the mirror's personal axes (eigenvectors) and reads off the plain scalings (eigenvalues). The mirror never changed; you stopped describing a tilted stretch in an untilted language.

How It Actually Works

If AA has nn independent eigenvectors, stack them as columns of PP and the eigenvalues into a diagonal DD. Then:

A=PDP−1A = PDP^{-1}

In plain words: P−1P^{-1} converts into the eigenvector view, DD scales each axis independently, and PP converts back. Powers collapse beautifully: Ak=PDkP−1A^k = PD^kP^{-1}, and DkD^k just raises each diagonal entry to kk.

Worked example

A=[41 23]A = \begin{bmatrix} 4 & 1 \ 2 & 3 \end{bmatrix}

Trace =7= 7, determinant =12−2=10= 12 - 2 = 10. Eigenvalues solve λ2−7λ+10=0\lambda^2 - 7\lambda + 10 = 0, giving λ=5\lambda = 5 and λ=2\lambda = 2. Check: 5+2=75 + 2 = 7 (trace) and 5×2=105 \times 2 = 10 (determinant).

Eigenvectors: for λ=5\lambda = 5, A−5I=[−11 2−2]A - 5I = \begin{bmatrix} -1 & 1 \ 2 & -2 \end{bmatrix}, so v1=[1,1]v_1 = [1, 1]. Check: A[1,1]=[5,5]=5[1,1]A[1,1] = [5, 5] = 5[1,1]. For λ=2\lambda = 2, A−2I=[21 21]A - 2I = \begin{bmatrix} 2 & 1 \ 2 & 1 \end{bmatrix}, so v2=[1,−2]v_2 = [1, -2]. Check: A[1,−2]=[2,−4]=2[1,−2]A[1,-2] = [2, -4] = 2[1,-2].

So P=[11 1−2]P = \begin{bmatrix} 1 & 1 \ 1 & -2 \end{bmatrix} and D=[50 02]D = \begin{bmatrix} 5 & 0 \ 0 & 2 \end{bmatrix}, with A=PDP−1A = PDP^{-1}. The tenth power A10=PD10P−1A^{10} = PD^{10}P^{-1} needs only 5105^{10} and 2102^{10}, no repeated multiplication.

Watch Out For

Assuming every matrix diagonalizes

Some matrices are defective: they lack enough independent eigenvectors. The classic case [11 01]\begin{bmatrix} 1 & 1 \ 0 & 1 \end{bmatrix} has eigenvalue 1 twice but only one eigenvector direction, so no PP exists. The symptom is an "inverse" step that explodes because PP came out singular. Check that PP is invertible before celebrating, and know that symmetric matrices always diagonalize, which is one more reason to love them.

Assuming eigenvectors come out perpendicular

Only symmetric matrices guarantee perpendicular eigenvectors. For general matrices the eigenvector grid is a slanted lattice, and treating it as a rotation corrupts every projection. The symptom is coordinates computed with a transpose where an inverse belongs. Unless symmetry is proven, always use P−1P^{-1}, never PTP^T, to change into the eigenbasis.

The Quick Version

  • A=PDP−1A = PDP^{-1}: eigenvectors as columns of PP, eigenvalues on the diagonal of DD.
  • In the eigenbasis the map is pure per-axis scaling with no mixing.
  • Powers collapse: Ak=PDkP−1A^k = PD^kP^{-1}, and DkD^k raises diagonal entries only.
  • The example matrix has eigenvalues 5 and 2 with eigenvectors [1,1][1,1] and [1,−2][1,-2].
  • Defective matrices cannot diagonalize, so verify PP is invertible.
  • Without symmetry, change basis with P−1P^{-1}, never PTP^T.