← Back to Linear Algebra

Matrix operations and multiplication

Matrices are rectangular arrays of numbers that can be added, scaled, and multiplied. Matrix multiplication, which composes transformations, is the operation that makes linear algebra powerful.

Matrices and notation

An m x n matrix has m rows and n columns; \(a_{ij}\) is the entry in row i, column j. Square matrices have m = n. The main diagonal holds \(a_{11}, a_{22}, \dots\). The identity matrix \(I_n\) has 1s on the diagonal and 0s elsewhere; the zero matrix has all entries 0. Diagonal and triangular matrices have zeros off the diagonal or on one side of it.

Addition and scalar multiples

Matrices of the same size add entry by entry, and a scalar multiplies every entry. These operations obey the usual rules: A + B = B + A, (A + B) + C = A + (B + C), and c(A + B) = cA + cB. The set of all m x n matrices forms a vector space of dimension mn.

Matrix multiplication by columns

If A is m x n and B is n x p, the product AB is m x p, and its jth column is A times the jth column of B: \(AB = [A\mathbf{b}_1 \ \cdots \ A\mathbf{b}_p]\). So each column of AB is a linear combination of A's columns, weighted by the entries of the corresponding column of B. The inner dimensions must match: a 2 x 3 matrix can multiply a 3 x 4, giving 2 x 4.

The row-column rule

Entry (i, j) of AB is the dot product of row i of A with column j of B: \((AB)_{ij} = \sum_k a_{ik}b_{kj}\). For \(A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\) and \(B = \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}\), the top-left entry of AB is \(1 \cdot 5 + 2 \cdot 7 = 19\), and the full product has rows (19, 22) and (43, 50).

Properties of multiplication

Matrix multiplication is associative, A(BC) = (AB)C, and distributes over addition, and AI = IA = A. But it is not commutative: in general AB is not equal to BA, and BA may not even be defined. Also AB = 0 does not imply A = 0 or B = 0, and AB = AC does not imply B = C. These differences from ordinary numbers cause many beginner errors.

Why multiplication is defined this way

Matrix multiplication represents composing linear transformations: if B transforms vectors and then A transforms the results, the combined transformation is AB, applied to x as A(Bx). This is why order matters, since rotating then reflecting differs from reflecting then rotating, and why associativity holds.

Powers and the transpose

For square A, \(A^2 = AA\), \(A^3 = AAA\), and so on; powers model repeated processes such as population changes each year. The transpose \(A^T\) swaps rows and columns: \((A^T)_{ij} = a_{ji}\). Key rules: \((A^T)^T = A\), \((A + B)^T = A^T + B^T\), and \((AB)^T = B^TA^T\), with the order reversed. A matrix with \(A^T = A\) is symmetric.

Worked example

With A and B as above, \(BA\) has rows \((5 + 18, 10 + 24) = (23, 34)\) and \((7 + 24, 14 + 32) = (31, 46)\). Comparing with AB, rows (19, 22) and (43, 50), shows \(AB \ne BA\). The transpose of AB has rows (19, 43) and (22, 50), which equals \(B^TA^T\), confirming the reversed-order rule.

Key takeaways

An m x n matrix has entries a_ij; identity, zero, diagonal, and triangular matrices are special forms. Same-size matrices add entrywise and scale by scalars, forming a vector space of dimension mn. AB requires A's columns to match B's rows; each column of AB is A times a column of B, and entries follow the row-column rule. Multiplication is associative and distributive but not commutative, and products can be zero without either factor being zero. Multiplication composes transformations. Powers model repetition; the transpose swaps rows and columns, with (AB)^T = B^T A^T.

Flashcard

m x n matrix

m rows, n columns

a_ij entries.

Check your understanding

If A is 3 x 2 and B is 2 x 5, what is the size of AB, and is BA defined?

← Previous lesson Next lesson →