Lesson Objectives
  • Learn how to add matrices
  • Learn how to subtract matrices

How to Add and Subtract Matrices


In the last lesson, we introduced the concept of a matrix. We learned the basic definition, how to determine the order of a matrix, and how to determine if two matrices are equal. In this lesson, we will learn how to add and subtract matrices.

Addition and Subtraction of Matrices

  • Only matrices of the same order can be added or subtracted
  • If the two matrices are not of the same order:
    • We can say the sum or difference does not exist
    • We can also say the sum or difference is undefined
  • To add two or more matrices of the same order, we add corresponding elements
  • To subtract two matrices of the same order, we subtract corresponding elements
Let's look at some examples.
Example #1: Find A + B. $$A=\left[ \begin{array}{cc}2&1\\ 3&5\end{array}\right]$$ $$B=\left[\begin{array}{cc}-1&3\\ 4&6\end{array}\right]$$ Since each matrix is a 2 × 2 matrix, we can find our sum by adding the corresponding elements. $$A + B = \left[ \begin{array}{cc}2&1\\ 3&5\end{array}\right] + \left[\begin{array}{cc}-1&3\\ 4&6\end{array}\right]$$ $$=\left[ \begin{array}{cc}2 + (-1)&1 + 3\\3 + 4&5 + 6\end{array}\right]$$ $$=\left[ \begin{array}{cc}1&4 \\ 7& 11\end{array}\right]$$ Example #2: Find A + B. $$A=\left[ \begin{array}{cc}5&-1\\ 7&11 \\ 8 & -9\end{array}\right]$$ $$B=\left[ \begin{array}{ccc}9&-8 & 4\\ -2&-7 & -3\end{array}\right]$$ The order of A is 3 × 2, while the order of B is 2 × 3. Since these matrices have different orders, we can't find the sum. In this case, we can state our answer as "the sum doesn't exist" or "the sum is undefined". Note: the answer for this situation is going to depend on which textbook or resource you use.
Example #3: Find A - B. $$A=\left[ \begin{array}{ccc}5&6 & 1\\ 9&-5 & 2\end{array}\right]$$ $$B=\left[\begin{array}{ccc}18&-4 & 7\\ 11&-6 & 8\end{array}\right]$$ Since each matrix is a 2 × 3 matrix, we can find our difference by subtracting corresponding elements. $$A - B = \left[ \begin{array}{cc}5&6 & 1\\ 9&-5 & 2\end{array}\right] - \left[\begin{array}{ccc}18&-4 & 7\\ 11&-6 & 8\end{array}\right]$$ $$=\left[ \begin{array}{ccc}5 - 18&6 - (-4) & 1 - 7\\ 9 - 11&-5 - (-6) & 2 - 8\end{array}\right]$$ $$=\left[ \begin{array}{ccc}-13 & 10 & -6 \\ -2 & 1 & -6\end{array}\right]$$ Example #4: Find A + B + C. $$A=\left[ \begin{array}{cc}2&-3\\ -2&-1 \\ 2 & 4\end{array}\right]$$ $$B=\left[ \begin{array}{cc}-5&-5\\ 4&-2 \\ 2 & 5\end{array}\right]$$ $$C=\left[ \begin{array}{cc}-2&-2\\ 1&2 \\ -5 & 0\end{array}\right]$$ Each matrix (A, B, and C) is a 3 × 2, so we can proceed with the addition operation. We will find the sum by adding the corresponding elements. $$A + B + C = \left[ \begin{array}{cc}2&-3\\ -2&-1 \\ 2 & 4\end{array}\right] + \left[ \begin{array}{cc}-5&-5\\ 4&-2 \\ 2 & 5\end{array}\right] + \left[ \begin{array}{cc}-2&-2\\ 1&2 \\ -5 & 0\end{array}\right]$$ $$=\left[ \begin{array}{cc}2 + (-5) + (-2)&-3 + (-5) + (-2)\\ -2 + 4 + 1&-1 + (-2) + 2 \\ 2 + 2 + (-5) & 4 + 5 + 0\end{array}\right]$$ $$=\left[ \begin{array}{cc}-5&-10\\ 3&-1 \\ -1 & 9\end{array}\right]$$ Example #5: Find A - B + C. $$A=\left[ \begin{array}{ccc}8&-1 & -1\\ 13 & 4 & 0\end{array}\right]$$ $$B=\left[ \begin{array}{ccc}11&9 & 12\\ 14 & -5 & -7\end{array}\right]$$ $$C=\left[ \begin{array}{ccc}2& 1 & 1\\ 8 & 1 & -2\end{array}\right]$$ Each matrix (A, B, and C) is a 2 × 3, so we can proceed with the adding and subtraction operations. We can do these at the same time or we can do A - B first and then add the result to C. Since the math here is pretty simple, we will choose to do everything in one run. $$A - B + C = \left[ \begin{array}{ccc}8&-1 & -1\\ 13 & 4 & 0\end{array}\right] - \left[ \begin{array}{ccc}11&9 & 12\\ 14 & -5 & -7\end{array}\right] + \left[ \begin{array}{ccc}2& 1 & 1\\ 8 & 1 & -2\end{array}\right]$$ $$= \left[ \begin{array}{ccc}8 - 11 + 2 & -1 - 9 + 1 & -1 - 12 + 1\\ 13 - 14 + 8 & 4 - (-5) + 1 & 0 - (-7) + (-2)\end{array}\right]$$ $$= \left[ \begin{array}{ccc}-1 & -9 & -12\\ 7 & 10 & 5\end{array}\right]$$

