How to multiply matrices, step by step
5 min read
Short answer
To multiply by , each entry of is the dot product of a row of with a column of . The product exists only if the number of columns of equals the number of rows of , and the order matters: in general .
Check the sizes first
Write the sizes next to each other: an matrix times an matrix. If the two inner numbers are equal, the product exists and has the outer size, . If they differ, stop: the product is undefined.
The row-times-column rule
Entry of is Walk along row of and down column of , multiply the pairs and add. Fill the answer one cell at a time, row by row.
A useful way to read the result: each column of is applied to the matching column of . That is why matrix multiplication corresponds to doing one transformation after another.
Worked example
Compute and for and .
. Row 1 of with column 1 of : . Row 1 with column 2: . Row 2 with column 1: . Row 2 with column 2: .
. The same procedure gives
swaps things: on the right of it swaps the columns, on the left it swaps the rows. So , even for 2×2 matrices.
Try it yourself
Is the product defined? If so, compute it: .
Show the answer
Sizes are 2×3 and 3×2, so the inner numbers match and the answer is 2×2. Row 1: and . Row 2: and . The product is .
Keep going with practice
Vidi's Linear Algebra & Probability course includes a matrix calculator (determinant, inverse, rank, row reduction) so you can check your own work.