Master the arithmetic of matrices: addition, multiplication, and transpose.
Before studying matrix multiplication, we define the simpler operations that make the space of matrices into a vector space.
Let and be matrices over . Their sum is:
Addition is performed entry-by-entry. Matrices must have the same dimensions to be added.
For and :
Each entry is multiplied by the scalar.
The set of all matrices over forms a vector space with:
These operations correspond to operations on linear maps. If represents and represents , then:
Matrix multiplication is defined to match composition of linear maps. This seemingly complex definition is exactly what makes work.
Let and . Their product is a matrix with:
The entry is the dot product of row of with column of .
For to be defined:
Let and with matrices and respectively. Then:
Let be bases for . For basis vector :
The coefficient of is .
Matrix multiplication satisfies:
Associativity: Follows from associativity of function composition: .
Distributivity: Follows from .
Alternatively, verify directly using the summation formula for matrix entries.
Matrix multiplication is NOT commutative! In general:
Several things can happen:
Let and .
Not only are and different, they have different dimensions!
The transpose of is :
Rows become columns and columns become rows.
For compatible matrices , and scalar :
Property 4: We verify that :
These are equal since multiplication in is commutative.
A square matrix is:
Any square matrix can be uniquely written as:
where is symmetric and is skew-symmetric:
The identity matrix has 1s on the diagonal and 0s elsewhere:
Property: for any matrix .
A diagonal matrix has non-zero entries only on the main diagonal:
For diagonal matrices and :
A scalar matrix is .
Key property: Scalar matrices commute with ALL matrices of the same size.
A matrix is:
Products of upper (lower) triangular matrices are upper (lower) triangular.
Problem: Show that .
Solution:
Problem: Expand .
Solution: Since and commute (), we can use the binomial theorem:
Problem: Find non-zero matrices , with .
Solution:
This shows matrices can have zero divisors—unlike real numbers!
Key insight: Column of equals times column of .
Each column of is a linear combination of columns of :
This means the column space of is contained in the column space of .
in general. Never assume you can swap the order of matrix multiplication. Formulas like are WRONG for matrices.
For , the COLUMNS of must match ROWS of . A common error is checking if both matrices are the same size.
, NOT . The order reverses! Same for inverse: .
does NOT imply . Cancellation fails because matrices can have non-trivial null spaces (zero divisors exist).
Matrix multiplication is NOT entry-by-entry. The formula involves summing products along rows and columns. Entry-wise product (Hadamard product) is a different operation.
For a polynomial and square matrix :
where and ( times).
For any polynomials and matrix :
Matrix polynomials in the same matrix always commute.
Since , powers of commute. Linearity extends this to all polynomials.
If , then for any polynomials .
— row of dotted with column of .
. Matrix multiplication IS composition of linear maps.
in general. Order matters! Only scalar matrices commute with everything.
. Transpose and inverse both reverse multiplication order.
| Property | Formula |
|---|---|
| Matrix Product Entry | |
| Associativity | |
| Distributivity | |
| Non-Commutativity | in general |
| Transpose of Product | |
| Identity | |
| Symmetric |
A block matrix (or partitioned matrix) is a matrix viewed as composed of smaller matrices (blocks):
where each is itself a matrix.
If and are partitioned compatibly, then:
The formula looks like scalar multiplication, but order matters within each term!
For block multiplication to work:
Block diagonal matrices have a particularly simple structure:
Block diagonal matrices form a subalgebra: sums and products of block diagonal matrices are block diagonal.
Matrix multiplication can be understood from multiple perspectives, each providing useful insights.
If where are the columns of , then:
Each column of is times the corresponding column of .
If where are the rows of , then:
Each row of is the corresponding row of times .
The column space of is contained in the column space of :
The row space of is contained in the row space of :
Matrix multiplication can also be written as a sum of outer products:
where is column of and is row of .
Problem: Show that is nilpotent.
Solution:
is nilpotent of index 3: but .
Problem: Show that projection matrices are idempotent ().
Solution: For projection onto the line :
Projecting twice is the same as projecting once.
Problem: Verify that is involutory ().
Solution:
This is the swap/reflection matrix. Reflecting twice returns to the original.
Problem: Solve for information about .
Solution: Factor: .
This means eigenvalues of are among .
If is diagonalizable, then where has only 1s and 2s on the diagonal.
The set of matrices forms a ring with:
Unlike the ring of integers or real numbers:
The trace function satisfies:
For the third property:
Relabeling indices shows these are equal.
Prove that for any . Conclude that there are no matrices with .
Prove that if commutes with every , then for some .
Let be nilpotent with . Show that .
If and are symmetric, when is symmetric? Prove that is symmetric if and only if .
Matrix operations directly correspond to operations on linear maps. This connection is the foundation of computational linear algebra.
If and , then:
Adding matrices corresponds to adding the linear maps they represent.
If and , then:
Matrix multiplication IS composition. The non-commutativity reflects that composition of maps is generally non-commutative.
If , then:
Scalar multiplication of the matrix corresponds to scalar multiplication of the map.
If is an isomorphism with , then:
The inverse map corresponds to the inverse matrix.
Problem 1
Compute .
Problem 2
Find matrices , such that but .
Problem 3
Show that for any matrix .
Problem 4
If (idempotent), show that .
Problem 5
Prove that if and are upper triangular, then is upper triangular.
Problem 6
Find the general form of all matrices that commute with .
Problem 7
Show that for any real matrix , with equality iff .
Problem 8
Compute where .
Before any multiplication, verify dimensions match. . The inner dimensions must be equal.
Visualize what the matrices do as transformations. Rotation, reflection, scaling—these help build intuition for why certain properties hold.
Remember: column of is times column of . This simplifies many proofs and computations.
Until you prove for specific matrices, always preserve order. Most algebraic identities from scalars need modification for matrices.
Cayley and Matrix Multiplication: Arthur Cayley introduced the modern definition of matrix multiplication in 1858. He recognized that it corresponds to composition of linear transformations, which is why the formula is more complex than entry-wise multiplication.
Non-Commutativity: The fact that was initially surprising to mathematicians used to commutative number systems. However, this mirrors the non-commutativity of geometric operations: rotating then reflecting differs from reflecting then rotating.
Notation: The notation for transpose was introduced later. Earlier texts used or . In physics, (dagger) denotes the conjugate transpose.
Computational Importance: Matrix multiplication is one of the most important operations in scientific computing. The naive algorithm was long believed optimal until Strassen discovered an algorithm in 1969.
Modern Applications: Today, matrix operations underpin virtually all of machine learning (neural networks are sequences of matrix multiplications), computer graphics (transformations), physics simulations, and data science.
When you multiply matrices , you're composing two geometric transformations:
This explains non-commutativity: rotating 90° then reflecting horizontally gives a different result than reflecting first then rotating.
The columns of show where the standard basis vectors land:
The entire transformation is determined by where it sends the basis vectors.
Geometrically, transpose reflects the matrix across its main diagonal. For symmetric matrices (), the matrix is unchanged by this reflection.
In inner product spaces, transpose relates to the adjoint: .
Now that you understand matrix operations, the next topics extend these foundations:
These topics complete our understanding of matrix algebra and prepare us for eigenvalue theory.
It's designed so that $[S \circ T] = [S][T]$—the matrix of a composition is the product of matrices. The row-column dot product formula follows directly from how coordinates transform under composition of linear maps.
Geometrically: rotate then reflect ≠ reflect then rotate. Algebraically: the composition of linear maps isn't commutative, and matrix multiplication represents composition. Even when both $AB$ and $BA$ are defined, they usually give different results.
They simplify large matrix computations and reveal structure. If matrices have compatible block partitions, you can multiply blocks like scalar entries (with care about order). Block diagonal matrices are particularly useful for decomposing problems.
Naive: $O(n^3)$. Best known (Coppersmith-Winograd variants): $O(n^{2.37...})$. In practice, optimized $O(n^3)$ algorithms (like Strassen's $O(n^{2.81})$) are often used due to lower constants.
Scalar matrices $\lambda I$ commute with everything. Diagonal matrices commute with each other. More generally, matrices commute if they share an eigenbasis—such matrices are simultaneously diagonalizable.
Think of it as 'reversing the path.' Transposing swaps rows and columns. When you transpose a product, the roles of 'taking rows of A' and 'taking columns of B' get swapped, which reverses the multiplication order.
Yes! These are called zero divisors. For example, if $A$ has a non-trivial null space and $B$'s columns lie in that null space, then $AB = 0$ even though $A, B \neq 0$. This is fundamentally different from real number multiplication.
If $p(x) = a_n x^n + \cdots + a_1 x + a_0$, then $p(A) = a_n A^n + \cdots + a_1 A + a_0 I$. Matrix polynomials are central to the Cayley-Hamilton theorem and matrix functions.
The identity matrix $I$ satisfies $AI = IA = A$ for any compatible matrix $A$. It represents the identity linear map. In matrix multiplication, it plays the role that 1 plays in number multiplication.
For each entry $(i,j)$ of the result, compute the dot product of row $i$ of the first matrix with column $j$ of the second. Organize your work systematically and double-check dimensions first.