← SciSim / Mathematics

Eigenvalues, Eigenvectors & Diagonalization

The directions a matrix doesn't rotate — only stretches.
🎓 Tier: Standard Undergraduate (Linear Algebra)

📊 Section 1 — Interactive Simulation

Choose a 2×2 matrix $A$. Watch any vector $\mathbf{v}$ transform to $A\mathbf{v}$. The eigenvectors are the special directions where $A\mathbf{v}=\lambda\mathbf{v}$ — only stretched, never rotated. Drag the input vector with your mouse/finger.

2D plane
Matrix A
trace tr(A)
det(A)
discriminant Δ
λ₁
λ₂
eigenvector v₁
eigenvector v₂

Animation

Matrix Preset

Matrix Entries

Input Vector v

Display Options

Tips

• Eigenvectors stay on their span — only $A\mathbf{v}$ direction unchanged is the test.
• Power Iteration: rotating any starting $\mathbf{v}$ converges to the dominant eigenvector.
• Complex eigenvalues mean rotation; the simulation shows them as DNE in the real plane and lists complex values.

💡 Section 2 — The Idea, Step by Step

One gentle climb from a playground picture to the characteristic equation — no prior linear algebra needed to start.

Start here · middle school
Spin a globe and almost every city races sideways — but the two poles stay put. They sit on the spin axis, the one direction the spin leaves alone. A matrix does something similar to arrows. Multiply most arrows by a matrix $A$ and they get knocked into a brand-new direction. A rare few don't turn at all — they only get longer or shorter. Those special arrows are the matrix's eigenvectors, and how much each one stretches is its eigenvalue.
Build · high school
Write the test as $A\mathbf{v} = \lambda\mathbf{v}$: the matrix times the arrow equals just a number $\lambda$ times the same arrow. That number is the stretch factor — $\lambda = 2$ doubles the arrow, $\lambda = 0.5$ halves it, a negative $\lambda$ flips it backwards. Take the simple stretch $A = \begin{pmatrix}2 & 0\\ 0 & 3\end{pmatrix}$. The arrow $(1,0)$ becomes $(2,0)$, so it stayed on the $x$-axis with $\lambda = 2$; the arrow $(0,1)$ becomes $(0,3)$, eigenvalue $\lambda = 3$. The two axes are the eigenvectors here.
Deepen · AP / intro-college
To find eigenvalues for any $2\times 2$ matrix, rewrite $A\mathbf{v}=\lambda\mathbf{v}$ as $(A-\lambda I)\mathbf{v}=\mathbf{0}$. A nonzero $\mathbf{v}$ can exist only when $A-\lambda I$ collapses some direction to zero — that is, when it is singular, so $\det(A-\lambda I)=0$. For a $2\times 2$ matrix this is the characteristic equation $\lambda^2 - \tr(A)\,\lambda + \det(A) = 0$, solved by the quadratic formula. When the discriminant $\tr(A)^2 - 4\det(A)$ turns negative the eigenvalues go complex — the matrix is really rotating, so no real arrow can stay on its own line. In the sim, the matrix-entry boxes set $A$, the $v_x, v_y$ sliders (or the angle $\theta$) pick the test arrow $\mathbf{v}$, and the $k$ slider shows the repeated product $A^k\mathbf{v}$.
Try this in the sim above
(1) Load the Diagonal: diag(2, 0.5) preset and drag $\mathbf{v}$ around — only the arrows lying along the two axes keep their direction; everything else swings off. (2) Switch to the Rotation 45° preset: nothing stays on its own line, and $\lambda_1, \lambda_2$ light up as complex values — pure rotation has no real eigen-direction. (3) Pick any preset and crank the iteration slider $k$ — watch $A^k\mathbf{v}$ swing around and lock onto the eigenvector with the largest $\abs{\lambda}$. That last move is exactly how Power Iteration, and Google's original PageRank, find a dominant eigenvector.

📐 Section 3 — Definition & Diagonalization Theorem

From eigen-equation to diagonalization, with full derivation.

Definition · Eigenvalue and Eigenvector

