Step-by-Step Eigenvector Solver
Enter a 2×2 or 3×3 matrix. This solver computes eigenvalues via the characteristic polynomial, finds eigenvectors by null space reduction, and visualizes how the matrix transforms eigenvectors versus arbitrary vectors on a coordinate plane.
Understanding Eigenvectors: The Geometric Perspective
Eigenvectors are the special directions of a linear transformation where the matrix acts as pure scaling. When you multiply a matrix A by an arbitrary vector v, the result Av is generally a completely different vector: different length, different direction. But for eigenvectors, the output Av points in the exact same direction as the input v (or the exact opposite direction if the eigenvalue is negative). The matrix equation Av = λv captures this precisely: the matrix A acting on eigenvector v produces the same vector scaled by the eigenvalue λ.
This geometric interpretation has profound consequences. Consider a 2×2 matrix acting on the plane. Every vector in the plane gets transformed, but there are typically two special lines through the origin (the eigenspaces) where vectors simply stretch or compress without rotating. The eigenvalues tell you the stretch factor along each line. A matrix with eigenvalues 3 and 0.5 stretches vectors along one eigenvector direction by a factor of 3 while compressing vectors along the other eigenvector direction by half. Understanding these special directions gives you complete insight into what the transformation does geometrically.
How This Solver Works: The Characteristic Polynomial Method
The solver follows the standard analytical approach taught in linear algebra courses. The process has two phases: first find the eigenvalues, then find the eigenvectors for each eigenvalue.
Phase 1: Finding Eigenvalues
The fundamental eigenvalue equation Av = λv rearranges to (A - λI)v = 0. For this homogeneous system to have a non-trivial solution (v ≠ 0), the coefficient matrix (A - λI) must be singular, meaning its determinant must equal zero. Computing det(A - λI) = 0 produces the characteristic polynomial, a polynomial in λ whose roots are the eigenvalues.
For a 2×2 matrix [[a, b], [c, d]], the characteristic polynomial is λ² - (a+d)λ + (ad - bc) = 0, a quadratic equation solvable by the quadratic formula. The coefficient (a+d) is the trace and (ad - bc) is the determinant. For 3×3 matrices, the characteristic polynomial is a cubic: λ³ - tr(A)λ² + (sum of 2×2 cofactors)λ - det(A) = 0. The solver displays every coefficient derivation step by step.
Phase 2: Finding Eigenvectors via Null Space Computation
Once each eigenvalue λi is known, the corresponding eigenvectors are found by solving the system (A - λiI)v = 0. This is a null space computation: we need to find all vectors in the kernel of the matrix (A - λiI). The solver performs Gaussian elimination (row reduction) on this matrix, identifying free variables and expressing the solution in parametric form. The resulting non-zero vectors are the eigenvectors.
For a 2×2 matrix, the null space computation typically reduces to one equation in two unknowns, yielding a one-dimensional eigenspace (a line through the origin). For 3×3 matrices with a repeated eigenvalue, the eigenspace might be two-dimensional (a plane), which the solver handles by identifying two linearly independent eigenvectors spanning that plane.
The Visualization: Before and After Transformation
The SVG visualization rendered by this tool shows the eigenvectors as colored arrows from the origin on a standard coordinate plane. It also shows how the matrix transforms a few sample vectors: each original vector is drawn in gray, and its transformed image Av is drawn in a contrasting color with a dashed line. For eigenvectors, the transformation produces a vector on the same line, visually demonstrating why eigenvectors are special. For non-eigenvectors, the transformation rotates the vector to a different angle, making the distinction immediately obvious.
The visualization uses different colors for each eigenvalue's eigenvectors. If the eigenvalues are real and distinct, you see two (or three) clearly separated directions. If the matrix has a negative eigenvalue, the eigenvector's image points in the opposite direction, shown as an arrow flipping across the origin. If the matrix has complex eigenvalues (which occurs when the discriminant of the characteristic polynomial is negative for 2×2 matrices), no real eigenvectors exist and the visualization explains that the transformation is a rotation-scaling with no invariant real directions.
Applications of Eigenvectors in Practice
Eigenvectors appear throughout science, engineering, and data analysis. In structural engineering, the eigenvectors of a stiffness matrix are the natural vibration modes of a structure, and the eigenvalues are the squared natural frequencies. A bridge or building resonates at these frequencies, and knowing them is critical for avoiding catastrophic resonance during earthquakes or wind loading.
In machine learning, Principal Component Analysis (PCA) relies entirely on eigenvectors. The covariance matrix of a dataset is symmetric and positive semi-definite, guaranteeing real non-negative eigenvalues and orthogonal eigenvectors. The eigenvector with the largest eigenvalue points in the direction of maximum variance in the data. By projecting data onto the top k eigenvectors, PCA reduces dimensionality while preserving as much information as possible. The eigenvalues quantify exactly how much variance each principal component captures.
Google's PageRank algorithm computes the dominant eigenvector (eigenvector corresponding to the largest eigenvalue) of a modified adjacency matrix of the web. Each component of this eigenvector gives the importance score of a web page. In quantum mechanics, the eigenvalues of a Hermitian operator are the possible measurement outcomes, and the eigenvectors are the corresponding quantum states. The spectral theorem guarantees that these eigenvectors form a complete orthonormal basis for the state space.
Numerical Considerations
This solver computes eigenvalues analytically using closed-form formulas (quadratic formula for 2×2, Cardano's formula for 3×3) rather than iterative numerical methods. This means the results are exact for integer and simple rational matrices. For matrices with irrational eigenvalues, the solver displays decimal approximations rounded to four significant digits. Numerical eigenvalue algorithms like the QR algorithm, used by NumPy and MATLAB for large matrices, are iterative and introduce floating-point rounding errors, but they scale to matrices of arbitrary size. The analytical approach used here is limited to 3×3 but produces cleaner step-by-step displays for educational purposes.
A common pitfall when computing eigenvectors by hand is dividing by zero during row reduction when the matrix has a zero pivot. The solver handles this by swapping rows during Gaussian elimination. Another issue is eigenvalue multiplicity: if an eigenvalue is repeated, the eigenspace may have dimension greater than 1, requiring careful null space analysis to find all independent eigenvectors. The solver explicitly checks for this and reports the algebraic and geometric multiplicities when they differ.
Frequently Asked Questions
What is the difference between an eigenvalue and an eigenvector?
An eigenvalue is a scalar λ that tells you by how much a matrix stretches or compresses a particular direction. An eigenvector is the non-zero vector that defines that direction. Together, they satisfy Av = λv. The eigenvalue is the "how much" and the eigenvector is the "which direction." Every eigenvalue has at least one eigenvector, and the set of all eigenvectors for a given eigenvalue forms a subspace called the eigenspace.
How do you find eigenvectors after computing eigenvalues?
For each eigenvalue λ, form the matrix (A - λI) and solve the homogeneous system (A - λI)v = 0 using Gaussian elimination (row reduction). The non-trivial solutions to this system are the eigenvectors corresponding to that eigenvalue. For a 2×2 matrix, this typically reduces to a single equation relating the two components of v, giving you a one-parameter family of eigenvectors.
Can a matrix have repeated eigenvalues with different eigenvectors?
Yes. When an eigenvalue has algebraic multiplicity greater than 1 (it appears as a repeated root of the characteristic polynomial), it may have multiple linearly independent eigenvectors. The number of independent eigenvectors is the geometric multiplicity, which is always between 1 and the algebraic multiplicity. If geometric multiplicity equals algebraic multiplicity for all eigenvalues, the matrix is diagonalizable.
Why do eigenvectors not change direction when multiplied by their matrix?
By definition, an eigenvector v of matrix A satisfies Av = λv. This means multiplying A by v produces the same vector v scaled by λ. Geometrically, while most vectors get rotated and stretched into a completely different direction, eigenvectors only get scaled along their original line. If λ is negative, the eigenvector flips but stays on the same line through the origin.
What does the visualization of eigenvectors on a coordinate plane show?
The visualization shows the original eigenvectors as arrows from the origin, and how the matrix transforms arbitrary vectors compared to eigenvectors. An arbitrary vector gets both rotated and scaled, landing at a new angle. An eigenvector, after transformation, lands on the same line it started on, just stretched by its eigenvalue. The before-and-after comparison makes it visually clear why eigenvectors are special directions.
Related Tools
- Eigenvalue Calculator — compute eigenvalues for matrices up to 5×5
- Matrix Decomposition Calculator — LU, QR, and SVD decomposition with animated steps
- Determinant Calculator — det(A) equals the product of eigenvalues
- Linear Algebra Cheatsheet — searchable formula reference with mini-calculators
Built by Michael Lip. Try the ML3X Matrix Calculator for interactive step-by-step solutions.