Definition 03 · Matrices

Matrix subtraction

Find the difference between two equally sized matrices by subtracting entries that occupy matching positions.

AB
Definition

The difference of two matrices with the same dimensions is the matrix formed by subtracting their corresponding entries.

The entrywise rule

Every entry keeps its row and column address. Subtraction is defined only when both matrices have exactly the same number of rows and columns.

Let A = [aij] and B = [bij].

A, B ∈ ℝm × n
A − B = [aij − bij]

(A − B)ij = aij − bij

A worked example

Select an entry in any matrix to trace the same position through the complete subtraction.

Matrix A
Matrix B
Difference
Position (1, 1): 7 − 3 = 4

Select any entry to trace its calculation

Subtraction is addition of an inverse

Matrix subtraction introduces no separate arithmetic machinery. Negate every entry of the second matrix, then use matrix addition.

A − B = A + (−B)

The additive inverse −B has the same dimensions as B, with every entry multiplied by −1. Adding it to A produces the same entrywise difference.

Key properties

Subtraction is related to addition, but its order and grouping matter. These rules prevent the most common algebraic mistakes.

A − B ≠ B − A

Not commutative. Reversing the matrices negates the result: B − A = −(A − B).

(A − B) − C ≠ A − (B − C)

Not associative. Parentheses determine which entries are negated before they are combined.

A − A = 0

Self-cancellation. Each entry minus itself is zero, producing the zero matrix of the same dimensions.

A − 0 = A

Zero on the right. Subtracting the matching zero matrix leaves every entry unchanged.

Dimensions must match

Subtraction pairs entries by address, so every position in the first matrix must have a corresponding position in the second.

Defined

(3 × 2) − (3 × 2)

Both matrices contain the same six row-column positions.

Not defined

(3 × 2) − (2 × 3)

The shapes differ, so the entries cannot be paired position by position.

Common pitfall. Keep the order fixed. In general, subtracting B from A is not the same as subtracting A from B.