Adding and Subtracting Matrices

In this lesson, I have prepared seven (7) worked examples to illustrate the basic approach on how to easily add or subtract matrices.

If you know how to add and subtract real numbers, this topic should really be a breeze. The only thing required in order to “legally” perform the operations of addition or subtraction in the “world” of matrices is to make sure that the given matrices must have the same size or dimension.

What does it mean for a given matrix to have the same size or dimension?

Suppose we are given the matrices [latex]A[/latex] and [latex]B[/latex]. They have the same size or dimension because their number of rows and columns are the same.

Examples of two matrices with same dimension. Matrix A and matrix B has 2 rows and 3 columns but they have different elements.

We can describe the size or dimension of a matrix using the following standard format:

number of rows x number of columns

Let me show you some examples…

A two-column table showing different sizes or dimensions of matrices with examples such 2x3 matrix, 3x2 matrix, 5x5 matrix which is a square matrix

The last matrix with a dimension of 5 x 5 is also considered to be a “square matrix” because the number of rows and the number of columns are equal. It is important to know that for any given matrix to have an inverse, it must be a square matrix. I am not saying that all square matrices have inverses but the first requirement for a matrix to have an inverse is that it must be a square matrix first.

Check out my separate tutorial on how to find the inverse of a 2×2 matrix.

I must emphasize that in order to add or subtract two given matrices, they should have the same size or dimension. Otherwise, we conclude that the sum (addition) or difference (subtraction) of two matrices having different sizes or dimensions is undefined!

Now let’s take a look at the general rule on how to add and subtract matrices whose sizes or dimensions are the same.


Rules on Adding and Subtracting Matrices with the Same Size or Dimension

Suppose matrices [latex]A[/latex] and [latex]B[/latex] both have two rows and two columns (2×2) with some arbitrary elements or entries.

Matrix A is a 2x2 matrix with elements a1 and a2 on the first row, and elements a3 and a4 on the second row.
Matrix B is a 2x2 matrix with elements b1 and b2 on the first row, and elements b3 and b4 on the second row.

The “formulas” to add and subtract matrices are shown below.

  • Add matrices by adding their corresponding entries
A formula showing how to add matrix A and matrix B, that is matrix A plus matrix B.
  • Subtract matrices by subtracting their corresponding entries
A formula showing how to subtract matrices A and B, that is matrix A minus matrix B.

Let’s work on some problems.


Examples of How to Add and Subtract Matrices

Example 1: Perform the indicated operation for [latex]A+C[/latex].

Notice that matrices [latex]A[/latex] and [latex]C[/latex] have the same “size” or “dimension” because their number of rows and columns are the same. Both can be described as a 3 x 3 matrix. This tells me that it is okay to find their sum.

Matrix A has elements -5, 2 and 0 on its first row, elements 7, -3, 4 on its second row, and elements -1, 3, 2 on its third row. It can also be written as [-5,2,0;7,-3,4;-1,3,2].
Matrix C has elements 0, -1 and 8 on its first row, elements 6, -14, 2 on its second row, and elements 9, 5, 1 on its third row. It can also be written as [0,-1,8;6,-14,2,9,5,1].

I will add their corresponding entries and simplify.

The sum of matrices A and B has elements -5, 1, and 8 on its first row; 13, -17, and 6 pn its second row; 8, 8, and 3 on its third row. In other words A + C = [-5, 1, 8; 13, -17, 6; 8, 8, 3].

That’s how simple it is!


Example 2: Perform the indicated operation for [latex]B+F[/latex].

Observe that matrix [latex]B[/latex] has a dimension of 2×3 while matrix [latex]F[/latex] has a dimension of 2×2.

Matrix B has elements 8, 1, and 2 on its first row; -5, 6, and 7 on its second row. Matrix B can also be written as .
Matrix F has elements 1 and -2 on its first row; -3 and 4 on its second row. Therefore, matrix F = .

Since the number of rows and columns don’t match, then the sum of matrices B and F doesn’t exist or is undefined. I will stop here. That’s our answer believe it or not.


Example 3: Perform the indicated operation for [latex]E-B[/latex].

The last two examples showed you how to add matrices. This time, we’ll talk about the subtraction of matrices. Remember that the processes involved in both adding and subtracting matrices are extremely similar. Review the “formula” above in case you forgot.

In this example, we need to find the difference between matrix [latex]E[/latex] and matrix [latex]B[/latex].

However, it appears that it is not possible since they have different sizes or dimensions. Matrix [latex]E[/latex] is a 3×2 while matrix [latex]B[/latex] is 2×3.

Matrix E contains the elements -5 and 1 on the first row, 0 and 2 on the second row, and -11 and 7 on the third row. This matrix can alternatively be written in the form E = .
Matrix B contains the elements 8, 1, and 2 on the first row; -5, 6 and 7 on the second row. This matrix can alternatively be written as B = .

Since I can’t subtract entry-wise, due to the entries of the two matrices having no direct correspondence, I must claim that it is NOT possible to find their difference. Therefore, our answer is undefined.

This is not a trick question. Teachers sometimes “throw” this in the mix to test if you understand the concept that only matrices with the same sizes or dimensions can be added or subtracted. Don’t feel bad, I myself fell into this “trap”. Hopefully, now that you know, you’ll be careful the next time you come across a problem like this.