Zero Matrix

A matrix where all elements are equal to 0 is known as a zero matrix. A zero matrix can be written with any size.
A 4 × 3 zero matrix: $$0_{4 × 3} = \left[ \begin{array}{ccc}0 & 0 & 0\\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0\end{array}\right]$$ A 1 × 5 zero matrix: $$0_{1 × 5} = \left[ \begin{array}{c}0 & 0 & 0 & 0 & 0\end{array}\right]$$ It is normal for a textbook to refer to the zero matrix by using either a zero "0" or "O". It can be a bit confusing since these two look very similar, especially with certain fonts. For this tutorial, we will simply use a zero "0" when referring to the zero matrix. You may also see the order of the zero matrix listed using subscript notation. This can be used to clearly indicate the size of the zero matrix we are referring to.

Properties of Matrix Addition

If A, B, and C are m × n matrices and 0 is the m × n zero matrix (0m × n):
  • A + B = B + A
    • Commutative property of addition
    • We can add matrices A and B in any order
  • (A + B) + C = A + (B + C)
    • Associative property of addition
    • Changing the grouping doesn't change the sum
  • A + 0 = A
    • Additive identity property
    • Adding zero to every element in a matrix will leave the matrix unchanged
  • A + (-A) = 0
    • Additive inverse property
    • A and -A have opposite elements position by position, therefore the sum is the zero matrix
Let's look at an example.
Example #6: Find matrix X. $$A + X = 0_{3 × 3}$$ $$A=\left[ \begin{array}{ccc}1 & -3 & 5 \\ -1 & 3 & 7 \\ 2 & -8 & 9\end{array}\right]$$ Here, we will use our additive inverse property to find X. All we need to do is start with matrix A and then change each element into its opposite. $$X=\left[ \begin{array}{ccc}-1 & 3 & -5 \\ 1 & -3 & -7 \\ -2 & 8 & -9\end{array}\right]$$ We can check our result by adding A and X together, the result should be a zero matrix with an order of 3 × 3. $$A + X = \left[ \begin{array}{ccc}1 & -3 & 5 \\ -1 & 3 & 7 \\ 2 & -8 & 9\end{array}\right] + \left[ \begin{array}{ccc}-1 & 3 & -5 \\ 1 & -3 & -7 \\ -2 & 8 & -9\end{array}\right]$$ $$= \left[ \begin{array}{ccc}1 + (-1) & -3 + 3 & 5 + (-5) \\ -1 + 1 & 3 + (-3) & 7 + (-7) \\ 2 + (-2) & -8 + 8 & 9 + (-9)\end{array}\right]$$ $$= \left[ \begin{array}{ccc}0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0\end{array}\right]$$

Solving for Unknown Matrices

