Matrix Multiplication Formula

Matrix multiplication is multiplying matrices A (m × n) and B (n × p) by taking dot products of rows of A with columns of B to produce an m × p result.

The Formula

(AB)ij=∑k=1naik⋅bkj

Ask yourself: Does the column count of A equal the row count of B, and am I dotting rows with columns?

Quick example

[1234][5678]=[1⋅5+2⋅71⋅6+2⋅83⋅5+4⋅73⋅6+4⋅8]=[19224350]

Notation

AB means multiply A by B (row-by-column). Dimensions: (m×n)(n×p)=(m×p). The inner dimensions must match.

What this formula means

Multiplying matrices A (m×n) and B (n×p) by taking dot products of rows of A with columns of B to produce an m×p result.

Matrix multiplication works like a shop checkout: each row of A is one customer's basket, each column of B is a price list, and each entry of AB is one basket rung up on one price list. The basket and the price list must cover the same items, which is the inner-size rule. The picture does not explain why BA differs from AB; swapping the order changes which matrix plays the baskets.

Formal view

For A∈Rm×n, B∈Rn×p: (AB)ij=∑k=1naikbkj, yielding AB∈Rm×p. Matrix multiplication is associative (A(BC)=(AB)C) but not commutative (AB≠BA in general).

Worked examples

Example 1

medium
Compute [1234][5678].
Show solution

Answer

[19224350]

First step

1.
Step 1: Entry (1,1): 1⋅5+2⋅7=5+14=19.

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Free: full solutions on 3 topics a day. No card.

Every topic, every day: the Family plan

Example 2

hard
Compute [20−1132][14−1].

Example 3

challenge
Use the Fibonacci matrix identity Fn=(Fn+1FnFnFn−1) and Fm+n=FmFn to derive an identity relating Fm+n to Fm,Fm−1,Fn,Fn+1.

Common mistakes

  • Multiplying when inner dimensions disagree — (2×3)(2×2) is undefined; the inner numbers must match.
  • Assuming AB=BA — matrix multiplication is generally non-commutative, so order matters.
  • Multiplying entrywise — each result entry is a row-by-column SUM of products, not a single product.

Why this formula matters

Matrix multiplication packs many separate sums of products into one operation: order quantities times unit prices give every customer's bill at once, and a whole system of equations becomes the single statement Ax=b. Rotations and stretches combine by multiplying their matrices. Treating it like ordinary multiplication causes the classic errors: multiplying entry by entry, multiplying mismatched sizes, or assuming AB=BA.

Frequently asked questions

What is the Matrix Multiplication formula?

Multiplying matrices A (m×n) and B (n×p) by taking dot products of rows of A with columns of B to produce an m×p result.

How do you use the Matrix Multiplication formula?

Use it when one table's columns line up with another table's rows: quantities times prices, or a coefficient matrix times a column of unknowns as in Ax=b. It also composes transformations: doing B and then A is the single matrix AB. Check the inner dimensions first. If the matrices have the same size and you want totals or differences position by position, add or subtract instead; if one factor is a single number, it is a scalar multiple.

What do the symbols mean in the Matrix Multiplication formula?

AB means multiply A by B (row-by-column). Dimensions: (m×n)(n×p)=(m×p). The inner dimensions must match.

Why is the Matrix Multiplication formula important in Math?

Matrix multiplication packs many separate sums of products into one operation: order quantities times unit prices give every customer's bill at once, and a whole system of equations becomes the single statement Ax=b. Rotations and stretches combine by multiplying their matrices. Treating it like ordinary multiplication causes the classic errors: multiplying entry by entry, multiplying mismatched sizes, or assuming AB=BA.

What do students get wrong about Matrix Multiplication?

The procedure for matrix multiplication is the easy part; the trap is multiplying when inner dimensions disagree. Asking "Does the column count of A equal the row count of B, and am I dotting rows with columns?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

What should I learn before the Matrix Multiplication formula?

Before studying the Matrix Multiplication formula, you should understand: matrix operations, matrix definition.

The full guide

This formula is covered in depth in Solving Systems of Equations: Substitution, Elimination, and Matrices.