A matrix sum or difference combines entries in matching positions. You can perform these operations only when both matrices have the same number of rows and the same number of columns. The result keeps those dimensions.
Which matrices can you add?
A matrix with two rows and three columns has dimensions 2 × 3. It can be added to another 2 × 3 matrix, but not to a 3 × 2 matrix. Having six entries in each is not enough: their arrangement matters. Square matrices are not a requirement; rectangular matrices work in exactly the same way.
The entry in row i and column j is identified by those two indices. Each entry of the answer comes from the two entries at that position:
How to add corresponding entries
Consider the matrices below. Add the top-left entries first, then move across the first row and continue with the second row. Do not add a row to a column or combine all entries into one number.
The top-right entry is −1 + 2 = 1, while the bottom-left entry is 3 + (−3) = 0. Keeping the brackets and rows aligned makes the correspondence visible.
Subtracting a matrix with negative entries
Use the same positions, but subtract each entry of B from its counterpart in A. A minus sign before a matrix applies to every entry, including negative ones.
Subtracting all four entries of the 2 × 2 matrices
Use A and B from the addition above to find A − B. Their dimensions match, so each subtraction keeps the same row and column.
Calculate the first row. The top-left entries are 2 and 5; the top-right entries are −1 and 2.
Calculate the second row. Subtracting −3 means adding 3; the last position is an ordinary subtraction of positive numbers.
Place the four answers back in their original positions. The result remains a 2 × 2 matrix.
As a check, add the bottom-left entry of B, −3, to the difference entry 6. You recover 3, the corresponding entry of A.
In the bottom-left position, 3 − (−3) = 6. Subtracting a negative number adds its opposite. In the top-right position, −1 − 2 = −3. These two positions are useful checks because they involve different sign rules.
Why the order matters in subtraction
Addition is commutative: changing the order of the two matrices leaves the sum unchanged. Subtraction generally is not. In this example, reversing A and B changes every sign in the difference.
Here O is the zero matrix of the required dimensions. Adding it changes no entries. Also, subtracting a matrix from itself gives that zero matrix. For three matrices of the same dimensions, addition is associative, so regrouping the additions does not affect the answer.
Checking a matrix calculation
Count the rows and columns before calculating, check one position at a time, and confirm that the answer has the original dimensions. You can also add B back to A − B: the result must be A. If the matrices represent data, matching positions must refer to matching categories and use compatible units. A correct-looking array is not meaningful if one table lists months across columns and the other lists products.
