S. Roy

Blog Post

Eigenvalues and Eigenvectors

Most vectors get rotated and scaled when multiplied by a matrix. Eigenvectors are the special directions that only get scaled — and their scaling factors, the eigenvalues, reveal everything about a matrix's long-term behavior.

Views: 7 min readCite

When you run PCA on a dataset, you get back a set of directions called principal components. These are the axes of greatest variance in your data. But where do they come from?

The answer: they are the eigenvectors of the covariance matrix. The variance along each direction is the corresponding eigenvalue.

This post builds that intuition from the ground up — starting with the definition and ending with why eigenvectors are everywhere in applied math.


The Core Idea

Multiply any random vector by a matrix, and in general two things happen: the vector gets scaled and rotated. The direction changes.

But some special vectors only get scaled — their direction is unchanged. These are eigenvectors.

Formally, a nonzero vector v\mathbf{v} is an eigenvector of matrix AA if:

Av=λvA\mathbf{v} = \lambda \mathbf{v}

The scalar λ\lambda is the corresponding eigenvalue. The matrix AA acts on v\mathbf{v} purely as multiplication by λ\lambda — a stretch or shrink (or flip, if λ<0\lambda < 0).

Try it with the visualizer below. Fan out vectors in all directions and watch where AA maps each one. The eigenvector directions (highlighted in gold) are the ones that stay on the same line through the origin after transformation.

Eigenvector directionMapped vector (Av)Matrix: [2, 0; 0, 0.5]λ₁ = 2.000λ₂ = 0.500

Move your cursor over the diagram — white vector is your direction, colored vector is where A maps it. Gold = eigenvector.


Finding Eigenvalues

We want to find all λ\lambda such that Av=λvA\mathbf{v} = \lambda\mathbf{v} has a nonzero solution v\mathbf{v}.

Rearrange:

Avλv=0A\mathbf{v} - \lambda\mathbf{v} = \mathbf{0} (AλI)v=0(A - \lambda I)\mathbf{v} = \mathbf{0}

For this to have a nonzero solution, AλIA - \lambda I must be singular (non-invertible). That happens exactly when its determinant is zero:

det(AλI)=0\det(A - \lambda I) = 0

This is the characteristic equation. Expanding it gives a polynomial in λ\lambda called the characteristic polynomial — its roots are the eigenvalues.

A 2×2 Example

Let A=(3102)A = \begin{pmatrix} 3 & 1 \\ 0 & 2 \end{pmatrix}.

AλI=(3λ102λ)A - \lambda I = \begin{pmatrix} 3 - \lambda & 1 \\ 0 & 2 - \lambda \end{pmatrix}

det(AλI)=(3λ)(2λ)(1)(0)=λ25λ+6\det(A - \lambda I) = (3 - \lambda)(2 - \lambda) - (1)(0) = \lambda^2 - 5\lambda + 6

Setting this to zero: (λ3)(λ2)=0(\lambda - 3)(\lambda - 2) = 0, giving λ1=3\lambda_1 = 3 and λ2=2\lambda_2 = 2.

For a general symmetric 2×2 matrix (abbd)\begin{pmatrix} a & b \\ b & d \end{pmatrix}, the characteristic polynomial is:

p(λ)=λ2(a+d)λ+(adb2)p(\lambda) = \lambda^2 - (a + d)\lambda + (ad - b^2)

The slider below lets you explore how the polynomial changes as you vary the matrix entries, and where the eigenvalues land on the λ\lambda-axis.

λp(λ)-10123456λ1=3.62λ2=1.38tr = 5.00, det = 5.00disc = 5.00λ = 3.618, 1.382p(λ) = λ² − 5.0λ + 5.0

Matrix: [[3.0, 1.0], [1.0, 2.0]]. Gold dots are eigenvalue roots of the characteristic polynomial.


Finding Eigenvectors

Once you have an eigenvalue λ\lambda, find its eigenvectors by solving:

(AλI)v=0(A - \lambda I)\mathbf{v} = \mathbf{0}

This is a homogeneous system — it always has the trivial solution v=0\mathbf{v} = \mathbf{0}, but we want nonzero solutions.

