Interactive Linear Algebra Cheatsheet

Searchable reference of key linear algebra formulas. Each formula has a "Try It" mini-calculator so you can plug in your own numbers and see the result instantly. Filter by category or search by name.

Why a Linear Algebra Cheatsheet Matters

Linear algebra is the mathematical language of data, computation, and physical systems. Every machine learning model, every 3D graphics engine, every signal processing pipeline, and every quantum mechanical calculation is built on matrix operations. The formulas on this cheatsheet are not abstract curiosities but the daily working tools of engineers, data scientists, physicists, and computer scientists. Having them in a searchable, interactive reference eliminates the friction of looking up formulas in textbooks or scattered Wikipedia articles.

This cheatsheet is organized into five categories that mirror the structure of a standard linear algebra course. The Basics section covers fundamental scalar quantities derived from matrices: the trace (sum of diagonal entries), the determinant (a signed volume scaling factor), and the rank (the number of independent dimensions in the output). The Operations section covers matrix arithmetic: addition, multiplication, transposition, and inversion. The Decompositions section covers the three most important factorizations: LU, QR, and SVD. The Vector Spaces section covers subspaces associated with a matrix: column space, null space, and their relationships via the rank-nullity theorem. The Norms section covers different ways to measure the size of matrices and vectors.

Formulas in Context: When Each Formula Matters

Determinant and Invertibility

The determinant is the single most diagnostic number you can compute from a square matrix. If det(A) = 0, the matrix is singular: it has no inverse, its columns are linearly dependent, its rank is less than n, and the system Ax = b either has no solution or infinitely many solutions. If det(A) is non-zero, the matrix is invertible and Ax = b has exactly one solution for every b. The magnitude of the determinant measures how the matrix scales volumes: a 3×3 matrix with det(A) = 2 doubles the volume of any region it transforms. A negative determinant means the transformation includes a reflection (it reverses orientation).

Eigenvalues and the Characteristic Polynomial

The characteristic polynomial det(A - λI) = 0 is the bridge between a matrix and its eigenvalues. For a 2×2 matrix, this gives a quadratic whose coefficients are the trace (sum of eigenvalues) and determinant (product of eigenvalues). For a 3×3 matrix, it gives a cubic whose coefficients involve the trace, the sum of 2×2 principal minors, and the determinant. These relationships provide powerful consistency checks: if you compute eigenvalues λ1 and λ2 of a 2×2 matrix, their sum must equal the trace and their product must equal the determinant.

Matrix Norms and Condition Numbers

Norms quantify how large a matrix or vector is. The vector 2-norm (Euclidean length) and the matrix Frobenius norm (square root of the sum of squared entries) are the most commonly used because they are easy to compute and have nice mathematical properties. The matrix spectral norm (largest singular value) is harder to compute but more meaningful: it measures the maximum stretching factor of the linear transformation. The condition number cond(A) = σmaxmin measures how sensitive the solution of Ax = b is to perturbations. A condition number near 1 means the system is well-conditioned (small input changes produce small output changes). A condition number of 10k means you lose about k digits of accuracy when solving the system numerically.

The Rank-Nullity Theorem

The rank-nullity theorem states that for an m×n matrix A: rank(A) + nullity(A) = n, where nullity is the dimension of the null space (the set of solutions to Ax = 0). This is one of the most fundamental results in linear algebra because it connects the dimension of what a matrix "can reach" (the column space, with dimension = rank) to the dimension of what it "collapses to zero" (the null space, with dimension = nullity). If a 5×5 matrix has rank 3, then its null space has dimension 2, meaning there is a 2-dimensional subspace of vectors that the matrix maps to the zero vector.

Computational Notes

The mini-calculators on this page implement each formula directly in JavaScript for 2×2 and 3×3 matrices. For determinants, the 2×2 formula ad - bc and the 3×3 cofactor expansion are used. For matrix inverse, the adjugate method (transpose of cofactor matrix divided by determinant) is implemented. For norms, the Frobenius norm sums the squares of all entries, and the 1-norm and infinity-norm scan columns and rows respectively. All computations run entirely in your browser with no server round trips, no dependencies, and no tracking.

For matrices larger than 3×3, use the main ML3X calculator which supports matrices up to 5×5, or for production-scale computation, use NumPy (Python), MATLAB, or Julia. The formulas on this page apply to matrices of all sizes, but the analytical closed-form expressions (like the quadratic formula for 2×2 eigenvalues) are specific to small matrices. For large matrices, iterative algorithms like the QR algorithm (eigenvalues), Gaussian elimination with pivoting (LU), and the Golub-Kahan bidiagonalization (SVD) are used.

Frequently Asked Questions

What are the most important linear algebra formulas to memorize?

The essential formulas are: the 2×2 determinant (ad - bc), the 2×2 inverse formula (swap diagonal, negate off-diagonal, divide by determinant), the characteristic polynomial det(A - λI) = 0, the trace equals sum of eigenvalues, the determinant equals product of eigenvalues, and ||AB|| ≤ ||A|| · ||B||. For applied work, also memorize x = (ATA)-1ATb and A = UΣVT.

How do you compute the determinant of a 3×3 matrix?

Use cofactor expansion along the first row: det(A) = a11(a22a33 - a23a32) - a12(a21a33 - a23a31) + a13(a21a32 - a22a31). For larger matrices, LU decomposition is more efficient: det(A) equals the product of the diagonal entries of U.

What is the difference between the Frobenius norm and the spectral norm?

The Frobenius norm ||A||F is the square root of the sum of squares of all entries. The spectral norm ||A||2 is the largest singular value of A. The Frobenius norm is easier to compute but the spectral norm is tighter for error bounds. They satisfy ||A||2 ≤ ||A||F ≤ √rank(A) · ||A||2.

When is a matrix diagonalizable?

A matrix is diagonalizable if and only if it has n linearly independent eigenvectors. Equivalently, for every eigenvalue the geometric multiplicity equals the algebraic multiplicity. All symmetric matrices and all matrices with distinct eigenvalues are diagonalizable. A non-diagonalizable matrix is called defective.

How is the rank of a matrix related to its other properties?

The rank equals the number of non-zero singular values, the number of linearly independent columns (or rows), the dimension of the column space, and n minus the dimension of the null space. A square matrix is invertible if and only if it has full rank. The rank-nullity theorem states rank(A) + nullity(A) = n (number of columns).

Related Tools

Built by Michael Lip. Try the ML3X Matrix Calculator for interactive step-by-step solutions.