Matrices

⚡ Key Takeaways

A matrix is a rectangular array of numbers arranged in rows and columns, written A=[aij]A = [a_{ij}]. Matrices encode and manipulate systems of linear equations, geometric transformations, and data tables. They are added entrywise but multiplied by a special row-times-column rule that is not commutative. Used everywhere from computer graphics to economics; the modern theory was crystallized by Arthur Cayley in 1858.

💡 The Core Insight

A matrix is simultaneously two things: a static table of data and a dynamic operation. The single rule of matrix multiplication — "each entry is a row dotted with a column" — is the mechanism that lets a matrix act on vectors, compose transformations, and solve equations all at once. Master that one rule and most of the subject follows.

Formal Statement

DefinitionMatrix and Basic Notation

An m×nm \times n matrix AA over the real numbers is an array

1
A=[a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮am1am2⋯amn]\quad A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix}

Derivation hint: this is a definition — note aija_{ij} sits in row ii, column jj; the row index always comes first. Here mm is the number of rows, nn the number of columns, and aij∈Ra_{ij} \in \mathbb{R} is the entry in row ii, column jj. The pair (m,n)(m,n) is the order or dimension. A matrix with m=nm=n is square. A 1×n1 \times n matrix is a row vector; an m×1m \times 1 matrix is a column vector.

DefinitionAddition and Scalar Multiplication

For two m×nm \times n matrices A=[aij]A = [a_{ij}] and B=[bij]B = [b_{ij}], and a scalar λ∈R\lambda \in \mathbb{R}:

2
(A+B)ij=aij+bij,(λA)ij=λ aij\quad (A+B)_{ij} = a_{ij} + b_{ij}, \qquad (\lambda A)_{ij} = \lambda\, a_{ij}

Derivation hint: addition and scalar multiplication act entrywise; both matrices must have identical order to be added.

DefinitionMatrix Multiplication

If AA is m×nm \times n and BB is n×pn \times p, then the product C=ABC = AB is the m×pm \times p matrix with entries

3
cij=∑k=1naik bkj\quad c_{ij} = \sum_{k=1}^{n} a_{ik}\, b_{kj}

Derivation hint: the (i,j)(i,j) entry is the dot product of row ii of AA with column jj of BB; the "inner" dimensions nn must match. The number of columns of AA must equal the number of rows of BB for the product to be defined.

DefinitionIdentity and Inverse

The n×nn \times n identity matrix InI_n has 1's on the main diagonal and 0's elsewhere: (In)ij=δij(I_n)_{ij} = \delta_{ij} (the Kronecker delta). A square matrix AA is invertible (nonsingular) if there exists A−1A^{-1} with

4
AA−1=A−1A=In\quad A A^{-1} = A^{-1} A = I_n

Derivation hint: the inverse undoes AA; it exists precisely when det⁡A≠0\det A \neq 0 (see below).

TheoremDeterminant of a 2×2 Matrix and Inverse Criterion

For A=[abcd]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}, the determinant is

5
det⁡A=ad−bc\quad \det A = ad - bc

Derivation hint: it is the signed area of the parallelogram spanned by the columns (a,c)(a,c) and (b,d)(b,d). AA is invertible if and only if det⁡A≠0\det A \neq 0, and then

6
A−1=1ad−bc[d−b−ca]\quad A^{-1} = \frac{1}{ad-bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

Derivation hint: verify AA−1=IAA^{-1}=I directly by multiplying; the swap of a,da,d and sign flips on b,cb,c come from solving AX=IAX=I.

Why It Holds / Derivation

ProofWhy the 2×2 Inverse Formula Works

We seek X=[xyzw]X = \begin{bmatrix} x & y \\ z & w \end{bmatrix} with AX=I2AX = I_2.

Step 1. Write out AX=IAX = I using rule [3]:

7
[ax+bzay+bwcx+dzcy+dw]=[1001]\quad \begin{bmatrix} ax+bz & ay+bw \\ cx+dz & cy+dw \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}

Derivation hint: multiply row-by-column and set equal to the identity entry by entry.

Step 2. This gives two independent 2×22\times 2 systems:

8
ax+bz=1,    cx+dz=0anday+bw=0,    cy+dw=1\quad ax+bz=1,\;\; cx+dz=0 \quad\text{and}\quad ay+bw=0,\;\; cy+dw=1

Derivation hint: the first column of II determines x,zx,z; the second column determines y,wy,w.

