The Operation That Only Works When Things Line Up
Subtracting two matrices is nothing more than subtracting the numbers that line up. Two grids of numbers sit side by side, and you take away each entry from the one in the matching slot. The catch is the lining up: if the two grids are not the same shape, there is nothing to line up, and the subtraction has no meaning at all.
That single condition, same order, is what the whole operation hangs on. Get it, and everything else is just careful arithmetic.
What Is Subtraction Of Matrices?
Subtraction of matrices is the operation that takes two matrices of the same order and produces a new matrix by subtracting each entry of the second from the corresponding entry of the first. A matrix is a rectangular array of numbers arranged in rows and columns, and the order of a matrix is its size written as $\text{rows} \times \text{columns}$.
If $A = [a_{ij}]$ and $B = [b_{ij}]$ are both of order $m \times n$, then their difference $A - B$ is the $m \times n$ matrix whose entry in each position is
$$(A - B){ij} = a{ij} - b_{ij}, \quad \text{for all } i \in {1, 2, \dots, m} \text{ and } j \in {1, 2, \dots, n}.$$
There is a second, equivalent way to see it. Subtraction is addition of a negative:
$$A - B = A + (-B),$$
where $-B$ is the matrix with every entry of $B$ negated. This links matrix subtraction directly to addition of matrices, which is the same element-wise idea with a plus sign.
What Is The Condition For Subtracting Matrices?
The two matrices must have the same order - the same number of rows and the same number of columns. If the orders differ, the subtraction is not defined, because some entries would have no partner to subtract.
Can you subtract two matrices of different orders? No. A $2 \times 2$ matrix cannot be subtracted from a $2 \times 3$ matrix; the extra column in the second has nothing to line up against in the first. The result of $A - B$ keeps the shared order: subtract two $3 \times 3$ matrices and the answer is $3 \times 3$. Checking the order of a matrix is always the first move.
How Do You Subtract Two Matrices?
The method is the same at every size, and it comes down to three steps.
Step 1 - Confirm the orders match. If they differ, stop; the operation is undefined.
Step 2 - Subtract matching entries. For every position $(i, j)$, compute $a_{ij} - b_{ij}$.
Step 3 - Place each result in the same position. The differences form the answer matrix, of the same order.
For a $2 \times 2$ example, let
$$A = \begin{bmatrix} 7 & 5 \ 4 & 9 \end{bmatrix}, \qquad B = \begin{bmatrix} 2 & 1 \ 3 & 6 \end{bmatrix}.$$
Subtract entry by entry:
$$A - B = \begin{bmatrix} 7 - 2 & 5 - 1 \ 4 - 3 & 9 - 6 \end{bmatrix}$$
$$A - B = \begin{bmatrix} 5 & 4 \ 1 & 3 \end{bmatrix}.$$
The same routine scales to a $3 \times 3$, a $3 \times 4$, or any matching pair, and it connects naturally to the other operations covered in properties of matrices.
What Are The Properties Of Subtraction Of Matrices?
Matrix subtraction behaves like ordinary subtraction in some ways and breaks from it in others. Assume all matrices below share the same order.
Not commutative. $A - B \neq B - A$ in general. Reversing the order negates every entry, so the two results differ unless $A = B$.
Not associative. $(A - B) - C \neq A - (B - C)$ in general.
Subtracting a matrix from itself gives the zero matrix. $A - A = O$, where $O$ has every entry $0$.
Subtracting the zero matrix changes nothing. $A - O = A$.
Addition of a negative. $A - B = A + (-B)$, the definition restated as a property.
Scalar distributes over subtraction. For any scalar $k$, $; k(A - B) = kA - kB$.
The non-commutative and non-associative properties are the ones that surprise students, because plain-number subtraction feels flexible until the matrix version refuses to reorder.
Examples Of Subtraction Of Matrices
The set runs from a plain $2 \times 2$ difference, through the order-mismatch trap, to a $3 \times 3$, the addition-of-negative view, a non-commutativity check, and solving a matrix equation.
Example 1
Subtract $B$ from $A$, where $A = \begin{bmatrix} 8 & 3 \ 6 & 5 \end{bmatrix}$ and $B = \begin{bmatrix} 2 & 1 \ 4 & 2 \end{bmatrix}$.
Subtract matching entries:
$$A - B = \begin{bmatrix} 8 - 2 & 3 - 1 \ 6 - 4 & 5 - 2 \end{bmatrix}$$
$$A - B = \begin{bmatrix} 6 & 2 \ 2 & 3 \end{bmatrix}.$$
Final answer: $\begin{bmatrix} 6 & 2 \ 2 & 3 \end{bmatrix}$.
Example 2
Find $A - B$, where $A = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix}$ and $B = \begin{bmatrix} 5 & 6 & 7 \ 8 & 9 & 0 \end{bmatrix}$.
Wrong attempt. A student starts subtracting from the top-left: $1 - 5 = -4$, $2 - 6 = -4$, and then reaches for the third column of $B$ and finds nothing in $A$ to pair with the $7$.
That gap is the signal. The first matrix is $2 \times 2$ and the second is $2 \times 3$, so their orders differ and one column has no partner.
Correct. Check the orders before subtracting. Since $2 \times 2 \neq 2 \times 3$, the operation is undefined.
Final answer: $A - B$ is not defined - the matrices are of different orders.
Example 3
Subtract the two $3 \times 3$ matrices $A = \begin{bmatrix} 9 & 8 & 7 \ 6 & 5 & 4 \ 3 & 2 & 1 \end{bmatrix}$ and $B = \begin{bmatrix} 1 & 2 & 3 \ 4 & 5 & 6 \ 7 & 8 & 9 \end{bmatrix}$.
Subtract entry by entry:
$$A - B = \begin{bmatrix} 9 - 1 & 8 - 2 & 7 - 3 \ 6 - 4 & 5 - 5 & 4 - 6 \ 3 - 7 & 2 - 8 & 1 - 9 \end{bmatrix}$$
$$A - B = \begin{bmatrix} 8 & 6 & 4 \ 2 & 0 & -2 \ -4 & -6 & -8 \end{bmatrix}.$$
Final answer: $\begin{bmatrix} 8 & 6 & 4 \ 2 & 0 & -2 \ -4 & -6 & -8 \end{bmatrix}$.
Example 4
Show that $A - B = A + (-B)$ for $A = \begin{bmatrix} 4 & 0 \ -2 & 5 \end{bmatrix}$ and $B = \begin{bmatrix} 1 & 3 \ 2 & -1 \end{bmatrix}$.
First negate every entry of $B$:
$$-B = \begin{bmatrix} -1 & -3 \ -2 & 1 \end{bmatrix}.$$
Now add $A$ and $-B$ element-wise:
$$A + (-B) = \begin{bmatrix} 4 + (-1) & 0 + (-3) \ -2 + (-2) & 5 + 1 \end{bmatrix} = \begin{bmatrix} 3 & -3 \ -4 & 6 \end{bmatrix}.$$
Direct subtraction gives the same matrix:
$$A - B = \begin{bmatrix} 4 - 1 & 0 - 3 \ -2 - 2 & 5 - (-1) \end{bmatrix} = \begin{bmatrix} 3 & -3 \ -4 & 6 \end{bmatrix}.$$
Final answer: Both routes give $\begin{bmatrix} 3 & -3 \ -4 & 6 \end{bmatrix}$, confirming $A - B = A + (-B)$.
Example 5
Check whether $A - B = B - A$ for $A = \begin{bmatrix} 5 & 2 \ 1 & 6 \end{bmatrix}$ and $B = \begin{bmatrix} 3 & 4 \ 2 & 1 \end{bmatrix}$.
Compute $A - B$:
$$A - B = \begin{bmatrix} 5 - 3 & 2 - 4 \ 1 - 2 & 6 - 1 \end{bmatrix} = \begin{bmatrix} 2 & -2 \ -1 & 5 \end{bmatrix}.$$
Compute $B - A$:
$$B - A = \begin{bmatrix} 3 - 5 & 4 - 2 \ 2 - 1 & 1 - 6 \end{bmatrix} = \begin{bmatrix} -2 & 2 \ 1 & -5 \end{bmatrix}.$$
Final answer: $A - B \neq B - A$; the two results are exact negatives, which shows subtraction is not commutative. Students often expect these to match the way plain numbers seem to; writing both grids out side by side makes the mismatch impossible to miss.
Example 6
Solve for the matrix $X$ in $A - X = B$, where $A = \begin{bmatrix} 7 & 4 \ 3 & 9 \end{bmatrix}$ and $B = \begin{bmatrix} 2 & 1 \ 0 & 5 \end{bmatrix}$.
Rearrange the equation to isolate $X$:
$$X = A - B.$$
Subtract entry by entry:
$$X = \begin{bmatrix} 7 - 2 & 4 - 1 \ 3 - 0 & 9 - 5 \end{bmatrix} = \begin{bmatrix} 5 & 3 \ 3 & 4 \end{bmatrix}.$$
Final answer: $X = \begin{bmatrix} 5 & 3 \ 3 & 4 \end{bmatrix}$.
Why Subtraction Of Matrices Matters
"Line up two tables of numbers and read the change."
A matrix is really a data table, and subtracting two of them reads off the change from one to the other, cell by cell. The algebra of treating whole tables as single objects was built by Arthur Cayley (1821–1895, England), who set out matrix operations, including addition and subtraction, in his 1858 memoir on matrices. That move, from juggling individual numbers to operating on entire arrays at once, is what makes the idea so powerful now.
Image processing. A digital image is a matrix of pixel values. Subtracting one frame from the next leaves only what changed, which is how background subtraction detects motion in video and security systems.
Accounting and inventory. Subtracting this month's stock matrix from last month's returns the net movement of every item at once.
Computer graphics and physics. Position and velocity are stored as matrices; subtracting them yields displacements and relative motion in a single step.
Show a student that subtracting two image frames reveals a moving object, and the same-order rule stops being a hurdle and starts being obvious: you can only compare pixels that sit in the same spot.
Common Mistakes
Mistake 1: Subtracting matrices of different orders
Where it slips in: Diving into the arithmetic before checking the shapes.
Don't do this: Start subtracting entries and hope the leftovers work themselves out.
The correct way: Confirm both matrices share the same order first. If they differ, the operation is undefined, full stop. Learners who treat the check as optional are the ones who produce an "answer" for an undefined subtraction; making the order check step one removes the temptation.
Mistake 2: Assuming subtraction is commutative
Where it slips in: Reversing the order to make the numbers "come out nicer."
Don't do this: Compute $B - A$ and report it as $A - B$.
The correct way: $A - B$ and $B - A$ are negatives of each other, not equal. Subtract in the order the problem gives, and keep the minuend and subtrahend fixed. The learner who reorders numbers freely in arithmetic carries the habit here, where it flips every sign.
Mistake 3: Sign errors with negative entries
Where it slips in: Subtracting a negative entry, such as $5 - (-1)$.
Don't do this: Read $5 - (-1)$ as $4$ by dropping the double sign.
The correct way: Subtracting a negative adds: $5 - (-1) = 6$. Track the signs entry by entry, especially when the second matrix holds negatives.
Conclusion
Subtraction of matrices subtracts corresponding entries of two matrices of the same order.
The result has the same order, and different-order matrices cannot be subtracted at all.
Matrix subtraction is not commutative and not associative, unlike the arithmetic it resembles.
$A - A = O$, $A - O = A$, and $A - B = A + (-B)$ hold for any matrices of matching order.
The whole operation reduces to careful, entry-by-entry arithmetic once the orders match.
To practise subtraction of matrices with a teacher, explore Bhanzu's algebra tutor or a high school math tutor, and browse math classes online for a full course.
Practice These To Solidify Your Understanding
Subtract $\begin{bmatrix} 6 & 9 \ 4 & 2 \end{bmatrix} - \begin{bmatrix} 1 & 5 \ 3 & 7 \end{bmatrix}$.
State whether $\begin{bmatrix} 1 & 2 & 3 \end{bmatrix} - \begin{bmatrix} 4 & 5 \end{bmatrix}$ is defined, and why.
Solve for $X$ in $X - \begin{bmatrix} 2 & 0 \ 1 & 3 \end{bmatrix} = \begin{bmatrix} 5 & 4 \ 2 & 1 \end{bmatrix}$.
If Problem 2 gives you pause, check the two orders before anything else. Want a live Bhanzu trainer to walk through matrix operations? Book a free demo class.
Read More
Was this article helpful?
Your feedback helps us write better content
