- Home
- Linear Algebra
- Matrix Operations

# Adding and subtracting matrices

- Intro Lesson5:10
- Lesson: 1a1:28
- Lesson: 1b1:57
- Lesson: 1c0:55
- Lesson: 2a2:34
- Lesson: 2b1:53
- Lesson: 2c4:03
- Lesson: 3a2:26
- Lesson: 3b3:07
- Lesson: 3c3:13
- Lesson: 4a3:32
- Lesson: 4b4:04
- Lesson: 4c5:08

### Adding and subtracting matrices

At this point in our Linear Algebra course we have worked with matrices extensively, we have done row operations to solve systems of linear equations by representing a linear system as a matrix and use them to our advantage through row reduction and echelon forms. We have also learned to understand not only the notation of matrices, but their elements, their dimensions and it is time now we think of them as a whole and learn what operations can be done with them (notice "with them", NOT "in them").

On this lesson we will introduce the first two out of four basic operations that can be done with a pair (or more) matrices: addition, subtraction, scalar multiplication and multiplication. We know these basic operations from arithmetics and so we just need to learn how they work with the whole structure of the matrices and the results they produce. Notice we did not mention matrix division, that is because division among matrices does not exist (or at least the process hasn't been defined yet), the only division we can do is to divide the elements in a matrix by a scalar, but divide a matrix by another matrix is not possible.

### Addition and subtraction of matrices

We start by working through the two most basic operations we have known since we first were introduced to mathematics in elementary school: addition and subtraction (or "plus" and "minus" something). In order to work through these operations on this lesson let us define a set of two matrices to add and subtract. And so, we define matrices A and B as follows:

Now with them, we set up to work through the operations of adding and subtracting matrices. A few rules will apply to the operation, but we will talk about them in the next section, for now, let us go through the process quickly and then we can come back and check how the operations were possible. Let us start by adding A and B:

We have color coded each element in the matrices so you can see what was done in each element's case. Notice how addition of two matrices acts on a one-by-one element case, requiring that you have the exact same of elements in the matrices involved in the operation, and that they should be distributed in the same manner.

We will retake this topic on the next section, but for now, you must remember that when adding matrices you will be adding the elements of the first matrix with the corresponding one (the one in the "same spot", same row and column number) in the second matrix.

Now let us take a look into matrix subtraction:

Looking at the subtraction above we can easily conclude that the process heavily resembles that of addition since the subtraction is computed on a one-by-one case in each of the elements of the matrices, thus producing a result for each corresponding element space and resulting in a matrix with the same number of elements in the same organization.

In simple words, addition and subtraction of matrices work the same, the only difference between them is the arithmetic sign you use to operate: the plus sign for addition and the minus sign for subtraction.

It is imperative you understand this conclusion since this may help you on not falling into confussions when dealing with different literature on the topic. The thing is, some mathematicians, books, or study materials in general, may refer to the addition and subtraction operations both as "addition" in general. This particular reference comes from the fact that subtraction happens to be equivalent to the addition of numbers where at least one of them is negative. If you have any questions on this remember that subtraction in arithmetics is also called "the difference" and is all because when you add numbers with different signs the result is the difference between them. We have covered such topic in our lesson on subtracting integers, which although not part of this Linear Algebra course, you can check out any time on the StudyPug website. You can also check the next article on addition and subtraction of integers which contains extra exercises plus some graphic representations.

In summary: How to add matrices? We add each corresponding element on the involved matrices to produce a new matrix where such elements will occupy the same spot as their predecessors. How to subtract matrices? In exactly the same manner as we compute addition, except that we use a minus sign to operate instead of a plus sign.

### Rules for adding and subtracting matrices

Matrix addition and subtraction are two operations which although straightforward and simple to resolve (as shown above), you still have a few rules to follow in order to operate.

For example, when we were adding matrix A to matrix B above, notice first that A and B are very similar matrices, they happen to have the same amount of rows and columns each and the operation of addition applied to every "corresponding term" in them. This brings about the main rule of adding and subtracting matrices which corresponds to the dimensions of the matrices that are being operated on with one another.

Also notice that subtracting matrices follows a very similar regime, in reality the only change is that instead of having an addition sign in between the matrices and the corresponding elements in each matrix space, you have a subtraction sign.

With all of this in mind, the rules for adding and subtracting matrices are:

- You can only add or subtract matrices which have the exact same dimensions.
- If you think about it, this comes from the fact that adding matrices with different dimensions creates an issue because not all the elements in each matrix will have a corresponding element to operate with, and so, making the operation impossible to complete.

- Addition of matrices is commutative, but subtraction is not unless you apply the negative sign to the matrix on the right first thus converting the operation into an addition first.
- The commutative property means that while adding two matrices, you can change the order in which you add them and this will not affect the result.
- This is not as simple when subtracting. In equation 3 we have an example of a matrix subtraction, notice that if you just switch the order of the matrices without moving the negative sign the result would not be the same, then, how can subtraction of matrices be commutative too? You have to apply the negative sign to the matrix that is being subtracted first! Check the process step by step below:

- Matrix addition and subtraction are associative.
- The associative property is used in problems involving more than two matrices which are being added or subtracted from one another. This property allows you to work on the operation between two of the matrices first, and then use the matrix obtained from such operation to work through the second operation at hand. Repeat such process until you have gone through all of the needed operations involving all of the matrices in the problem.

- When adding or subtracting matrices, the resulting matrix will have the same dimensions as the matrix that produced it.
- This makes sense since each element on the first matrix will operate on the corresponding element of the second matrix, thus producing a result for each element space. Such results will then become the elements of the new matrix.

### Addition and subtraction examples

Next we are about to show examples of addition and subtraction of matrices. In the first example exercise we will focus on showing the conditions in which such operations are possible. Then we solve a few examples of matrix problems with the operations explained step by step. We end this section by solving matrix equations which involve either addition or subtraction of matrices.

__Example 1__

Can we add or subtract the following matrices?

- Case 1:
- Case 2:
- Case 3:

__Example 2__

Add the next two matrices:

When adding two matrices, each element gets added to its corresponding element in the other matrix. The process is simple and is shown below:

Follow the same process in the next two exercises.

__Example 3__

Add the next two matrices:

And so, we add each element on the matrices to its corresponding one in the other matrix. Notice that, as mentioned before, the matrices must have the same dimensions in order for this element-by-element correspondence to occur:

__Example 4__

Add the next two matrices:

When adding more than two matrices, you can associate two by performing their addition first, and then add the resulting matrix to the matrix that is left. This is what we call the associative property of matrix addition, this and more properties of matrix addition will be explained in later lessons, for now, check the process for this problem below:

So as you can see, the first step was to add matrices one and two, which results in a new matrix that is later added to the third one. If a matrix addition contains more thna 3 matrices, the same association process can be repeated as many times as necessary to simplify the problem until you have a simple two-matrix operation.

__Example 5__

Subtract the following matrices:

Once more, notice that the matrices involved in a subtraction must have the same dimensions so the element-by-element correspondence is met.

__Example 6__

Subtract the following matrices:

No matter how big the matrices are, as long as they have the same dimensions you can perform the subtraction.

__Example 7__

Subtract the following matrices:

For a matrix subtraction with more than two matrices, notice that we can use the associative property again. Remember that matrix subtraction is not commutative (you cannot change the order of the matrices in the operation and obtain the same result).

__Example 8__

Solve the following equation containing an addition of a constant matrix to a variable.

We start by subtracting the matrix in the left hand side to both sides of the equation so we can solve for A easily by performing a matrix subtraction:

__Example 9__

Solve the following matrix equations

On this case, the simplest way to solve for X is to pass it to the right hand side by adding it to both sides of the equation so it becomes positive. We also subtract the matrix found in the right hand side of the equation from both sides, and so, we end up with a matrix subtraction that defines X.

By solving the matrix subtraction we find X.

__Example 10__

Find the values of the elements a, b, c, d, e, and f by solving the following matrix equation in the most efficient manner.

On this problem we can translate element by element case, an equation that will allow us to obtain the value of each of the elements in the first matrix.

In other words, you know the element from the first row and first column (top left) in the first matrix, will be added to the element in the first row and first column on the second matrix, to obtain the element in that space in the resulting matrix on the right hand side. In other words, we can easily transcribe the next equations for each element space:

And from that, we can solve the value of each variable:

After learning how to add and subtract matrices, it is time for us to look into other operations: scalar multiplication of matrices and multiplication of two or more matrices will be explained in the next two lessons.

We finalize our lesson for today with a few useful links: the first one contains a quick list of the basic rules of matrix addition and an extra lecture on matrix operations.

And this is it, see you in our next lesson!##### Do better in math today

##### Don't just watch, practice makes perfect

### Adding and subtracting matrices

#### Lessons

Let

We want to find out what

*A+B*is. We see that we are allowed to add

*A*and

*B*together because both

*A*and

*B*has a dimension of 2 x 3.

To add the two matrices together, we simply just need to add the corresponding matrix elements of

*A*and

*B*. So,

Same idea goes for subtracting. We can subtract them because the dimensions are the same. If we want to find out what

*A - B*is, then

- IntroductionAdding and subtracting matrices overview
- 1.
**Understanding how to add and subtract matrices**

Can we add or subtract the following matrices?a)b)c) - 2.
**Adding matrices**

Add the following matrices:a)b)c) - 3.
**Subtracting matrices**

Subtract the following matricesa)b)c) - 4.
**Solving matrix equations**

Solve the following matrix equations:a)b)c)