How to multiply matrices

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: Matrix multiplication is a binary operation that produces a new matrix from two matrices. For two matrices A (m x n) and B (n x p) to be multiplied, the number of columns in A must equal the number of rows in B. The resulting matrix C will have dimensions m x p, and each element C_ij is calculated by taking the dot product of the i-th row of A and the j-th column of B.

Key Facts

Overview

Matrix multiplication is a fundamental operation in linear algebra with applications ranging from computer graphics and data analysis to physics and engineering. Unlike scalar multiplication (multiplying a matrix by a single number), matrix multiplication involves combining two matrices to produce a third. This operation is not as straightforward as adding or subtracting matrices; it follows a specific set of rules that dictate which matrices can be multiplied and how the resulting matrix is formed.

The core concept revolves around the compatibility of dimensions and a systematic process of calculation. Understanding this process is crucial for anyone working with mathematical models, transformations, or large datasets where matrices are commonly used to represent complex relationships.

What are Matrices?

Before diving into multiplication, it's essential to understand what a matrix is. A matrix is a rectangular array of numbers, symbols, or expressions, arranged in rows and columns. For example:

$$ A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} $$

The dimensions of a matrix are described by the number of rows and columns it has. The matrix A above is a 2x2 matrix (2 rows, 2 columns). The matrix B above is also a 2x2 matrix.

Conditions for Matrix Multiplication

The most critical rule for multiplying two matrices, say matrix A and matrix B, is that the number of columns in the first matrix (A) must be equal to the number of rows in the second matrix (B). If A has dimensions $m \times n$ (m rows, n columns) and B has dimensions $p \times q$ (p rows, q columns), then multiplication $A \times B$ is only possible if $n = p$.

If this condition is met, the resulting matrix, let's call it C, will have dimensions corresponding to the outer dimensions of A and B: $m \times q$.

For example:

How to Perform Matrix Multiplication (The Process)

Once you've confirmed that the matrices can be multiplied, the calculation of each element in the resulting matrix C involves a specific procedure. To find the element in the i-th row and j-th column of C (denoted as $C_{ij}$), you perform the following steps:

  1. Take the i-th row of matrix A.
  2. Take the j-th column of matrix B.
  3. Multiply the first element of the i-th row of A by the first element of the j-th column of B.
  4. Multiply the second element of the i-th row of A by the second element of the j-th column of B.
  5. Continue this for all corresponding elements in the row and column.
  6. Sum up all these products. This sum is the value of $C_{ij}$.

This process is repeated for every element in the resulting matrix C.

Example Calculation

Let's multiply the matrices A and B from our earlier example:

$$ A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \quad B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} $$

Both are 2x2 matrices, so the number of columns in A (2) equals the number of rows in B (2). The resulting matrix C will be 2x2.

Let's find $C_{11}$ (the element in the 1st row, 1st column):

Let's find $C_{12}$ (the element in the 1st row, 2nd column):

Let's find $C_{21}$ (the element in the 2nd row, 1st column):

Let's find $C_{22}$ (the element in the 2nd row, 2nd column):

Therefore, the resulting matrix C is:

$$ C = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix} $$

Important Properties of Matrix Multiplication

Matrix multiplication has several key properties that are important to remember:

Applications in Daily Life

While matrix multiplication might seem abstract, it underpins many technologies we use daily:

Understanding how to multiply matrices provides a foundational skill for comprehending these advanced applications and for tackling problems involving transformations and data representation.

Sources

  1. Matrix multiplication - WikipediaCC-BY-SA-4.0
  2. 3.02: Matrix Multiplication - LibreTextsCC BY-NC-SA 3.0
  3. Matrix multiplication (article) | Khan Academyfair-use

Missing an answer?

Suggest a question and we'll generate an answer for it.