Add and Subtract Matrices
It is easy to add and subtract matrices. If you know how to add and subtract integers, this lesson will be a piece of cake. First, study the figure below carefully to see how it is done for a 2 × 2 matrix.
In this lesson, you will learn
- how to add and subtract matrices by adding or subtracting corresponding elements
- why the matrices must have the same dimensions
- how to work with negative elements without sign mistakes
- how matrix addition is used in a real-world problem
How to Add and Subtract Matrices
Based on the example in the figure above, to add or subtract matrices, we add or subtract their corresponding elements. For example, we add 8 and 9 to get 17.
Given two m × n matrices A = [ aij ] and B = [ bij ], with aij and bij located in row i and column j.
The sum is A + B = [ aij + bij ]
The difference is A − B = [ aij − bij ]
Using two 2 × 2 matrices,
- the elements in the first row and first column are a11 and b11
- the elements in the first row and second column are a12 and b12
- the elements in the second row and first column are a21 and b21
- the elements in the second row and second column are a22 and b22
Notice how we get the sum of the corresponding elements in the following addition of matrices:
Notice also how we get the difference of the corresponding elements in the following subtraction of matrices:
Using the figure above, which two numbers are added to get the element in row 2, column 2?
Show answer
3 and 2. They are both in the second row and second column, and 3 + 2 = 5.
The Matrices Must Have the Same Dimensions
The important rule to know is that when adding and subtracting matrices, first make sure the matrices have the same dimensions. Suppose you are adding two matrices.
Then, this means that the number of rows in the first matrix must be equal to the number of rows in the second matrix. Similarly, the number of columns in the first matrix must be equal to the number of columns in the second matrix.
In other words, you can add or subtract a 2 × 3 with a 2 × 3 or a 3 × 3 with a 3 × 3. However, you cannot add a 3 × 2 with a 2 × 3 or a 2 × 2 with a 3 × 3.
Adding a 3 × 2 matrix and a 2 × 3 matrix because both have 6 elements. Having the same number of elements is not enough: the rows must match and the columns must match, so every element has a partner in the same position.
Can you subtract a 2 × 4 matrix from a 2 × 4 matrix? What size is the answer?
Show answer
Yes, and the answer is also 2 × 4. Both matrices have 2 rows and 4 columns, and the difference keeps the same dimensions.
More Examples Showing How to Add and Subtract Matrices
Matrix addition
Add the two matrices shown below:
You can add elements in the same position or elements in the same row and same column. We show these elements with the same color to make this crystal clear.
Matrix subtraction
Matrix subtraction is similar to matrix addition with the exception that you are subtracting elements in the same row and same column.
Subtract the two matrices below:
- Check the dimensions: both matrices are 2 × 2, so you can subtract them.
- Row 1: 5 − 3 = 2 and −2 − 4 = −6.
- Row 2: 0 − (−6) = 0 + 6 = 6 and 7 − 1 = 6.
Losing a minus sign when subtracting a negative element. In the example above, 0 − (−6) is 6, not −6. Subtracting a negative number is the same as adding a positive number.
In a matrix subtraction, row 1, column 2 is −2 − (−3). What is the answer for that position?
Show answer
1. −2 − (−3) = −2 + 3 = 1, just like in the subtraction example above.
Real-World Connection
You have a business selling shirts and pants. The matrices below represent the number of shirts and pants that you sold in two weeks. The matrix on the left is week #1 and the matrix on the right is week #2.
Row #1 represents the number of pants that you sold and row #2 represents the number of shirts that you sold from Monday to Friday.
For example, you sold 40 pants on Wednesday (week 1).
You sold 28 shirts on Friday (week 2).
How many pants and shirts have you sold in two weeks?
Just perform matrix addition!
The answer matrix shows how many pants (row 1) and shirts (row 2) you sold on each weekday over the two weeks. Adding each row gives 470 pants and 444 shirts in all.
How many shirts did you sell on Tuesdays over the two weeks?
Show answer
125 shirts. Shirts are in row 2 and Tuesday is column 2: 90 + 35 = 125.
Summary
- To add or subtract matrices, add or subtract the elements in the same row and the same column.
- Both matrices must have the same dimensions: the same number of rows and the same number of columns.
- The answer has the same dimensions as the two matrices.
- Watch the signs: subtracting a negative element is the same as adding a positive one.
Test Yourself: 10-Question Quiz
Now check what you learned. Every answer is explained, and each time you play you get new questions.
Quiz Complete!