Canadian flagMath101 · Independent Ontario learning libraryCreated and edited by Kamran
Linear AlgebraUniversity3 min read

Matrix Multiplication

A precise explanation of matrix multiplication as composition, row–column pairing, and column combination.

Cheat sheet

Precise definition

If $A$ is $m\times n$ and $B$ is $n\times p$, then $AB$ is $m\times p$ with $(AB)_{ij}=\sum_{k=1}^n a_{ik}b_{kj}$. The inner dimensions must match. Multiplication is associative and distributive but generally not commutative.

Notation and mathematical language

Column $j$ of $AB$ is $A$ times column $j$ of $B$, hence a linear combination of $A$'s columns. As transformations, $AB$ represents applying $B$ first and then $A$ under compatible coordinate bases.

Conceptual picture

The row–column formula measures how an output coordinate of $A$ combines every intermediate coordinate supplied by $B$. This contraction of the shared index explains both the dimension rule and the order of composition.

Conditions and key results

$AB$ may exist while $BA$ does not; when both exist they may have different sizes or values. Cancellation requires invertibility conditions. A zero product does not imply either factor is zero for matrices.

A reliable strategy

  1. Write both shapes and confirm the first matrix's column count equals the second's row count.
  2. Predict the output shape before calculating entries.
  3. Compute each entry as one row–column dot product or each output column as $A$ times a column of $B$.
  4. Verify with transformation composition, identity behaviour, or a sample vector.

Fully worked example

Interpretation and application

Matrix products combine transformations, transition steps, network paths, and linear models. The order encodes process order and therefore carries substantive meaning rather than being a formatting choice.

Common mistakes

Verification and reasonableness

  • Confirm the result shape and recompute selected entries as dot products.
  • Test $(AB)x=A(Bx)$ on a simple vector.
  • Check identity products $AI=A$ and $IA=A$ with correctly sized identities.

Practice

  1. What is the shape of $(3\times4)(4\times2)$?
  2. Which map acts first in $ABx$?
  3. Is matrix multiplication commutative?
Answers and brief solutions
  1. $3\times2$.
  2. $B$.
  3. Not in general.

Further deduction

The $j$th column rule $ABe_j=A(Be_j)$ provides a compact verification: $Be_j$ selects column $j$ of $B$, and $A$ maps it to column $j$ of $AB$. It also shows $\operatorname{Col}(AB)\subseteq\operatorname{Col}(A)$ and hence $\operatorname{rank}(AB)\le\min(\operatorname{rank}A,\operatorname{rank}B)$.

Associativity, $(AB)C=A(BC)$, allows a product chain to be parenthesized for efficiency without changing its value. For shapes $A:m\times n$, $B:n\times p$, $C:p\times q$, the two orders can require very different operation counts. Factor order remains fixed; only parentheses may change.

Block multiplication can expose structure when partitions are compatible. If $A$ and $B$ are divided into conformable blocks, each output block is computed by the same row-by-column rule, treating submatrices as entries while preserving their order. A block-diagonal matrix therefore acts independently on corresponding coordinate groups. Invalid block sizes or commuting blocks cannot be assumed, so dimensions should be annotated before using this shortcut in coupled systems or transformations.

Noncommutativity is structural: a $90^\circ$ rotation followed by a reflection generally differs from reflecting first and then rotating. Both products may exist and have the same dimensions, so shape checks are necessary but not sufficient for interchanging factor order.

Explore the idea

Vector and matrix transform

Change one quantity at a time and connect what moves to Matrix Multiplication.

Works offline
A vector before and after a matrix transformationThe vector 2,1 is transformed to 3,1 by the displayed matrix.
What the model is showing Static example: [[1, 1], [0, 1]][2, 1] = [3, 1]. The determinant is 1, so oriented area is preserved and the transform is invertible.Open the 2×2 system workbench →
Check your understanding

Try it yourself

Hints are part of learning. Open one whenever it makes the next step feel possible.

1 practice question
Question 1Compute a product entry · Standard

For row $(2,3)$ and column $(4,5)^T$, what is their product entry?

End of lesson

Nice work making it this far.

Understanding grows through return visits. Save this lesson, try the practice, or continue when you are ready.

Lesson complete

That one is yours now.

Matrix Multiplication is saved to My Learning. Take the win—you earned it.

1Your Math101 collectionlesson completed
Search 464 published lessons, 123 answer guides, courses, and learning tools.
Your experience

Settings

Ontario math tutoringWork with KamranBook ↗