A matrix is one of the most versatile objects in mathematics. It encodes systems of equations, represents linear transformations, stores data in structured form, and serves as the computational backbone of nearly every topic in linear algebra. Understanding what matrices are, how to read them, and how their parts relate to one another is the starting point for everything that follows.
What a Matrix Is
A matrix is a rectangular array of numbers arranged in rows and columns. The standard notation uses a capital letter for the matrix and a lowercase letter with two subscripts for its entries: the matrix A has entry aij in row i and column j. The shorthand A=(aij) means "the matrix whose (i,j) entry is aij."
The entries can be real numbers, complex numbers, or elements of any algebraic field. Throughout this site, entries are real unless explicitly stated otherwise.
Dimensions, Rows, and Columns
The size of a matrix is described by two numbers: m rows and n columns, written m×n. The notation A∈Rm×n states that A is an m×n matrix with real entries. The total number of entries is m⋅n. Order matters: a 3×5 matrix and a 5×3 matrix have different shapes and are never equal, regardless of their entries.
Row i of A is the horizontal slice (ai1,ai2,…,ain), a 1×n vector. Column j is the vertical slice (a1j,a2j,…,amj)T, an m×1 vector. The main diagonal consists of the entries where the row index equals the column index: a11,a22,…,akk with k=min(m,n). The diagonal is defined for any matrix, not just square ones, though it is most prominent in the square case.
A matrix with m=n is called square, and square matrices occupy a special position. Only square matrices can have a determinant, an inverse, eigenvalues, or a trace. A column vector in Rn is simply an n×1 matrix, a row vector is a 1×n matrix, and a scalar is a 1×1 matrix. Matrices unify all of these objects under a single framework.
Matrix Equality and the Zero Matrix
Two matrices A and B are equal if and only if they have the same dimensions and every pair of corresponding entries matches: aij=bij for all i and j. A single mismatched entry makes the matrices unequal. If the dimensions differ, the matrices are never equal — a 2×3 matrix cannot equal a 3×2 matrix no matter what numbers they contain.
The zero matrix is the m×n matrix whose every entry is zero, written O or 0m×n. It serves as the additive identity: A+O=A for any matrix A of the same size. Strictly speaking, there is a different zero matrix for each pair (m,n), but the same symbol is used for all of them, with the dimensions understood from context.
Matrices as Collections of Vectors
An m×n matrix can be viewed as a collection of n column vectors in Rm, arranged side by side:
A=∣a1∣∣a2∣⋯∣an∣
Equivalently, it is a stack of m row vectors in Rn. Both perspectives are useful, and choosing the right one often simplifies a problem considerably. The column view connects the matrix to concepts like span, linear independence, and column space. The row view connects it to systems of equations and row space.
The column perspective also gives a powerful interpretation of the matrix-vector product. If x=(x1,x2,…,xn)T, then
Ax=x1a1+x2a2+⋯+xnan
The product Ax is a linear combination of the columns of A, weighted by the entries of x. This single observation underlies the theory of linear systems, transformations, and virtually everything else involving matrices.
Matrix Arithmetic at a Glance
Matrices support several operations, each with its own rules and dimension requirements.
Addition is entry-by-entry: (A+B)ij=aij+bij. Both matrices must have the same dimensions. Scalar multiplication scales every entry: (cA)ij=c⋅aij. These two operations together give the set of all m×n matrices the structure of a vector space of dimension mn.
Matrix multiplication is more involved. For A of size m×n and B of size n×p, the product AB has size m×p, with each entry computed as the dot product of a row of A with a column of B: (AB)ij=∑k=1naikbkj. The number of columns of A must equal the number of rows of B; otherwise the product is undefined.
The transpose AT swaps rows and columns: (AT)ij=aji. An m×n matrix becomes n×m.
One property that distinguishes matrix arithmetic from ordinary arithmetic is that multiplication is not commutative. In general, AB=BA, even when both products are defined. This asymmetry has far-reaching consequences throughout linear algebra.
Special Matrix Shapes
Certain structural patterns appear so frequently that they have their own names and dedicated theory. A diagonal matrix has nonzero entries only on the main diagonal, making its arithmetic trivially simple — products, powers, and inverses all reduce to operations on the diagonal entries alone. The identity matrix I is the diagonal matrix with every diagonal entry equal to 1, serving as the multiplicative identity: AI=IA=A.
A symmetric matrix satisfies A=AT, meaning it is unchanged by transposition. Symmetric matrices have the remarkable property that all their eigenvalues are real and their eigenvectors can be chosen to be mutually orthogonal. A triangular matrix has all entries either above or below the diagonal equal to zero, making its determinant and eigenvalues readable directly from the diagonal.
An orthogonal matrix satisfies QTQ=I, meaning its columns form an orthonormal set and its transpose is its inverse. Orthogonal matrices preserve lengths and angles, making them the algebraic counterpart of rotations and reflections.
These and several other types — including skew-symmetric, nilpotent, idempotent, and permutation matrices — each carry structural guarantees that simplify computation and deepen understanding.
The Inverse of a Matrix
A square matrix A is called invertible if there exists a matrix A−1 satisfying AA−1=A−1A=I. When it exists, the inverse is unique and effectively "undoes" the action of A: if A maps x to b, then A−1 maps b back to x.
Not every square matrix has an inverse. The dividing line is the determinant: A is invertible if and only if det(A)=0. For a 2×2 matrix A=(acbd), the inverse has the explicit formula
A−1=ad−bc1(d−c−ba)
which breaks down precisely when ad−bc=0. For larger matrices, the inverse can be computed by row reduction or through the adjugate formula, though in practice solving Ax=b directly is almost always more efficient than computing A−1.
Rank and Trace
Two scalar quantities extracted from a matrix appear throughout linear algebra.
The rank of an m×n matrix is the number of linearly independent rows, which always equals the number of linearly independent columns. It measures the "effective dimensionality" of the matrix — how many of its rows or columns carry genuinely new information. The rank satisfies 0≤rank(A)≤min(m,n). When rank(A)=min(m,n), the matrix is said to have full rank, meaning no row or column is redundant.
The trace is defined only for square matrices: tr(A)=a11+a22+⋯+ann, the sum of the diagonal entries. Despite its simplicity, the trace encodes deep information. It equals the sum of the eigenvalues, it is invariant under changes of basis, and it satisfies the cyclic property tr(AB)=tr(BA), which makes it a fundamental tool in both theoretical and applied contexts.
Matrices and Systems of Equations
A system of m linear equations in n unknowns can be written compactly as
Ax=b
where A is the m×n coefficient matrix, x is the n×1 vector of unknowns, and b is the m×1 vector of right-hand sides. The augmented matrix [A∣b] appends b as an extra column, creating the compact representation used in Gaussian elimination.
Whether the system has no solution, exactly one solution, or infinitely many solutions depends entirely on the rank of A relative to the rank of the augmented matrix [A∣b]. When A is square and invertible, the unique solution is x=A−1b. When A is rectangular or singular, the analysis requires the rank and the structure of the null space.
Matrices as Linear Transformations
Every m×n matrix A defines a function from Rn to Rm by the rule x↦Ax. This function is a linear transformation: it preserves addition (A(x+y)=Ax+Ay) and scalar multiplication (A(cx)=cAx).
The columns of A reveal exactly what the transformation does to the standard basis. The first column a1 is the image of e1, the second column a2 is the image of e2, and so on. Once the images of the basis vectors are known, the image of any vector follows by linearity.
When A is square and invertible, the transformation is bijective — every output has exactly one input, and the inverse transformation is given by A−1. When A is singular, the transformation collapses at least one dimension, mapping Rn onto a proper subspace of Rm. The rank of A is the dimension of this image, and the null space captures everything that gets sent to zero.
This perspective transforms matrices from static tables of numbers into active geometric objects that rotate, stretch, compress, reflect, and project.