Let $A \in \R^{n\times n}$. A scalar $\lambda \in \C$ is an eigenvalue of $A$ iff there is a nonzero vector $\mathbf{v}\in\C^n$ with $$A\mathbf{v} = \lambda \mathbf{v}.$$ Such $\mathbf{v}$ is an eigenvector for $\lambda$. The set $E_\lambda = \ker(A-\lambda I)$ is the eigenspace of $\lambda$.

Diagonalization Theorem

$A \in \R^{n\times n}$ is diagonalizable iff there is an invertible matrix $P$ and a diagonal matrix $D$ with $A = P D P^{-1}$. Equivalently, iff $A$ has $n$ linearly independent eigenvectors. The columns of $P$ are eigenvectors; the diagonal of $D$ is the corresponding eigenvalues.

When diagonalizable: $A^k = P D^k P^{-1}$ — matrix powers reduce to scalar powers on the diagonal. This is why eigenvalues control long-term behaviour.

Symbol Table

SymbolMeaningType
$A$ Square matrix under study $n\times n$, real (or complex)
$\lambda$ Eigenvalue Scalar in $\C$
$\mathbf{v}$ Eigenvector Nonzero in $\C^n$
$p_A(\lambda)$ Characteristic polynomial $\det(A-\lambda I)$ Degree-$n$ polynomial in $\lambda$
$E_\lambda$ Eigenspace $\ker(A-\lambda I)$ Subspace of $\C^n$
$\tr(A)$ Trace = sum of diagonal entries = $\lambda_1+\cdots+\lambda_n$Scalar
$\det(A)$ Determinant = $\lambda_1\lambda_2\cdots\lambda_n$Scalar
$P, D$ Eigenvector matrix, eigenvalue diagonal $A = PDP^{-1}$

Derivation — How to Find Eigenvalues and Diagonalize

Step 1 · Reframe the eigen-equation
$A\mathbf{v} = \lambda\mathbf{v} \iff (A - \lambda I)\mathbf{v} = \mathbf{0}$ with $\mathbf{v}\neq \mathbf{0}$. Such a nonzero $\mathbf{v}$ exists iff $A-\lambda I$ is singular.
Step 2 · Characteristic polynomial
$A - \lambda I$ singular $\iff \det(A - \lambda I) = 0$. Define $p_A(\lambda) := \det(A - \lambda I)$. Then $\lambda$ is an eigenvalue iff $p_A(\lambda)=0$. Roots of $p_A$ = eigenvalues.
Step 3 · The 2×2 case
For $A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$, $p_A(\lambda) = \lambda^2 - (a+d)\lambda + (ad-bc) = \lambda^2 - \tr(A)\,\lambda + \det(A)$. The roots are $\lambda_{1,2} = \dfrac{\tr(A) \pm \sqrt{\tr(A)^2 - 4\det(A)}}{2}$.
Step 4 · Find eigenvectors
For each eigenvalue $\lambda_i$, solve $(A-\lambda_i I)\mathbf{v}=\mathbf{0}$. Any nonzero solution is an eigenvector for $\lambda_i$. (Eigenvectors are determined only up to a nonzero scalar — the "direction" matters, not the magnitude.)
Step 5 · Linear independence
Eigenvectors corresponding to distinct eigenvalues are linearly independent. So if $A$ has $n$ distinct eigenvalues, you get $n$ independent eigenvectors automatically.
Step 6 · Form $P$ and $D$
Stack the $n$ eigenvectors as columns of $P$: $P = [\mathbf{v}_1\mid\mathbf{v}_2\mid\cdots\mid\mathbf{v}_n]$. Place eigenvalues on the diagonal: $D = \mathrm{diag}(\lambda_1,\ldots,\lambda_n)$. Independence of the columns guarantees $P$ is invertible.
Step 7 · Verify $A = PDP^{-1}$
Note $AP = [A\mathbf{v}_1\mid\cdots\mid A\mathbf{v}_n] = [\lambda_1\mathbf{v}_1\mid\cdots\mid\lambda_n\mathbf{v}_n] = PD$. Multiply by $P^{-1}$ on the right: $A = PDP^{-1}$. $\boxed{A = PDP^{-1}.}$ Iterate: $A^k = (PDP^{-1})^k = PD^kP^{-1}$, so matrix powers reduce to scalar powers on $D$.