Continuing our example with A=(3102)A = \begin{pmatrix} 3 & 1 \\ 0 & 2 \end{pmatrix}:

For λ1=3\lambda_1 = 3:

A3I=(0101)A - 3I = \begin{pmatrix} 0 & 1 \\ 0 & -1 \end{pmatrix}

Row reduce: both rows say v2=0v_2 = 0. So v1=(10)\mathbf{v}_1 = \begin{pmatrix} 1 \\ 0 \end{pmatrix} (any scalar multiple works).

For λ2=2\lambda_2 = 2:

A2I=(1100)A - 2I = \begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix}

This says v1+v2=0v_1 + v_2 = 0, so v1=v2v_1 = -v_2. Eigenvector: v2=(11)\mathbf{v}_2 = \begin{pmatrix} -1 \\ 1 \end{pmatrix}.

You can verify: Av1=(30)=3v1A\mathbf{v}_1 = \begin{pmatrix} 3 \\ 0 \end{pmatrix} = 3\mathbf{v}_1 ✓ and Av2=(12)=2v2A\mathbf{v}_2 = \begin{pmatrix} -1 \\ 2 \end{pmatrix} = 2\mathbf{v}_2 ✓.


Geometric Intuition

Think of a matrix transformation as a machine that distorts space. Most directions get bent — a vector pointing northeast might end up pointing northwest.

Eigenvectors are the invariant axes of the transformation. Along these directions, the machine acts like a simple number line stretch. Everything else in the space is some linear combination of these special directions, so understanding what happens along eigenvectors tells you everything about the transformation.

For a 2×2 matrix with two distinct eigenvectors v1\mathbf{v}_1 and v2\mathbf{v}_2, any vector x\mathbf{x} can be written as:

x=c1v1+c2v2\mathbf{x} = c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2

Applying AA:

Ax=c1λ1v1+c2λ2v2A\mathbf{x} = c_1 \lambda_1 \mathbf{v}_1 + c_2 \lambda_2 \mathbf{v}_2

The transformation just scales each component independently along its eigenvector axis. That's why diagonalizing a matrix (expressing it in the eigenvector basis) simplifies everything.


Eigenvalues and Stability

The magnitude of λ\lambda tells you whether the transformation expands or contracts along that eigenvector direction:

  • λ>1|\lambda| > 1: expansion — vectors along this direction grow
  • λ<1|\lambda| < 1: contraction — vectors shrink toward zero
  • λ=1|\lambda| = 1: neutral — vectors maintain their length
  • λ<0\lambda < 0: flip — the direction reverses, then scales by λ|\lambda|
  • λ=0\lambda = 0: collapse — the entire eigenvector direction maps to zero

This is the foundation of dynamical systems analysis. If you model a system as xt+1=Axt\mathbf{x}_{t+1} = A\mathbf{x}_t, the eigenvalues of AA determine whether the system eventually stabilizes, grows without bound, or oscillates.


Power Iteration: How Eigenvalues Emerge Naturally

Apply AA to a random vector v\mathbf{v} repeatedly:

v,Av,A2v,A3v,\mathbf{v}, \quad A\mathbf{v}, \quad A^2\mathbf{v}, \quad A^3\mathbf{v}, \quad \ldots

Write v=c1v1+c2v2+\mathbf{v} = c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots. Then:

Akv=c1λ1kv1+c2λ2kv2+A^k\mathbf{v} = c_1\lambda_1^k\mathbf{v}_1 + c_2\lambda_2^k\mathbf{v}_2 + \cdots

If one eigenvalue dominates — say λ1>λj|\lambda_1| > |\lambda_j| for all j1j \neq 1 — then as kk \to \infty, the λ1k\lambda_1^k term swamps the rest. After normalization, the vector converges to v1\mathbf{v}_1, the dominant eigenvector.

This is the power iteration algorithm. It's why gradient descent and PageRank work the way they do.

dominant eigenvecIteration: 0v = [0.600, 0.800]eigvec = [-0.707, -0.707]Angle diff: 171.9°λ₁ = 3.000λ₂ = 1.000

