Eigenvalues & eigenvectors
Define eigenpairs, find them through the characteristic polynomial, and interpret them as invariant scaling directions.
Most vectors, when multiplied by a matrix, change direction. An eigenvector is a direction that a matrix leaves alone, only stretching or flipping it. Finding these invariant directions reveals the intrinsic geometry of the transformation.
Definition
A nonzero vector is an eigenvector of with eigenvalue (or ) if[1]
The vector is mapped to a scalar multiple of itself: it stays on its own line. The scalar may be positive (same direction), negative (flipped), zero (collapsed), or complex.
The pair is called an eigenpair. Eigenvectors are not unique: any nonzero multiple of an eigenvector is again an eigenvector for the same (since ). The eigenspace is the set of all eigenvectors for , together with .
Finding eigenvalues: the characteristic polynomial
Rewrite as . A nonzero solution exists if and only if is singular, which by the previous lesson means
Expanding the determinant in the variable yields the characteristic polynomial , a polynomial of degree in . Its roots are the eigenvalues[2]. By the fundamental theorem of algebra, counting complex roots with multiplicity, there are exactly roots.
Two useful facts
Trace and determinant.
The trace is the sum of diagonal entries. These follow from expanding and comparing coefficients at the leading and constant terms.
Eigenvalues of triangular matrices. If is upper (or lower) triangular, is also triangular, and its determinant is the product of diagonal entries . So the eigenvalues are exactly the diagonal entries.
Algebraic vs. geometric multiplicity
The algebraic multiplicity of is its multiplicity as a root of the characteristic polynomial. The geometric multiplicity is . Geometric multiplicity is always algebraic multiplicity. When they are equal for every eigenvalue, the matrix is called diagonalizable (the next lesson proves this rigorously).
Complex eigenvalues for real matrices
A real matrix can have complex eigenvalues, always in conjugate pairs . For a rotation matrix
the characteristic polynomial is , whose roots are : pure rotation has no real invariant direction.
Check it on arrays
import numpy as np
A = np.array([[4.0, 1.0],
[2.0, 3.0]])
eigenvalues, eigenvectors = np.linalg.eig(A)
print("eigenvalues:", eigenvalues) # [5, 2]
print("eigenvectors (columns):\n", eigenvectors)
# Verify: A @ v == lambda * v for each pair
for i, lam in enumerate(eigenvalues):
v = eigenvectors[:, i]
print(f"A@v - lam*v = {np.round(A @ v - lam * v, 10)}") # ~zero
# Trace and det from eigenvalues
print("trace(A):", np.trace(A), "= sum of eigenvalues:", eigenvalues.sum())
print("det(A):", np.linalg.det(A), "= product of eigenvalues:", eigenvalues.prod())
# Triangular matrix: eigenvalues are the diagonal entries
T = np.array([[3.0, 5.0, 1.0],
[0.0, 7.0, 2.0],
[0.0, 0.0,-1.0]])
lams = np.linalg.eig(T)[0]
print("triangular eigenvalues:", np.sort(lams)[::-1], "diagonal:", [3, 7, -1])The residuals are near zero; trace and determinant match the eigenvalue sums and products.
Exercises
Exercise 1. Find the eigenvalues and a corresponding eigenvector for each, of , working entirely by hand.
Solution
Step 1. Form the characteristic polynomial :
Step 2. Expand: , so , giving and . (Check against trace and determinant: , and .)
Step 3. For , solve : the rows both read , so . For , solve : the rows read , so . The two eigenvectors are orthogonal, the symmetry of foreshadowing the spectral theorem.
Exercise 2. Prove that if is an eigenvalue of an invertible matrix , then is an eigenvalue of , with the same eigenvector.
Solution
Step 1. Start from the eigenpair relation with . Since is invertible, (a zero eigenvalue would mean a nonzero in , contradicting invertibility).
Step 2. Apply to both sides: , i.e. .
Step 3. Divide by : . So is an eigenvector of with eigenvalue .
Exercise 3 (code). A real matrix can have complex eigenvalues in conjugate pairs. Build the rotation matrix for , confirm its eigenvalues are , and check the trace/determinant relations hold over the complex eigenvalues.
Solution
import numpy as np
theta = np.deg2rad(30.0)
R = np.array([[np.cos(theta), -np.sin(theta)],
[np.sin(theta), np.cos(theta)]])
eigvals = np.linalg.eigvals(R)
expected = np.array([np.exp(1j * theta), np.exp(-1j * theta)])
# Eigenvalues are e^{+/- i theta} (order may differ, so compare sorted).
assert np.allclose(np.sort_complex(eigvals), np.sort_complex(expected))
# Trace = sum of eigenvalues, det = product (both real for a real matrix).
assert np.isclose(eigvals.sum().real, np.trace(R))
assert np.isclose(eigvals.prod().real, np.linalg.det(R))
print("eigenvalues:", np.round(eigvals, 4))The eigenvalues land on the unit circle at angle , their sum equals , and their product equals : a pure rotation scales nothing.
When a symmetric matrix enters the picture, its eigenvalues are always real and its eigenvectors always orthogonal: the spectral theorem, the subject of the next lesson.
References
- [1]Strang, G. (2016). Introduction to Linear Algebra (5th ed.). Wellesley-Cambridge Press. Eigenvalues, eigenvectors, and their geometric meaning.↩
- [2]Horn, R. A., & Johnson, C. R. (2012). Matrix Analysis (2nd ed.). Cambridge University Press. The characteristic polynomial, trace/determinant relations, and multiplicities.↩