Example 4: Perform the indicated operation for [latex]F-D[/latex].

By quick inspection, I can see that it is possible to find the difference between matrices [latex]F[/latex] and [latex]D[/latex] because both have the same number of rows and columns. Great!

Matrix F has elements 1 and -2 on its first row and elements -3 and 4 on the second row. Alternatively, it can we written as F = .
Matrix D has elements 6 and -2 on its first row and elements 3 and 7 on the second row. Alternatively, it can we written as D = .

To start, I will subtract the corresponding entries of [latex]F[/latex] and [latex]D[/latex]. My only word of caution is be very careful when subtracting real numbers. This is usually where common errors occur. Remember that two adjacent negative signs turn out to be positive.

Subtracting matrix D from F we get F - D = [1, -2; -3, 4] - [6, -2; 3, 7] = [-5, 0; -6, -3]. In other words the difference of matrices F and D is a matrix with elements -5 and 0 on the first row, and -6 and -3 on the second row.

Not bad, right?


Example 5: Perform the indicated operation for [latex]C-A[/latex].

The two given matrices [latex]C[/latex] and [latex]A[/latex] have the same sizes or dimensions (both 3×3 matrices). This allows us to be able to perform the subtraction operation.

Matrix C has elements 0, -1 and 8 on the first row; elements 6, -14, and 2 on the second row; and elements 9, 5, and 1 on the third row. Alternatively, matrix C = [0,-1,8;6,-14,2;9,5,1].
Matrix A has elements -5, 2 and 0 on the first row; elements 7, -3, and 4 on the second row; and elements -1, 3, and 2 on the third row which can be written as matrix A = [-5,2,0;7,-3,4;-1,3,2].

Subtracting entry-wise, I got…

The difference of matrices C and A is a matrix with 5, -3, and 8 on the first row; -1, -11 and -2 on the second row; and finally 10, 2 and -1 on the third row. This can be expressed also as C minus A = [5,-3,8;-1,-11,-1;10,2,-1].

Example 6: Perform the indicated operation for [latex](A+C)+(C-A)[/latex].

This is a great example of a “multi-step” problem that involves addition and subtraction of matrices. The goal is to perform the indicated operation on each parenthesis and then ADD them together.

To skip some steps, review how we solved for [latex](A+C)[/latex] in Example 1 and [latex]C-A[/latex] in Example 5.

We have these partial answers so far…

The sum of matrices A and C is a matrix with elements -5, 1, and 8 on the first row; elements 13, -17, and 6 on the second row; and elements 8, 8, and 3 on the third row. This can also be expressed as A + C = [-5,1,8;13,-17,6;8,8,3].
The difference of matrices C and A is a matrix with elements 5, -3, and 8 on the first row; -1, -11, and -2 on the second row; and elements 10, 2, and -1 on the third row. You may write this matrix as C minus A equals [5,-1,8;-1,-11,-2;10,2,-1].

So then, the final step is to add them together to obtain the required answer.

The sum of the sum of matrices A and C, and the difference of matrices C and A is a 3 by 3 matrix with elements 0, -2, and 16 on the first row; elements 12, -28, and 4 on the second row; and elements 18, 10 and 2 on the third row. Alternative, (A+C) + (C-A)=[0,-2,16;12,-28,4;18,10,2].

As you see, addition and subtraction of matrices are really easy. I hope that you gained some confidence and knowledge on how to work this out.


Example 7: Perform the indicated operation for [latex](A+C)+(C-A)[/latex].

This is the same problem as Example 6. But I want to solve this a little bit differently to demonstrate the fact that there are other ways to approach a certain problem. Although the method applied in Example 6 is perfectly acceptable, this “alternative” approach makes a lot more sense because it is very straightforward.

Here we go.

If you consider the expression [latex](A+C)+(C-A)[/latex] as combining like or similar terms type problem, then it makes sense that we can quickly simplify the original problem without even dealing with the addition and subtraction of matrices.

Notice that I can combine the [latex]C[/latex]-terms as [latex]2C[/latex].

The sum of (A+C) and (C-A) equals A+2C-A.

Now, the [latex]A[/latex]-terms should cancel out because they have opposite signs.

(A+C)+(C-A)= A + C + C - A = C + C = 2C

Our original problem is reduced to[latex]2C[/latex] which is twice or double of matrix C.

This means that I am going to multiply each entry of matrix [latex]C[/latex] by [latex]2[/latex]. This is actually the subject of my other algebra tutorial on Scalar Multiplication of Matrix.

Since

Matrix A is a 3 by 3 matrix with elements 0, -1, and 8 on the first row, elements 6, -14, and 2 on the second row, and elements 9, 5, and 1 on the third row. We can also write this matric as C =[0,-1,8;6,-14,2;9,5,1].

then [latex]2C[/latex] is solved by…

2C = 2 times [0,-1,8;6,-14,2;9,5,1] = [0,-2,16;12,-28,4;18,10,2].

The final answer obtained using this method is exactly the same as in Example 6. Easy, right?


You may also be interested in these related math lessons or tutorials:

Scalar Multiplication

Matrix Multiplication