As we saw in the previous example, we will sometimes be asked to solve simple matrix equations for an unknown matrix, usually named X. The capital X is used here since matrices are named with capital letters. Let's look at an example.
Example #7: Find matrix X. $$X + A = B$$ $$A = \left[ \begin{array}{cc}-4 & 4 \\ -6 & 0 \\ 2 & 2 \\ 0 & -2\end{array}\right]$$ $$B = \left[ \begin{array}{cc}-4 & 5 \\ -7 & -5 \\ 1 & -2 \\ 4 & -8\end{array}\right]$$ Since we want to find our unknown matrix X, let's begin by solving the matrix equation for X: $$X + A = B$$ Subtract A away from each side: $$X = B - A$$ From our result above, we can see that matrix X is found by subtracting matrix A from matrix B. $$X = \left[ \begin{array}{cc}-4 & 5 \\ -7 & -5 \\ 1 & -2 \\ 4 & -8\end{array}\right] - \left[ \begin{array}{cc}-4 & 4 \\ -6 & 0 \\ 2 & 2 \\ 0 & -2\end{array}\right]$$ $$= \left[ \begin{array}{cc}-4 - (-4) & 5 - 4 \\ -7 - (-6) & -5 - 0 \\ 1 - 2 & -2 - 2 \\ 4 - 0 & -8 - (-2)\end{array}\right]$$ $$= \left[ \begin{array}{cc}0 & 1 \\ -1 & -5 \\ -1 & -4 \\ 4 & -6\end{array}\right]$$ You can easily check the result by adding the matrices A and X together. The sum will be matrix B.

Skills Check:

Example #1

Find A + B. $$A=\left[ \begin{array}{cc}9&5\\ 8&1\end{array}\right]$$ $$B=\left[ \begin{array}{cc}-4&2\\ 3&7\end{array}\right]$$

Please choose the best answer.

A
$$A + B = \left[ \begin{array}{cc}7&3\\ 2&-1\end{array}\right] $$
B
Sum doesn't exist
C
$$A + B = \left[\begin{array}{cc}5&7\\ 11&8\end{array}\right] $$
D
$$A + B = \left[\begin{array}{cc}-2&4\\ 3&7\end{array}\right] $$
E
$$A + B = \left[\begin{array}{cc}-4&7\\ 6&5\end{array}\right] $$

Example #2

Find A - B. $$A=\left[ \begin{array}{cc}3&6\\ -8&-3\end{array}\right] $$ $$B=\left[ \begin{array}{cc}-6&1\\ 2&-4\end{array}\right] $$

Please choose the best answer.

A
$$A - B = \left[ \begin{array}{cc}8&3\\ 2&-1\end{array}\right] $$
B
$$A - B = \left[ \begin{array}{cc}6&4\\ -3&2\end{array}\right] $$
C
$$A - B = \left[ \begin{array}{cc}-6&-2\\ 4&-5\end{array}\right] $$
D
$$A - B = \left[ \begin{array}{cc}9&5\\ -10&1\end{array}\right] $$
E
Difference doesn't exist

Example #3

Find matrix X. $$X - A = B$$ $$A=\left[ \begin{array}{c}-8 \\ -2 \\ 1 \\ -8\end{array}\right]$$ $$B=\left[ \begin{array}{c}4 \\ 2 \\-8 \\ -1\end{array}\right]$$

Please choose the best answer.

A
$$X = \left[ \begin{array}{c}4 \\ 0 \\ 7 \\ 9\end{array}\right]$$
B
$$X = \left[ \begin{array}{c}-4 \\ 0 \\ -7 \\ -9\end{array}\right]$$
C
$$X = \left[ \begin{array}{c}1 \\ -3 \\ 5 \\ 4\end{array}\right]$$
D
$$X = \left[ \begin{array}{c}-2 \\ 5 \\ 6 \\ -3\end{array}\right]$$
E
$$X = \left[ \begin{array}{c}9 \\ -5 \\ 8 \\ 12\end{array}\right]$$
checkmark x-mark
checkmark x-mark
checkmark x-mark

Congrats, Your Score is 100%

Trophy, You Win!

Better Luck Next Time, Your Score is %

Try again?

retry Trophy, You Win!