Matrix Multiplication Formula

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

The Formula

(AB)ij=k=1naikbkj(AB)_{ij} = \sum_{k=1}^{n} a_{ik} \cdot b_{kj}

When to use: Imagine each row of AA as a question and each column of BB as an answer key. You 'grade' each row against each column by multiplying corresponding entries and summing. This is why column count of AA must match row count of BB—the question and answer key must have the same length.

Quick Example

[1234][5678]=[15+2716+2835+4736+48]=[19224350]\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} = \begin{bmatrix} 1 \cdot 5 + 2 \cdot 7 & 1 \cdot 6 + 2 \cdot 8 \\ 3 \cdot 5 + 4 \cdot 7 & 3 \cdot 6 + 4 \cdot 8 \end{bmatrix} = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}

Notation

ABAB means multiply AA by BB (row-by-column). Dimensions: (m×n)(n×p)=(m×p)(m \times n)(n \times p) = (m \times p). The inner dimensions must match.

What This Formula Means

Multiplying matrices AA (m×nm \times n) and BB (n×pn \times p) by taking dot products of rows of AA with columns of BB to produce an m×pm \times p result.

Imagine each row of AA as a question and each column of BB as an answer key. You 'grade' each row against each column by multiplying corresponding entries and summing. This is why column count of AA must match row count of BB—the question and answer key must have the same length.

Formal View

For ARm×nA \in \mathbb{R}^{m \times n}, BRn×pB \in \mathbb{R}^{n \times p}: (AB)ij=k=1naikbkj(AB)_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj}, yielding ABRm×pAB \in \mathbb{R}^{m \times p}. Matrix multiplication is associative (A(BC)=(AB)C)(A(BC) = (AB)C) but not commutative (ABBAAB \neq BA in general).

Worked Examples

Example 1

medium
Compute [1234][5678]\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}.

Answer

[19224350]\begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}

First step

1
Step 1: Entry (1,1)(1,1): 15+27=5+14=191 \cdot 5 + 2 \cdot 7 = 5 + 14 = 19.

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

SetupKey insightWhy it worksCommon pitfallConnection

Unlock answer keys One Family plan — every worked solution, all subjects

Example 2

hard
Compute [201132][141]\begin{bmatrix} 2 & 0 & -1 \\ 1 & 3 & 2 \end{bmatrix} \begin{bmatrix} 1 \\ 4 \\ -1 \end{bmatrix}.

Example 3

challenge
Use the Fibonacci matrix identity Fn=(Fn+1FnFnFn1)F^n=\begin{pmatrix} F_{n+1} & F_n \\ F_n & F_{n-1} \end{pmatrix} and Fm+n=FmFnF^{m+n}=F^m F^n to derive an identity relating Fm+nF_{m+n} to Fm,Fm1,Fn,Fn+1F_m, F_{m-1}, F_n, F_{n+1}.

Common Mistakes

  • Multiplying when inner dimensions disagree — (2×3)(2×2)(2\times3)(2\times2) is undefined; the inner numbers must match.
  • Assuming AB=BAAB=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

It is the operation behind composing linear transformations, applying a system, and inverse matrices, and it is famously non-commutative — ABBAAB\neq BA in general — which reshapes how students think about multiplication. Recognizing it by "Does the column count of AA equal the row count of BB, and am I dotting rows with columns?" — rather than by familiar numbers — is what lets a student tell it apart from matrix addition and scalar multiplication and dot product (vectors) in a mixed problem set.

Frequently Asked Questions

What is the Matrix Multiplication formula?

Multiplying matrices AA (m×nm \times n) and BB (n×pn \times p) by taking dot products of rows of AA with columns of BB to produce an m×pm \times p result.

How do you use the Matrix Multiplication formula?

Imagine each row of AA as a question and each column of BB as an answer key. You 'grade' each row against each column by multiplying corresponding entries and summing. This is why column count of AA must match row count of BB—the question and answer key must have the same length.

What do the symbols mean in the Matrix Multiplication formula?

ABAB means multiply AA by BB (row-by-column). Dimensions: (m×n)(n×p)=(m×p)(m \times n)(n \times p) = (m \times p). The inner dimensions must match.

Why is the Matrix Multiplication formula important in Math?

It is the operation behind composing linear transformations, applying a system, and inverse matrices, and it is famously non-commutative — ABBAAB\neq BA in general — which reshapes how students think about multiplication. Recognizing it by "Does the column count of AA equal the row count of BB, and am I dotting rows with columns?" — rather than by familiar numbers — is what lets a student tell it apart from matrix addition and scalar multiplication and dot product (vectors) in a mixed problem set.

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 AA equal the row count of BB, 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.

Want the Full Guide?

This formula is covered in depth in our complete guide:

Solving Systems of Equations: Substitution, Elimination, and Matrices →