Simulation ↔ Symbol Mapping

matrix entries a₁₁..a₂₂entries of $A$, the matrix being analyzed
readout tr(A), det(A)$\tr(A) = a+d$, $\det(A) = ad - bc$
readout discriminant Δ$\Delta = \tr(A)^2 - 4\det(A)$. $\Delta>0$: real distinct; $\Delta=0$: repeated; $\Delta<0$: complex conjugate pair
readout λ₁, λ₂roots of $p_A(\lambda)$ from the quadratic formula in Step 3
readout v₁, v₂basis vectors from $\ker(A - \lambda_i I)$, normalized
vector v on canvasinput vector — drag with mouse/touch, or use $v_x, v_y$ sliders / angle $\theta$
slider k (iter count)shows $A^k\mathbf{v}$ — for power iteration, this converges to dominant eigenvector direction
graph characteristic polynomialplots $p_A(\lambda)$ in $\lambda$; zero crossings are eigenvalues

Worked Example — $A = \begin{pmatrix} 4 & 1 \\ 2 & 3 \end{pmatrix}$

Step 1 — Characteristic polynomial: $\tr(A) = 7$, $\det(A) = 4\cdot 3 - 1\cdot 2 = 10$. So $p_A(\lambda) = \lambda^2 - 7\lambda + 10 = (\lambda-5)(\lambda-2)$.

Step 2 — Eigenvalues: $\lambda_1 = 5,\ \lambda_2 = 2$.

Step 3 — Eigenvector for $\lambda_1=5$: $(A-5I)\mathbf{v}=\mathbf{0}$ gives $\begin{pmatrix}-1 & 1 \\ 2 & -2\end{pmatrix}\mathbf{v}=\mathbf{0}$, i.e.\ $-v_x + v_y = 0$. So $\mathbf{v}_1 = (1, 1)^\top$.

Step 4 — Eigenvector for $\lambda_2=2$: $(A-2I)\mathbf{v}=\mathbf{0}$ gives $\begin{pmatrix}2 & 1 \\ 2 & 1\end{pmatrix}\mathbf{v}=\mathbf{0}$, i.e.\ $2v_x + v_y = 0$. So $\mathbf{v}_2 = (1, -2)^\top$.

Step 5 — Diagonalize: $P = \begin{pmatrix}1 & 1\\ 1 & -2\end{pmatrix}$, $D = \begin{pmatrix}5 & 0\\ 0 & 2\end{pmatrix}$, $P^{-1} = \dfrac{1}{-3}\begin{pmatrix}-2 & -1\\ -1 & 1\end{pmatrix} = \begin{pmatrix}2/3 & 1/3 \\ 1/3 & -1/3\end{pmatrix}$.

Verify: $PDP^{-1} = \begin{pmatrix}1 & 1\\ 1 & -2\end{pmatrix}\begin{pmatrix}5 & 0\\ 0 & 2\end{pmatrix}\begin{pmatrix}2/3 & 1/3\\ 1/3 & -1/3\end{pmatrix} = \begin{pmatrix}4 & 1\\ 2 & 3\end{pmatrix} = A$. $\boxed{A = PDP^{-1}.}$

Reference: Strang, G. — Introduction to Linear Algebra, 5th ed., Ch. 6 §6.1–6.2; Axler, S. — Linear Algebra Done Right, 4th ed., Ch. 5 (eigenvalues without determinants); Friedberg-Insel-Spence — Linear Algebra, 4th ed., §5.1–5.2; Lay — Linear Algebra and Its Applications, 5th ed., Ch. 5.

❓ Section 4 — Frequently Asked Questions

🧮Conceptual What does it mean for a vector to be an eigenvector?

