Subtraction of Matrices - Rules, Properties, and Examples

#Algebra
TL;DR
Subtraction of matrices is an element-wise operation: subtract each entry of one matrix from the entry in the same position of another, provided both matrices share the same order. This article covers the same-order condition, the step-by-step method for 2×2 and 3×3 matrices, the properties of matrix subtraction, and six worked examples.
MV
Madhukar VLast updated on August 24, 202612 min read

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 rows×columns\text{rows} \times \text{columns}.

If A=[aij]A = [a_{ij}] and B=[bij]B = [b_{ij}] are both of order m×nm \times n, then their difference A−BA - B is the m×nm \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),A - B = A + (-B),

where −B-B is the matrix with every entry of BB 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×22 \times 2 matrix cannot be subtracted from a 2×32 \times 3 matrix; the extra column in the second has nothing to line up against in the first. The result of A−BA - B keeps the shared order: subtract two 3×33 \times 3 matrices and the answer is 3×33 \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)(i, j), compute aij−bija_{ij} - b_{ij}.

Step 3 — Place each result in the same position. The differences form the answer matrix, of the same order.

Subtraction of matrices formula. For A=[aij]A = [a_{ij}] and B=[bij]B = [b_{ij}] of the same order m×nm \times n, the difference is

A−B=[aij−bij],for every i and j.A - B = [a_{ij} - b_{ij}], \quad \text{for every } i \text{ and } j.

How Do You Subtract 2×2 Matrices?

Take two 2×22 \times 2 matrices and subtract the four matching entries, keeping each difference in the same position.

A=[75 49],B=[21 36].A = \begin{bmatrix} 7 & 5 \ 4 & 9 \end{bmatrix}, \qquad B = \begin{bmatrix} 2 & 1 \ 3 & 6 \end{bmatrix}.

A−B=[7−25−1 4−39−6]=[54 13].A - B = \begin{bmatrix} 7 - 2 & 5 - 1 \ 4 - 3 & 9 - 6 \end{bmatrix} = \begin{bmatrix} 5 & 4 \ 1 & 3 \end{bmatrix}.

How Do You Subtract 3×3 Matrices?

The same rule covers nine entries instead of four — subtract each matching pair.

A=[572 381 649],B=[121 053 214].A = \begin{bmatrix} 5 & 7 & 2 \ 3 & 8 & 1 \ 6 & 4 & 9 \end{bmatrix}, \qquad B = \begin{bmatrix} 1 & 2 & 1 \ 0 & 5 & 3 \ 2 & 1 & 4 \end{bmatrix}.

A−B=[5−17−22−1 3−08−51−3 6−24−19−4]=[451 33−2 435].A - B = \begin{bmatrix} 5-1 & 7-2 & 2-1 \ 3-0 & 8-5 & 1-3 \ 6-2 & 4-1 & 9-4 \end{bmatrix} = \begin{bmatrix} 4 & 5 & 1 \ 3 & 3 & -2 \ 4 & 3 & 5 \end{bmatrix}.

How Do You Subtract 3×4 (Rectangular) Matrices?

Subtraction is not limited to square matrices — any two matrices of the same order work, including rectangular ones such as 3×43 \times 4.

A=[2468 1357 0246],B=[1111 2222 3333].A = \begin{bmatrix} 2 & 4 & 6 & 8 \ 1 & 3 & 5 & 7 \ 0 & 2 & 4 & 6 \end{bmatrix}, \qquad B = \begin{bmatrix} 1 & 1 & 1 & 1 \ 2 & 2 & 2 & 2 \ 3 & 3 & 3 & 3 \end{bmatrix}.

A−B=[1357 −1135 −3−113].A - B = \begin{bmatrix} 1 & 3 & 5 & 7 \ -1 & 1 & 3 & 5 \ -3 & -1 & 1 & 3 \end{bmatrix}.

The routine 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≠B−AA - B \neq B - A in general. Reversing the order negates every entry, so the two results differ unless A=BA = B.

  • Not associative. (A−B)−C≠A−(B−C)(A - B) - C \neq A - (B - C) in general.

  • Subtracting a matrix from itself gives the zero matrix. A−A=OA - A = O, where OO has every entry 00.

  • Subtracting the zero matrix changes nothing. A−O=AA - O = A.

  • Addition of a negative. A−B=A+(−B)A - B = A + (-B), the definition restated as a property.

  • Scalar distributes over subtraction. For any scalar kk, ;k(A−B)=kA−kB; 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×22 \times 2 difference, through the order-mismatch trap, to a 3×33 \times 3, the addition-of-negative view, a non-commutativity check, and solving a matrix equation.

Example 1

Subtract BB from AA, where A=[83 65]A = \begin{bmatrix} 8 & 3 \ 6 & 5 \end{bmatrix} and B=[21 42]B = \begin{bmatrix} 2 & 1 \ 4 & 2 \end{bmatrix}.

Subtract matching entries:

A−B=[8−23−1 6−45−2]A - B = \begin{bmatrix} 8 - 2 & 3 - 1 \ 6 - 4 & 5 - 2 \end{bmatrix}

A−B=[62 23].A - B = \begin{bmatrix} 6 & 2 \ 2 & 3 \end{bmatrix}.

Final answer: [62 23]\begin{bmatrix} 6 & 2 \ 2 & 3 \end{bmatrix}.

Example 2

Find A−BA - B, where A=[12 34]A = \begin{bmatrix} 1 & 2 \ 3 & 4 \end{bmatrix} and B=[567 890]B = \begin{bmatrix} 5 & 6 & 7 \ 8 & 9 & 0 \end{bmatrix}.