Power iteration: repeatedly apply A and normalize. The vector (green) converges to the dominant eigenvector (gold dashed line).


Real-World Applications

Google PageRank

The web can be modeled as a giant matrix MM where MijM_{ij} represents the probability of jumping from page jj to page ii. PageRank is defined as the stationary distribution of a random walk on this graph.

Stationary distribution means: after multiplying by MM forever, the distribution doesn't change. That's exactly:

Mr=rM\mathbf{r} = \mathbf{r}

So r\mathbf{r} is an eigenvector of MM with eigenvalue λ=1\lambda = 1. Google's original algorithm was literally power iteration on a billion-node matrix.

Principal Component Analysis (PCA)

Given data matrix XX (mean-centered), the covariance matrix is C=1nXTXC = \frac{1}{n}X^TX.

PCA finds the directions of greatest variance in the data. These directions are the eigenvectors of CC, and the variance along each direction is the corresponding eigenvalue.

Why? Variance in direction u\mathbf{u} is uTCu\mathbf{u}^T C \mathbf{u}. To maximize this subject to u=1\|\mathbf{u}\| = 1, use Lagrange multipliers — the optimal u\mathbf{u} satisfies Cu=λuC\mathbf{u} = \lambda\mathbf{u}. Eigenvalue equation, exactly.

The first principal component is the eigenvector with the largest eigenvalue. It explains the most variance.


Symmetric Matrices: A Special Case

Symmetric matrices (A=ATA = A^T) have two remarkable properties:

  1. All eigenvalues are real — even if the matrix entries are real, some matrices have complex eigenvalues; symmetric matrices never do.
  2. Eigenvectors for distinct eigenvalues are orthogonal — the eigenvector axes are perpendicular to each other.

Proof of orthogonality: Let Au=λuA\mathbf{u} = \lambda\mathbf{u} and Av=μvA\mathbf{v} = \mu\mathbf{v} with λμ\lambda \neq \mu. Then:

λ(uv)=(Au)v=u(ATv)=u(Av)=μ(uv)\lambda(\mathbf{u} \cdot \mathbf{v}) = (A\mathbf{u}) \cdot \mathbf{v} = \mathbf{u} \cdot (A^T\mathbf{v}) = \mathbf{u} \cdot (A\mathbf{v}) = \mu(\mathbf{u} \cdot \mathbf{v})

Since λμ\lambda \neq \mu, we need uv=0\mathbf{u} \cdot \mathbf{v} = 0. They're orthogonal.

This leads to the spectral theorem: every symmetric matrix AA can be decomposed as:

A=QΛQTA = Q\Lambda Q^T

where QQ is an orthogonal matrix (its columns are the eigenvectors) and Λ\Lambda is diagonal (the eigenvalues). Every symmetric transformation is just a rotation, independent scaling along axes, and rotation back. Clean, beautiful, and the foundation of SVD.

The covariance matrix in PCA is symmetric — which is why PCA eigenvectors are orthogonal principal components.


Summary

ConceptKey Fact
Eigenvector equationAv=λvA\mathbf{v} = \lambda\mathbf{v}
Finding eigenvaluesdet(AλI)=0\det(A - \lambda I) = 0
Characteristic polynomial (2×2)λ2tr(A)λ+det(A)=0\lambda^2 - \text{tr}(A)\lambda + \det(A) = 0
$\lambda
$\lambda
λ<0\lambda < 0Direction flip
Symmetric matricesReal eigenvalues, orthogonal eigenvectors
PCAEigenvectors of covariance matrix
PageRankEigenvector with λ=1\lambda = 1

Next up: Singular Value Decomposition — what happens when a matrix isn't square, and why SVD generalizes eigendecomposition to all matrices.

Cite this work

Generated from article front matter.

Roy, Swastik. (2026). Eigenvalues and Eigenvectors. S. Roy. https://swastikroy.me/blog/linear-algebra-eigenvalues

Export PDF opens your browser’s print dialog — choose “Save as PDF” for a Zenodo-ready file.