It's a direction the matrix doesn't rotate — only stretches (or compresses, or flips). Most vectors $\mathbf{v}$, when multiplied by $A$, get sent to a totally different direction. Eigenvectors are the few special directions where $A\mathbf{v}$ stays on the same line through the origin as $\mathbf{v}$. The eigenvalue $\lambda$ tells you the stretch factor: $\lambda > 1$ stretches, $0 < \lambda < 1$ compresses, $\lambda < 0$ also flips. So the eigen-equation $A\mathbf{v} = \lambda\mathbf{v}$ is a geometric statement: "this vector's direction is preserved (up to sign) by $A$".

Key takeaway: eigenvectors are the directions $A$ doesn't rotate; eigenvalues are the stretch factors along those directions.
🔬Simulation What does the simulation actually compute?

For your 2×2 matrix $A$, it computes $\tr(A) = a_{11}+a_{22}$ and $\det(A) = a_{11}a_{22}-a_{12}a_{21}$ exactly, then solves $\lambda^2 - \tr(A)\lambda + \det(A) = 0$ via the quadratic formula. If the discriminant $\Delta = \tr^2 - 4\det$ is non-negative, you get real eigenvalues; otherwise complex conjugates (shown in red — they correspond to rotation, no real eigen-direction). For each real eigenvalue, it solves $(A-\lambda I)\mathbf{v}=0$ by null-space computation. In Power Iteration mode, it repeatedly multiplies and normalizes: $\mathbf{v}_{k+1} = A\mathbf{v}_k / \norm{A\mathbf{v}_k}$, which converges to the dominant eigenvector.

Key takeaway: tr and det give you the eigenvalues directly via the 2×2 quadratic — no iteration needed for small matrices.
🌍Applied Where do eigenvalues actually matter?

Everywhere there's a linear operation iterated over time. Google's PageRank is the dominant eigenvector of the web's link matrix. Principal Component Analysis (PCA) in ML uses eigenvectors of the covariance matrix to find the directions of maximum variance. Quantum mechanics: observables are Hermitian operators, measurements yield eigenvalues, states collapse to eigenvectors. Vibration analysis: natural frequencies of a building/bridge are square roots of eigenvalues of the stiffness matrix — engineers compute them to avoid resonance disasters. Stability of equilibria in dynamical systems: the equilibrium is stable iff all eigenvalues of the Jacobian have negative real part.

Key takeaway: PageRank, PCA, quantum measurement, vibration, control theory — all are eigenvalue problems.
💡Non-Obvious Why do some real matrices have complex eigenvalues?

Because rotation has no fixed direction in $\R^2$. Take the 90° rotation $A = \begin{pmatrix} 0 & -1\\ 1 & 0\end{pmatrix}$. There's no real $\mathbf{v}\neq\mathbf{0}$ with $A\mathbf{v}=\lambda\mathbf{v}$ — every real vector gets rotated. The characteristic polynomial $\lambda^2 + 1$ has roots $\pm i$, so the eigenvalues live in $\C$. The complex eigenvectors live in $\C^2$ and encode the rotation as multiplication by a complex number on the unit circle ($e^{i\theta}$ has modulus 1, angle $\theta$). Whenever a real matrix has $\det>0$ and $\tr^2 < 4\det$, it acts as a (scaled) rotation and has complex conjugate eigenvalues.

Key takeaway: complex eigenvalues mean the matrix rotates — there's no fixed real direction to be an eigenvector.
📐Computational How does Power Iteration converge, and how fast?

Suppose $\abs{\lambda_1} > \abs{\lambda_2} \geq \cdots$, and $\mathbf{v}_0 = c_1\mathbf{e}_1 + c_2\mathbf{e}_2 + \cdots$ in the eigenbasis with $c_1\neq 0$. Then $A^k\mathbf{v}_0 = \lambda_1^k(c_1\mathbf{e}_1 + c_2(\lambda_2/\lambda_1)^k\mathbf{e}_2 + \cdots)$. Since $\abs{\lambda_2/\lambda_1} < 1$, all the non-dominant terms decay geometrically with rate $\abs{\lambda_2/\lambda_1}^k$. So Power Iteration converges to the direction of $\mathbf{e}_1$ at rate $\abs{\lambda_2/\lambda_1}$. If the gap is $\abs{\lambda_2/\lambda_1}=0.5$, you halve error per step — about 20 steps for $10^{-6}$ accuracy. If the gap is $0.99$, you need 1000 steps. Convergence fails entirely for $\abs{\lambda_1}=\abs{\lambda_2}$ (e.g.\ a rotation matrix).