Wrong attempt. A student starts subtracting from the top-left: 1−5=−41 - 5 = -4, 2−6=−42 - 6 = -4, and then reaches for the third column of BB and finds nothing in AA to pair with the 77.

That gap is the signal. The first matrix is 2×22 \times 2 and the second is 2×32 \times 3, so their orders differ and one column has no partner.

Correct. Check the orders before subtracting. Since 2×2≠2×32 \times 2 \neq 2 \times 3, the operation is undefined.

Final answer: A−BA - B is not defined — the matrices are of different orders.

Example 3

Subtract the two 3×33 \times 3 matrices A=[987 654 321]A = \begin{bmatrix} 9 & 8 & 7 \ 6 & 5 & 4 \ 3 & 2 & 1 \end{bmatrix} and B=[123 456 789]B = \begin{bmatrix} 1 & 2 & 3 \ 4 & 5 & 6 \ 7 & 8 & 9 \end{bmatrix}.

Subtract entry by entry:

A−B=[9−18−27−3 6−45−54−6 3−72−81−9]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=[864 20−2 −4−6−8].A - B = \begin{bmatrix} 8 & 6 & 4 \ 2 & 0 & -2 \ -4 & -6 & -8 \end{bmatrix}.

Final answer: [864 20−2 −4−6−8]\begin{bmatrix} 8 & 6 & 4 \ 2 & 0 & -2 \ -4 & -6 & -8 \end{bmatrix}.

Example 4

Show that A−B=A+(−B)A - B = A + (-B) for A=[40 −25]A = \begin{bmatrix} 4 & 0 \ -2 & 5 \end{bmatrix} and B=[13 2−1]B = \begin{bmatrix} 1 & 3 \ 2 & -1 \end{bmatrix}.

First negate every entry of BB:

−B=[−1−3 −21].-B = \begin{bmatrix} -1 & -3 \ -2 & 1 \end{bmatrix}.

Now add AA and −B-B element-wise:

A+(−B)=[4+(−1)0+(−3) −2+(−2)5+1]=[3−3 −46].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=[4−10−3 −2−25−(−1)]=[3−3 −46].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 [3−3 −46]\begin{bmatrix} 3 & -3 \ -4 & 6 \end{bmatrix}, confirming A−B=A+(−B)A - B = A + (-B).

Example 5

Check whether A−B=B−AA - B = B - A for A=[52 16]A = \begin{bmatrix} 5 & 2 \ 1 & 6 \end{bmatrix} and B=[34 21]B = \begin{bmatrix} 3 & 4 \ 2 & 1 \end{bmatrix}.

Compute A−BA - B:

A−B=[5−32−4 1−26−1]=[2−2 −15].A - B = \begin{bmatrix} 5 - 3 & 2 - 4 \ 1 - 2 & 6 - 1 \end{bmatrix} = \begin{bmatrix} 2 & -2 \ -1 & 5 \end{bmatrix}.

Compute B−AB - A:

B−A=[3−54−2 2−11−6]=[−22 1−5].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≠B−AA - 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 XX in A−X=BA - X = B, where A=[74 39]A = \begin{bmatrix} 7 & 4 \ 3 & 9 \end{bmatrix} and B=[21 05]B = \begin{bmatrix} 2 & 1 \ 0 & 5 \end{bmatrix}.

Rearrange the equation to isolate XX:

X=A−B.X = A - B.

Subtract entry by entry:

X=[7−24−1 3−09−5]=[53 34].X = \begin{bmatrix} 7 - 2 & 4 - 1 \ 3 - 0 & 9 - 5 \end{bmatrix} = \begin{bmatrix} 5 & 3 \ 3 & 4 \end{bmatrix}.

Final answer: X=[53 34]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 With Subtraction of Matrices

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−AB - A and report it as A−BA - B.

The correct way: A−BA - B and B−AB - 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)5 - (-1).

Don't do this: Read 5−(−1)5 - (-1) as 44 by dropping the double sign.

The correct way: Subtracting a negative adds: 5−(−1)=65 - (-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=OA - A = O, A−O=AA - O = A, and A−B=A+(−B)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

  1. Subtract [69 42]−[15 37]\begin{bmatrix} 6 & 9 \ 4 & 2 \end{bmatrix} - \begin{bmatrix} 1 & 5 \ 3 & 7 \end{bmatrix}.

  2. State whether [123]−[45]\begin{bmatrix} 1 & 2 & 3 \end{bmatrix} - \begin{bmatrix} 4 & 5 \end{bmatrix} is defined, and why.

  3. Solve for XX in X−[20 13]=[54 21]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

Frequently Asked Questions

What is the subtraction of matrices?
It is the element-wise operation A−BA - B, where each entry of BB is subtracted from the entry in the same position of AA, for two matrices of the same order.
What is the condition for subtracting two matrices?
Both matrices must have the same order - the same number of rows and columns.
Can we subtract two matrices of different orders?
No. If the orders differ, the subtraction is not defined.
Is subtraction of matrices commutative?
No. In general A−B≠B−AA - B \neq B - A; the two results are negatives of each other.
How is matrix subtraction related to addition?
A−B=A+(−B)A - B = A + (-B), so subtracting a matrix is the same as adding its negative.
✍️ Written By
Madhukar V
Madhukar V
Math Columnist & Analyst
I see mathematics as more than just numbers and formulas—it is a way of thinking, questioning, and understanding the world around us. I work at the intersection of mathematics, EdTech, technology, and AI-powered learning, I enjoy exploring how mathematical ideas can be made simple, meaningful, and relatable. Through my articles, I aim to present mathematics with curiosity and a practical perspective, helping readers see the beauty and relevance behind every concept in a Bhanzu way.
LinkedIn
Related Articles
Book a FREE Demo ClassBook Now →