Step 3. Solve the first system by elimination. From cx+dz=0cx+dz=0 we get z=−cx/dz = -cx/d (assuming d≠0d\neq 0); substituting and clearing gives x=d/(ad−bc)x = d/(ad-bc) and z=−c/(ad−bc)z = -c/(ad-bc).

Step 4. Solving the second system identically yields y=−b/(ad−bc)y = -b/(ad-bc), w=a/(ad−bc)w = a/(ad-bc). Assembling XX gives formula [6]. The division by ad−bcad-bc shows the inverse exists exactly when det⁡A≠0\det A \neq 0. ■\blacksquare

∎
mathematician · Arthur Cayley | 1821–1895

The English mathematician Arthur Cayley founded the abstract theory of matrices in his 1858 Memoir on the Theory of Matrices, where he first treated a matrix as a single algebraic object with its own arithmetic — defining addition, multiplication, and inverses. He recognized that matrix multiplication is non-commutative and stated (verifying for 2×22\times2 and 3×33\times3) what is now the Cayley–Hamilton theorem: every square matrix satisfies its own characteristic equation. A lawyer for fourteen years who published over 200 papers in his spare time before taking a Cambridge chair, Cayley also developed invariant theory and contributed to group theory and geometry.

Building Intuition

🧠 Intuition

Think of a matrix as a machine that transforms vectors. Feed in a column vector x\mathbf{x}, and AxA\mathbf{x} comes out as a new vector — possibly rotated, stretched, sheared, or projected. The columns of AA tell you exactly where the basis vectors land: column jj is the image of the jj-th unit vector. Multiplying two matrices ABAB means "do BB first, then AA" — composing two transformations into one. This is why order matters: rotating then reflecting is generally different from reflecting then rotating. Addition, by contrast, is gentle and commutative because it just superimposes two tables entry by entry.

Figure
A matrix as a transformation: the unit square mapped by a shear matrix

```svg

x y unit square A·(square) e₁→(1,0) e₂→(1,1) A = [ 1 1 ; 0 1 ] (shear) columns = images of e₁, e₂

```

Worked Examples

ExampleMultiplying Two Matrices

Given: A=[2103]A = \begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix} and B=[1452]B = \begin{bmatrix} 1 & 4 \\ 5 & 2 \end{bmatrix}. Compute ABAB.

Step 1 — check dimensions. AA is 2×22\times2, BB is 2×22\times2; inner dimensions match, so ABAB is 2×22\times2.

Step 2 — apply rule [3], each entry = row · column.

  • (AB)11=(2)(1)+(1)(5)=2+5=7(AB)_{11} = (2)(1)+(1)(5) = 2+5 = 7
  • (AB)12=(2)(4)+(1)(2)=8+2=10(AB)_{12} = (2)(4)+(1)(2) = 8+2 = 10
  • (AB)21=(0)(1)+(3)(5)=0+15=15(AB)_{21} = (0)(1)+(3)(5) = 0+15 = 15
  • (AB)22=(0)(4)+(3)(2)=0+6=6(AB)_{22} = (0)(4)+(3)(2) = 0+6 = 6

Step 3 — assemble.

AB=[710156]\boxed{AB = \begin{bmatrix} 7 & 10 \\ 15 & 6 \end{bmatrix}}

(Check non-commutativity: computing BABA gives [2131011]≠AB\begin{bmatrix} 2 & 13 \\ 10 & 11 \end{bmatrix} \neq AB.)

ExampleInverting a Matrix and Solving a System