Key takeaway: Power Iteration's convergence rate is the spectral gap $\abs{\lambda_2/\lambda_1}$ — small gap, slow convergence.
🎓Deep / Advanced When is a matrix not diagonalizable, and what do you do then?

$A$ is diagonalizable iff for every eigenvalue, its geometric multiplicity (dimension of $E_\lambda = \ker(A-\lambda I)$) equals its algebraic multiplicity (multiplicity as a root of $p_A$). A "defective" example: $A=\begin{pmatrix}2 & 1\\ 0 & 2\end{pmatrix}$ has $\lambda=2$ with algebraic multiplicity 2, but $\ker(A-2I)$ is only 1-dimensional. So $A$ has only one eigenvector direction, can't form a $P$. For these, the right framework is Jordan canonical form: $A = PJP^{-1}$ where $J$ has eigenvalues on the diagonal and possibly 1's on the superdiagonal in "Jordan blocks". For applications, defective cases are unstable under perturbation — generic matrices are diagonalizable, defective ones live on a measure-zero set.

Key takeaway: not all matrices are diagonalizable, but those are non-generic. Jordan form covers the rest.
🧮Conceptual Why is $\tr(A) = \sum\lambda_i$ and $\det(A) = \prod\lambda_i$?

The characteristic polynomial of an $n\times n$ matrix is $p_A(\lambda) = (-1)^n(\lambda-\lambda_1)(\lambda-\lambda_2)\cdots(\lambda-\lambda_n)$. Expanding, the coefficient of $\lambda^{n-1}$ is $(-1)^n \cdot (-1)\sum\lambda_i = (-1)^{n-1}\sum\lambda_i$. But computing $\det(A-\lambda I)$ directly, the coefficient of $\lambda^{n-1}$ is $(-1)^{n-1}\tr(A)$. So $\tr(A) = \sum\lambda_i$. The constant term of $p_A(\lambda)$ is $p_A(0) = \det(A) = (-1)^n\prod(-\lambda_i) = \prod\lambda_i$. So tr and det are elementary symmetric polynomials in the eigenvalues. For 2×2, those are the only two; for larger matrices, more invariants appear.

Key takeaway: tr and det are elementary symmetric functions of the eigenvalues — the characteristic polynomial encodes them all.
Best resource: 3Blue1Brown — "Eigenvectors and eigenvalues" (Essence of Linear Algebra, Ch. 14); MIT OCW 18.06 — Linear Algebra (Strang), Lec 21 (eigenvalues, eigenvectors); Khan Academy — Linear Algebra; Better Explained — "A Programmer's Intuition for Matrix Multiplication".

⚠️ Section 5 — Misconceptions & Common Errors

