A square matrix is called diagonal if the only possibly nonzero entries are on the main diagonal:
D=d110⋱0dnn.
Diagonal matrices are very easy to compute with. For example the product of two diagonal matrices is obtained by multiplying the diagonal entries one by one:
This clearly goes wrong for products of general matrices. Eigenvalues and eigenvectors make it possible, in certain cases, to reduce computations with a general matrix to computations with a diagonal one. (Coupled with numerical considerations they were used, for instance, in the early PageRank algorithm.)
2. Definitions
Definition (eigenvalue, eigenvector). Let A be a square n×n matrix. A real number λ is an eigenvalue of A if there exists a nonzero vector v∈Rn with
Av=λv.
Such a v is called an eigenvector for the eigenvalue λ. In words: multiplying A by v gives a scaled copy of v, the scaling factor being λ.
Likewise, for a linear map f:V→V, a number λ is an eigenvalue if there is v∈V, v=0, with f(v)=λv.
The condition v=0 is essential: A⋅0=λ⋅0 holds for every λ, so without it every number would be an "eigenvalue".
Example (reflection). Let f:R2→R2 be the reflection along the x-axis, f(x,y)=(x,−y). The equation f(v)=λv reads (x,−y)=(λx,λy), i.e. x=λx and −y=λy.
The first equation holds if x=0 (λ arbitrary) or if λ=1 (x arbitrary).
The second holds if y=0 (λ arbitrary) or if λ=−1 (y arbitrary).
By definition (x,y)=(0,0). If x=0 then λ=1, which forces y=0. If x=0 then y=0 and therefore λ=−1.
So there are two eigenvalues: λ=1 with eigenvectors (x,0), x=0, and λ=−1 with eigenvectors (0,y), y=0.
Key observation. For an n×n matrix A the equation Av=λv can be rewritten as
0=Av−λv=Av−(λid)v=(A−λid)v
(standard properties of matrix multiplication). A nonzero v with this property exists if and only if A−λid is not invertible, i.e. if and only if det(A−λid)=0.
Example (shear). Let A=(10r1) with r=0 (for r=0 we get A=id). Then
A−λid=(1−λ0r1−λ),det(A−λid)=(1−λ)2.
This vanishes exactly for λ=1, which is therefore the only eigenvalue. The eigenvectors are the solutions of (A−1⋅id)(xy)=(00r0)(xy)=(ry0)=0. Since r=0 this means y=0 with x arbitrary: the eigenvectors are (x0), x=0.
3. The characteristic polynomial
Definition and Lemma. For A∈Matn×n, the function
χA(t)=det(A−t⋅idn)
is a polynomial of degree n, called the characteristic polynomial of A. A real number λ is an eigenvalue of A if and only if χA(λ)=0.
(The second statement is exactly the key observation above: λ is an eigenvalue ⟺A−λid is not invertible ⟺det(A−λid)=0.) For the shear, χ(t)=(t−1)2.
The multiplicity of λ as a root of χA is called its algebraic multiplicity.
Triangular matrices. For an upper (or lower) triangular matrix the determinant of A−tid is the product of the diagonal entries (aii−t), so the eigenvalues are exactly the diagonal entries.
Example. For A=(2−41−3):
χA(t)=det(2−t−41−3−t)=(2−t)(−3−t)+4=t2+t−2.
Solving χA(t)=0: t1/2=−21±41+2=−21±23, so the eigenvalues are t1=−2 and t2=1.
where tr(A)=a+d is the trace (sum of the diagonal entries). By the quadratic formula
λ1/2=2a+d±4(a−d)2+bc.
(Indeed (2a+d)2−(ad−bc)=4(a−d)2+bc.)
3.1 Rotations: no real eigenvalues, complex ones
Example (rotation). Let A=(cosθsinθ−sinθcosθ).
If θ is a multiple of 2π (no rotation), A=id2: the only eigenvalue is 1 and every vector of R2 is an eigenvector.
If θ is an odd multiple of π (rotation by 180∘), A=−id2: the only eigenvalue is −1 and every vector is an eigenvector.
In all other cases there are no eigenvalues.
Geometrically this is clear: for a rotation other than these, for every v the rotated vector Av lies on a different line through the origin, so it cannot be a multiple of v. Algebraically:
χ(t)=(cosθ−t)2+sin2θ=t2−2tcosθ+1,t=cosθ±cos2θ−1.
We have −1≤cosθ≤1 with cos2θ=1 if and only if θ is a multiple of π; otherwise the radicand is strictly negative and χ(t)=0 has no real solution.
The non-existence of eigenvalues is cured by working with complex numbers.
Theorem (Fundamental theorem of algebra). Every non-constant polynomial p(t)=antn+⋯+a0 with complex (in particular, real) coefficients has a zero z∈C, p(z)=0.
Example. The rotation by 90∘ counter-clockwise, A=(01−10), has χA(t)=1+t2, which has no real zero. But i (with i2=−1) is a complex zero, and so is −i (since (−i)2=−1).
It is therefore useful to consider linear algebra over C: all the concepts and theorems of the course continue to hold for complex matrices and complex vector spaces.
Corollary. Every complex square matrix has at least one (complex) eigenvalue. In particular every real square matrix has at least one complex eigenvalue (though maybe no real one).
4. Eigenspaces
Definition and Lemma. Let A∈Matn×n and λ∈R. The set
Eλ={v∈Rn∣Av=λv}
is a subspace of Rn, the eigenspace of A for λ.
Proof. The equation Av=λv is equivalent to (A−λid)v=0, so Eλ=ker(A−λid), and a kernel is a subspace. □
Remark. If λ is not an eigenvalue, Eλ={0}. If λ is an eigenvalue, Eλ consists of all eigenvectors for λ together with the zero vector (which by definition is not an eigenvector).
Example. Take A=(0210). Then χA(t)=det(−t21−t)=t2−2, with zeros λ1/2=±2.
Eigenspace for 2. Solve (A−2id)(xy)=0. Row reduction of B=(−221−2):
(−221−2)⇝(12−22−2)⇝(10−220).
So y is free and x=22y: E2 has dimension 1 with basis vector (22,1).
Eigenspace for −2. Similarly B=A+2id⇝(10220), so E−2 is again one-dimensional with basis vector (−22,1).
The map v↦Av stretches the vectors of E2 by the factor 2, while those of E−2 are flipped and stretched by the factor 2.
y
| / E_(sqrt2): line through (sqrt2/2, 1)
\ | /
\ | /
\ | /
-----\--+/-------- x
\ |
\|
E_(-sqrt2): line through (-sqrt2/2, 1)
5. Diagonalizing matrices
Definition. A square matrix A is diagonalizable if there is an invertible matrix P∈Matn×n such that PAP−1=D is a diagonal matrix.
(Equivalently, with Q=P−1: Q−1AQ=D. The columns of Q turn out to be eigenvectors, see Lemma below; this is the matrix that Method 1 below calls the matrix of eigenvectors. Below, whenever the columns of a matrix are eigenvectors, we write that matrix Q and the relation as Q−1AQ=D.)
Why it matters. In differential equations one needs the exponential of a square matrix,
expA=id+A+2A2+6A3+24A4+…
If A is diagonalizable, PAP−1=D, then A=(P−1P)A(P−1P)=P−1(PAP−1)P=P−1DP, and so
A2=P−1DPP−1DP=P−1D2P,A3=P−1D3P,…
Computing powers of D is easy: just raise each diagonal entry to the power. So one never needs to compute the powers of A one after another.
Method 1 (diagonalizing A∈Matn×n).
Compute the eigenvalues λ1,…,λk of A, e.g. as the zeros of the characteristic polynomial, and the eigenspaces Eλ1,…,Eλk.
A is diagonalizable precisely ifi=1∑kdimEλi=n,
i.e. if the dimensions of the eigenspaces add up to the size of the matrix.
In that case take as matrix Q the n×n matrix whose columns are the basis vectors of all the eigenspaces. The diagonal matrix D has on the diagonal λ1 repeated dimEλ1 times, ..., λk repeated dimEλk times (in the same order as the columns of Q), and Q−1AQ=D.
Why k≤n. The sum of the subspaces Eλ1,…,Eλk is a direct sum (eigenvectors of distinct eigenvalues are linearly independent), so
An n×n matrix therefore has at most n distinct eigenvalues, and this gives:
Corollary. If an n×n matrix has n distinct eigenvalues, then it is diagonalizable. (Then each eigenspace has dimension at least 1, and the sum of the n dimensions is ≥n, hence =n.)
The converse is false: idn is diagonal but has the single eigenvalue 1.
A fact used in the exercises: 1≤dimEλ≤ (algebraic multiplicity of λ) for every eigenvalue λ. So an eigenvalue of algebraic multiplicity 1 automatically has a one-dimensional eigenspace, and an eigenvalue of algebraic multiplicity m can only fail to contribute m to the sum if its eigenspace is smaller.
Definition (eigenbasis). A basis v1,…,vn of Rn is an eigenbasis for A if every vi is an eigenvector of A (for some eigenvalue).
Lemma. For A∈Matn×n the following are equivalent: (1) A is diagonalizable; (2) A admits an eigenbasis of Rn.
Proof idea. If Q−1AQ=D is diagonal, then AQ=QD; the i-th column of this equation says Aqi=diiqi, where qi is the i-th column of Q. Since Q is invertible, its columns form a basis, consisting of eigenvectors. Conversely, if q1,…,qn is an eigenbasis with Aqi=μiqi, put Q=(q1…qn); then AQ=QD with D=diag(μ1,…,μn), so Q−1AQ=D. In other words, the matrix relating the standard basis and an eigenbasis is a base-change matrix, and in the eigenbasis the linear map v↦Av has the diagonal matrix D. □
5.1 Examples
Example (diagonalizable with distinct eigenvalues).A=(0210) has two distinct eigenvalues ±2, so it is diagonalizable. An eigenbasis is v1=(22,1), v2=(−22,1), and with Q=(221−221) one gets Q−1AQ=(200−2).
Example (shear: not diagonalizable).A=(1011) has χA(t)=(1−t)2, so λ=1 is the only eigenvalue. With B=A−id=(0010), the system Bv=(y0)=0 gives
E1={v∈R2∣Bv=0}={(x,0)∣x∈R},
of dimension 1 with basis (1,0). Since 1<2, A is not diagonalizable: here the eigenvalue has algebraic multiplicity 2 but its eigenspace has dimension only 1.
Example (rotation by 90 degrees, over C).A=(01−10) has the complex eigenvalues λ1=i, λ2=−i, two distinct ones, so it is diagonalizable over C. Regard A as a complex matrix.
The second equation gives z1=iz2; the first is then also satisfied, since −iz1−z2=−i(iz2)−z2=z2−z2=0. Hence Ei={(iz,z)∣z∈C}, a one-dimensional complex vector space with basis (i,1). Similarly A+iid=(i1−1i) gives z1=−iz2, E−i={(−iz,z)∣z∈C} with basis (−i,1). The matrix of eigenvectors is Q=(i1−i1) and Q−1AQ=(i00−i).
Example (a diagonal matrix). For A=(1000), λ=0 is an eigenvalue with eigenvector (01) and λ=1 is an eigenvalue with eigenvector (10).
Example (nilpotent matrix).A=000100010 is upper triangular, so the only eigenvalue is 0, with χA(t)=(−t)3. Since A(x,y,z)T=(y,z,0)T, we get E0=kerA={(x,0,0)}, of dimension 1<3: not diagonalizable.
6. Similar matrices
Definition. Two square matrices A,B∈Matn×n are similar if there is an invertible P with PAP−1=B.
Asking whether A is diagonalizable is the special case "is A similar to a diagonal matrix?" of the question "are A and B similar?". Two matrices are similar exactly when they represent the same linear map Rn→Rn with respect to different bases.
Proposition. If A and B are similar, then:
detA=detB;
trA=trB;
χA(t)=χB(t);
A and B have the same eigenvalues, and if B=PAP−1 then Eλ(B)=P(Eλ(A)) for every λ.
Proof. Let B=PAP−1 with P invertible.
Determinant (multiplicativity of det): detB=det(PAP−1)=detPdetAdet(P−1)=detA.
Trace: using tr(XY)=tr(YX) for square matrices, tr(B)=tr(P(AP−1))=tr((AP−1)P)=tr(A).
Characteristic polynomial: χB(t)=det(PAP−1−tid)=det(P(A−tid)P−1)=detPdet(A−tid)det(P−1)=χA(t). Hence the eigenvalues, being the zeros of χ, coincide.
Eigenspaces: let λ∈R. If v∈Eλ(A), then Av=λv, so B(Pv)=PAP−1Pv=PAv=λPv, hence Pv∈Eλ(B); thus P(Eλ(A))⊆Eλ(B). Conversely, if w∈Eλ(B) then Bw=λw and multiplying by P−1 gives A(P−1w)=λ(P−1w), so P−1w∈Eλ(A), i.e. w∈P(Eλ(A)). □
In particular, similar matrices have eigenspaces of the same dimensions, and a matrix similar to a diagonalizable matrix is diagonalizable.
Remark (the converse fails). Equality of det, trace, χ and eigenvalues does not imply similarity. The 4×4 matrices
A=0000100001000000,B=0000100000000010
both have 0 as their only eigenvalue, and E0(A), E0(B) are both 2-dimensional. But A2=0 (it has the entry 1 in position (1,3)) while B2=0. If B=PAP−1 then B2=PAP−1PAP−1=PA2P−1, so B2=0 would force A2=0: a contradiction. A sufficient condition for similarity is given by the Jordan normal form, not discussed here.
7. Worked examples
Example 1 (two distinct eigenvalues).A=(315−1).
χA(t)=(3−t)(−1−t)−5=t2−2t−8=(t−4)(t+2).
Eigenvalues 4 and −2; being distinct, A is diagonalizable. For λ=4: A−4id=(−115−5)⇝x=5y, so E4=L((5,1)). For λ=−2: A+2id=(5151)⇝x=−y, so E−2=L((1,−1)). An eigenbasis is (5,1),(1,−1); check: A(5,1)T=(20,4)T=4(5,1)T and A(1,−1)T=(−2,2)T=−2(1,−1)T.
Example 2 (a map specified by eigenvectors). Let f:R3→R3 be linear with f(1,0,1)=(2,0,2), kerf=L((1,1,1)) and f(2,0,3)=(2,0,3). Compute its matrix in the standard basis.
From kerf=L((1,1,1)) we get f(1,1,1)=0=0⋅(1,1,1). Hence we have three eigenvectors:
They form a basis of R3 (the matrix with these columns has determinant −1=0), i.e. an eigenbasis. The matrix of f in the basis v1,v2,v3 is D=diag(2,1,0). To get the matrix in the standard basis, let K′ be the matrix whose columns are v1,v2,v3 (it expresses the vi in standard coordinates):
K′=101203111,(K′)−1=3−10−101−210,
[f]std=K′D(K′)−1=403−20−2−20−1.
Check: this matrix sends (1,0,1)↦(2,0,2), (2,0,3)↦(2,0,3), (1,1,1)↦(0,0,0). This is a typical situation: one basis (here an eigenbasis) is better adapted to the map than another and gives a particularly simple matrix.
Example 3 (parameter in the matrix). For which a∈R is
Aa=aa−20011011
diagonalizable? Expanding along the first row,
χAa(t)=(a−t)det(1−t111−t)=(a−t)((1−t)2−1)=(a−t)t(t−2),
so the eigenvalues are a, 0, 2.
If a=0,2: three distinct eigenvalues, so Aa is diagonalizable.
If a=0: A0=0−20011011 and 0 has algebraic multiplicity 2. Solving A0v=0: −2x+y+z=0 and y+z=0, so x=0, y=−z and E0=L((0,1,−1)) has dimension 1<2. Not diagonalizable.
If a=2: A2=200011011 and 2 has multiplicity 2. A2−2id=0000−1101−1 gives y=z, x free: E2=L((1,0,0),(0,1,1)), dimension 2. Also E0=L((0,1,−1)), dimension 1. The sum is 3, so A2 is diagonalizable.
Conclusion: Aa is diagonalizable precisely if a=0.
Example 4 (a parameter that does not change the eigenvalues).Aa=4a2020−4a−2. Developing det(Aa−tid) along the second column (which has two zeros):
The eigenvalues are 2 (algebraic multiplicity 2) and 0 (multiplicity 1), for every a. Hence dimE0=1 and 1≤dimE2≤2, and Aa is diagonalizable precisely if dimE2=2, i.e. if Aa−2id has rank 1. Row reduction:
Aa−2id=2a2000−4a−4⇝100000−23a0,
which has rank 1 if and only if a=0. So Aa is diagonalizable precisely for a=0. For a=0: A=402020−40−2, E2=L((2,0,1),(0,1,0)), E0=L((1,0,1)), and with
Q=201010101Q−1AQ=200020000.
Example 5 (when 0 is an eigenvalue). For At=12t202t21, 0 is an eigenvalue exactly when detAt=0 (since χ(0)=detA). Expanding along the first row,
Example 6 (non-similar to A2). If A has an eigenvalue λ then A2 has the eigenvalue λ2 (A2v=A(λv)=λ2v). Since similar matrices have the same eigenvalues, if A has eigenvalues 1,2 then A2 has the eigenvalue 4, which is not an eigenvalue of A; hence A is not similar to A2. Likewise similar matrices have equal determinants: if detA=−2 then detA2=4=detA, so A is not similar to A2.
Versione ripasso
Definitions.
Eigenvalue λ of a square A: there is v=0 with Av=λv; v is an eigenvector. Equivalent: A−λid not invertible, det(A−λid)=0.
Characteristic polynomial χA(t)=det(A−tidn), degree n. Eigenvalues are its real zeros. For 2×2: χA(t)=t2−tr(A)t+detA. For triangular matrices the eigenvalues are the diagonal entries.
Eigenspace Eλ=ker(A−λid), a subspace; Eλ={0} if λ is not an eigenvalue.
Over C every square matrix has at least one eigenvalue (fundamental theorem of algebraevery non-constant complex polynomial has a complex zero). A rotation of R2 by an angle that is not a multiple of π has no real eigenvalue (χ=t2−2tcosθ+1); the 90∘ rotation has ±i.
Diagonalization.
A diagonalizable ⟺ there is an invertible P with PAP−1=D diagonal ⟺Rn has an eigenbasis for A.
Method: find the eigenvalues λ1,…,λk; A is diagonalizable ⟺∑idimEλi=n. Put a basis of each eigenspace as columns of Q; then Q−1AQ=D, with λi repeated dimEλi times.
n distinct eigenvalues ⇒ diagonalizable (the converse is false, e.g. id).
1≤dimEλ≤ algebraic multiplicity of λ. Obstruction to diagonalizability: an eigenvalue whose eigenspace is smaller than its algebraic multiplicity (shear (1011): E1 has dimension 1<2).
Payoff: A=P−1DP⇒Ak=P−1DkP and expA=P−1(expD)P.
Similar matrices (B=PAP−1). Same det, trace, χ, eigenvalues; Eλ(B)=P(Eλ(A)), so same eigenspace dimensions. Proof: multiplicativity of det, tr(XY)=tr(YX), χB=det(P(A−tid)P−1). The converse fails (two 4×4 nilpotent matrices with A2=0, B2=0). To show two matrices are not similar: compare det, χ, eigenspace dimensions, powers.
Typical mistakes.
Allowing v=0 as an eigenvector, or forgetting the zero vector belongs to Eλ.
Concluding "diagonalizable" from equal χ (needs the eigenspace dimensions), or "not diagonalizable" just because an eigenvalue is repeated.
Wrong sign in A−tid when computing χA.
Using real eigenvalues for a matrix like a rotation (they may only exist over C).
Mixing PAP−1=D with eigenvectors as columns of P: the eigenvector matrix is Q=P−1, and Q−1AQ=D.