Given: Solve {3x+2y=8x+4y=6\begin{cases} 3x + 2y = 8 \\ x + 4y = 6 \end{cases} using a matrix inverse.

Step 1 — write as Ax=bA\mathbf{x}=\mathbf{b}. A=[3214]A = \begin{bmatrix} 3 & 2 \\ 1 & 4 \end{bmatrix}, b=[86]\mathbf{b} = \begin{bmatrix} 8 \\ 6 \end{bmatrix}.

Step 2 — determinant (eq [5]). det⁡A=(3)(4)−(2)(1)=12−2=10≠0\det A = (3)(4)-(2)(1) = 12-2 = 10 \neq 0, so A−1A^{-1} exists.

Step 3 — inverse (eq [6]).

A−1=110[4−2−13]A^{-1} = \frac{1}{10}\begin{bmatrix} 4 & -2 \\ -1 & 3 \end{bmatrix}

Step 4 — multiply x=A−1b\mathbf{x} = A^{-1}\mathbf{b}.

x=110[4−2−13][86]=110[32−12−8+18]=110[2010]\mathbf{x} = \frac{1}{10}\begin{bmatrix} 4 & -2 \\ -1 & 3 \end{bmatrix}\begin{bmatrix} 8 \\ 6 \end{bmatrix} = \frac{1}{10}\begin{bmatrix} 32-12 \\ -8+18 \end{bmatrix} = \frac{1}{10}\begin{bmatrix} 20 \\ 10 \end{bmatrix}
x=2,y=1\boxed{x = 2, \quad y = 1}

(Check: 3(2)+2(1)=83(2)+2(1)=8 ✓ and 1(2)+4(1)=61(2)+4(1)=6 ✓.)

Common Misconceptions

⚠️ Common mistake

Matrix multiplication is NOT commutative. In general AB≠BAAB \neq BA, and sometimes only one product is even defined (a 2×32\times3 times a 3×43\times4 works one way only). Never "cancel" or reorder factors freely. Likewise, there is no matrix division — you multiply by an inverse, and you must be careful whether it goes on the left (A−1BA^{-1}B) or the right (BA−1BA^{-1}), since these differ.

Counterexample

The familiar fact "if xy=0xy = 0 then x=0x=0 or y=0y=0" fails for matrices. Take

A=[1000],B=[0001].A = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}, \qquad B = \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}.

Then AB=[0000]AB = \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}, the zero matrix, even though neither AA nor BB is zero. These are zero divisors; both have determinant 00, so neither is invertible — which is exactly why the cancellation law breaks.

Connections

connection

Matrices are the computational engine behind nearly all of Linear Algebra. Each matrix represents a Linear Transformations once bases are chosen, with its columns giving the images of basis vectors. The Determinant measures how a matrix scales area/volume and detects invertibility. Solving Ax=bA\mathbf{x}=\mathbf{b} is the matrix form of Systems of Linear Equations, usually carried out by Gaussian Elimination rather than computing inverses. The deeper structure of a square matrix is captured by its Eigenvalues and Eigenvectors, which reveal directions that the matrix merely stretches. Matrices also realize the abstract notion of a Vector Spaces of linear maps under addition and composition.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- c. 200 BCE: The Chinese text Nine Chapters on the Mathematical Art solves linear systems with a method essentially equivalent to Gaussian elimination on a numerical array.
- 1683: Seki Takakazu in Japan and, independently, 1693 Gottfried Leibniz in Europe introduce determinants to analyze systems of equations.
- 1750: Gabriel Cramer publishes Cramer's Rule, expressing solutions of linear systems via determinants.
- 1812: Augustin-Louis Cauchy proves the multiplicative property det⁡(AB)=det⁡A⋅det⁡B\det(AB) = \det A \cdot \det B and systematizes determinant theory.
- 1844–1850: James Joseph Sylvester coins the word "matrix" (Latin for "womb"), viewing it as the array from which determinants (minors) are born.
- 1858: Arthur Cayley's Memoir on the Theory of Matrices establishes matrix algebra as an independent subject and states the Cayley–Hamilton theorem.
- 1878: Ferdinand Georg Frobenius develops the theory of canonical forms, rank, and the characteristic polynomial rigorously.
- 1925: Werner Heisenberg, Max Born, and Pascual Jordan formulate matrix mechanics, the first complete version of quantum theory, founded on non-commuting matrices.
- 1947–present: John von Neumann, Alan Turing, and others develop numerical linear algebra (LU decomposition, condition numbers), making matrices the workhorse of digital computation.

Subtleties & Limits

open-problem

Computing matrix products fast is a surprisingly deep open question. The schoolbook rule [3] costs about n3n^3 multiplications for n×nn\times n matrices. In 1969 Volker Strassen shocked everyone by doing it in roughly n2.807n^{2.807} operations, and successive refinements (Coppersmith–Winograd and beyond) have pushed the exponent below 2.3722.372. But the true minimal exponent ω\omega — the smallest number such that multiplication is possible in nω+εn^{\omega+\varepsilon} time — is unknown; many conjecture ω=2\omega = 2, which would be essentially optimal, but no proof exists. Separately, the numerical stability of inversion is subtle: nearly-singular matrices (small but nonzero determinant) amplify rounding errors dramatically, quantified by the condition number, so in practice one almost never forms A−1A^{-1} explicitly.

See Also

Linear Algebra · Determinant · Systems of Linear Equations · Eigenvalues and Eigenvectors · Linear Transformations · Gaussian Elimination · Vectors · Vector Spaces