A · Conceptual Misconceptions
❌ Misconception: "$\det(A)=0$ means $A$ is the zero matrix." ✅ Correction: $\det(A)=0$ means $A$ is singular (non-invertible) — equivalently, $A$ has zero as an eigenvalue, i.e.\ collapses some non-zero direction to $\mathbf{0}$. The matrix itself can still have nonzero entries. Example: $A = \begin{pmatrix}1 & 2\\ 2 & 4\end{pmatrix}$ has $\det = 0$ (rows are dependent) but is far from zero. Singular ≠ zero. 📖 Reference: Strang — Introduction to Linear Algebra, 5th ed., Ch. 5 (singular vs zero).
❌ Misconception: "A real matrix always has real eigenvalues." ✅ Correction: Only real symmetric matrices ($A^\top = A$) are guaranteed real eigenvalues (spectral theorem). General real matrices can have complex conjugate pairs. The 90° rotation $\begin{pmatrix}0 & -1\\ 1 & 0\end{pmatrix}$ has eigenvalues $\pm i$. The diagnostic: $\Delta = \tr^2 - 4\det < 0$ ⇔ complex conjugate eigenvalues for 2×2 matrices. 📖 Reference: Axler — Linear Algebra Done Right, 4th ed., Ch. 7 (spectral theorem).
❌ Misconception: "Eigenvectors are unique." ✅ Correction: Eigenvectors are determined only up to a nonzero scalar multiple. If $\mathbf{v}$ is an eigenvector for $\lambda$, then so is $c\mathbf{v}$ for any $c\neq 0$ (positive or negative, real or complex). What's unique is the eigenspace $E_\lambda$ — the entire subspace, not a particular vector. When eigenvalues repeat (multiplicity > 1), the eigenspace can be 2D or higher and there's no canonical "the" eigenvector. 📖 Reference: Friedberg-Insel-Spence — Linear Algebra, 4th ed., §5.1 (eigenspace as the actual invariant).
B · Common Procedural Errors
❌ Error: "Char. poly. of $A=\begin{pmatrix}3&2\\1&2\end{pmatrix}$ is $\det(A)-\lambda I = (6-2)-\lambda = 4-\lambda$." ✅ Correct: The characteristic polynomial is $\det(A - \lambda I)$, not $\det(A) - \lambda I$. Compute $A - \lambda I = \begin{pmatrix}3-\lambda & 2\\ 1 & 2-\lambda\end{pmatrix}$, then $\det = (3-\lambda)(2-\lambda) - 2\cdot 1 = \lambda^2 - 5\lambda + 4$. Roots: $\lambda = 1, 4$. The student treated $\lambda I$ as a scalar. 🔍 Why students do this: confusing $\lambda I$ (a matrix) with $\lambda$ (a scalar) — written carelessly, they look similar.
❌ Error: "$A = \begin{pmatrix}1 & 1\\ 0 & 1\end{pmatrix}$ has $\lambda=1$ (twice), so eigenvectors are any nonzero $\mathbf{v}\in\R^2$." ✅ Correct: Solve $(A-I)\mathbf{v}=\mathbf{0}$: $\begin{pmatrix}0 & 1\\ 0 & 0\end{pmatrix}\mathbf{v}=\mathbf{0}$ gives $v_y=0$. So the eigenspace is $\{(t, 0)^\top : t\in\R\}$ — only the $x$-axis, dimension 1. Algebraic multiplicity is 2, geometric multiplicity is 1. This is the textbook defective case (Jordan block) — not diagonalizable. Justifying rule: geometric multiplicity = $\dim\ker(A-\lambda I)$, computed by row reduction. 🔍 Why students do this: assume "every vector is an eigenvector when $A=I$" extends to "every vector is an eigenvector when $\lambda = 1$" — but only when $A = I$ exactly.
❌ Error: "$A^2$ has eigenvalues $2\lambda_1, 2\lambda_2$." ✅ Correct: $A^2$ has eigenvalues $\lambda_1^2, \lambda_2^2$. Proof: if $A\mathbf{v}=\lambda\mathbf{v}$, then $A^2\mathbf{v} = A(\lambda\mathbf{v}) = \lambda A\mathbf{v} = \lambda^2\mathbf{v}$. The eigenvectors are the same; the eigenvalues get squared, not doubled. More generally, $A^k$ has eigenvalues $\lambda_i^k$, and any polynomial $p$ in $A$ has eigenvalues $p(\lambda_i)$ — this is the spectral mapping theorem. 🔍 Why students do this: confuse $A^2$ (matrix square) with $2A$ (scalar multiple). The first squares eigenvalues; the second doubles them.
Education research: Sierpinska, A. — "Lecture notes on the didactics of linear algebra", Concordia University; Hillel, J. — "Modes of description and the problem of representation in linear algebra", in Dorier (ed.) On the Teaching of Linear Algebra, Kluwer (2000); Dorier, J.-L. & Sierpinska, A. — "Research into the teaching and learning of linear algebra", ICMI Study (2001); Possani, E. et al. — "Use of models in the teaching of linear algebra", Linear Algebra and its Applications 432(8), 2125–2140 (2010); Thomas, M. & Stewart, S. — "Eigenvalues and eigenvectors: embodied, symbolic and formal thinking", Mathematics Education Research Journal 23, 275–296 (2011).