If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: Precalculus>Unit 7

Lesson 4: Adding and subtracting matrices

Learn how to find the result of matrix addition and subtraction operations.

## What you should be familiar with before taking this lesson

A matrix is a rectangular arrangement of numbers into rows and columns. Each number in a matrix is referred to as a matrix element or entry.
$\begin{array}{c}\text{3 columns}\\ \\ \begin{array}{cccc}\text{2 rows}& ↓& ↓& ↓\\ \\ \begin{array}{c}\to \\ \\ \to \end{array}& \left[\begin{array}{c}-2\\ \\ 5\end{array}& \begin{array}{c}5\\ \\ 2\end{array}& \begin{array}{c}6\\ \\ 7\end{array}\right]\end{array}\end{array}$
The dimensions of a matrix give the number of rows and columns of the matrix in that order. Since matrix $A$ has $2$ rows and $3$ columns, it is called a $2×3$ matrix.
If this is new to you, we recommend that you check out our intro to matrices.

## What you will learn in this lesson

As long as the dimensions of two matrices are the same, we can add and subtract them much like we add and subtract numbers. Let's take a closer look!

Given $\mathbf{A}=\left[\begin{array}{cc}4& 8\\ \\ 3& 7\end{array}\right]$ and $\mathbf{B}=\left[\begin{array}{cc}1& 0\\ \\ 5& 2\end{array}\right]$, let's find $\mathbf{A}+\mathbf{B}$.
We can find the sum simply by adding the corresponding entries in matrices $\mathbf{A}$ and $\mathbf{B}$. This is shown below.
$\begin{array}{rl}\mathbf{A}+\mathbf{B}& =\left[\begin{array}{cc}4& 8\\ \\ 3& 7\end{array}\right]+\left[\begin{array}{cc}1& 0\\ \\ 5& 2\end{array}\right]\\ \\ & =\left[\begin{array}{cc}4+1& 8+0\\ \\ 3+5& 7+2\end{array}\right]\\ \\ & =\left[\begin{array}{cc}5& 8\\ \\ 8& 9\end{array}\right]\end{array}$

Problem 1
$\mathbf{A}=\left[\begin{array}{cc}5& 2\\ \\ 0& 1\\ \\ 1& 9\end{array}\right]$ and $\mathbf{B}=\left[\begin{array}{cc}2& 3\\ \\ 4& 1\\ \\ 0& 2\end{array}\right]$.
$\mathbf{A}+\mathbf{B}=$

Problem 2
$\left[\begin{array}{cc}-10& 12\\ \\ -6& 3\end{array}\right]+\left[\begin{array}{cc}-1& 4\\ \\ 22& 7\end{array}\right]=$

## Subtracting matrices

Similarly, to subtract matrices, we subtract the corresponding entries.
For example, let's consider $\mathbf{C}=\left[\begin{array}{cc}2& 8\\ \\ 0& 9\end{array}\right]$ and $\mathbf{D}=\left[\begin{array}{cc}5& 6\\ \\ 11& 3\end{array}\right]$.
We can find $\mathbf{C}-\mathbf{D}$ by subtracting the corresponding entries in matrices $\mathbf{C}$ and $\mathbf{D}$. This is shown below.
$\begin{array}{rl}\mathbf{C}-\mathbf{D}& =\left[\begin{array}{cc}2& 8\\ \\ 0& 9\end{array}\right]-\left[\begin{array}{cc}5& 6\\ \\ 11& 3\end{array}\right]\\ \\ & =\left[\begin{array}{cc}2-5& 8-6\\ \\ 0-11& 9-3\end{array}\right]\\ \\ & =\left[\begin{array}{cc}-3& 2\\ \\ -11& 6\end{array}\right]\end{array}$

Problem 3
$\mathbf{X}=\left[\begin{array}{cc}4& 16\\ \\ 10& 22\end{array}\right]$ and $\mathbf{Y}=\left[\begin{array}{cc}1& 15\\ \\ 6& 3\end{array}\right]$.
$\mathbf{X}-\mathbf{Y}=$

Problem 4
Subtract.
$\left[\begin{array}{ccc}3& 4& 9\\ \\ 6& 8& 6\\ \\ 7& 3& 4\end{array}\right]-\left[\begin{array}{ccc}1& 6& 7\\ \\ 6& 4& 2\\ \\ 4& 1& 5\end{array}\right]=$

## Scalar multiplication as repeated addition

Suppose we wanted to consider the repeated addition of a matrix.
If $\mathbf{A}=\left[\begin{array}{cc}4& 8\\ \\ 2& 1\end{array}\right]$, let's find $\mathbf{A}+\mathbf{A}+\mathbf{A}$.
$\begin{array}{rl}& \phantom{=}\mathbf{A}+\mathbf{A}+\mathbf{A}\\ \\ & =\left[\begin{array}{cc}4& 8\\ \\ 2& 1\end{array}\right]+\left[\begin{array}{cc}4& 8\\ \\ 2& 1\end{array}\right]+\left[\begin{array}{cc}4& 8\\ \\ 2& 1\end{array}\right]\\ \\ & =\left[\begin{array}{cc}4+4+4& 8+8+8\\ \\ 2+2+2& 1+1+1\end{array}\right]\\ \\ & =\left[\begin{array}{cc}3\cdot 4& 3\cdot 8\\ \\ 3\cdot 2& 3\cdot 1\end{array}\right]\\ \\ & =3\cdot \left[\begin{array}{cc}4& 8\\ \\ 2& 1\end{array}\right]\\ \\ & =3\mathbf{A}\end{array}$
Here we see that $\mathbf{A}+\mathbf{A}+\mathbf{A}=3\mathbf{A}$.
This is true for other scalar multiplications, so we can interpret scalar multiplication in the same way as we interpret multiplication with real numbers–as repeated matrix addition!

## Subtraction as the addition of the opposite

Another way scalar multiplication relates to addition and subtraction is by thinking about $\mathbf{A}-\mathbf{B}$ as $\mathbf{A}+\left(-\mathbf{B}\right)$, which is in turn the same as $\mathbf{A}+\left(-1\right)\cdot \mathbf{B}$. This is similar to how we can think about subtraction of two real numbers!

## Want to join the conversation?

• How do matrices actually help in the real world? Where could I apply this knowledge?
• Hi Anjana,

Do you remember solving systems of equations:

You will be glad to know that matrix notation makes this task trivial.

As you continue your study of math I hope you take a class in linear algebra where the matrix is an essential tool. From time to time I'm still amazed at real world applications especially in engineering.

Regards,

APD
• Why is it undefined when adding matrices of different dimensions? Can't you just add the corresponding elements and leave the elements that don't have corresponding parts the same?
• You cannot just add the corresponding elements and leave the elements that don't have corresponding parts the same. It does not mean that it's a 0 if they don't have the "parts". It means they are undefined.
• this was the hardest subject to actually learn. the negative numbers really trick you.
• Would adding a 2x1 matrix to a 3x1 be like adding a 2 dimensional vector to a 3 dimensional vector? Or is there a better way to do this? Could an extra zero be added to the 2x1 to make it a 3x1?
• The problem is that there is no good way to standardize where the zero would get added. Why would turning <1, 2> into <1, 2, 0> be better or worse than turning it into <0, 1, 2>, or even <1, 0, 2>?
• Means dimensions of matrices should always be same?
• If you wish to add and subtract them, yes. If you wish to multiply them or use them in other ways, then not necessarily.
• the second to last question. Wasn't it supposed to be subtraction and not addition because of the showing on top?
• To solve an equation like this, it is useful to think of the matrices as variables. So in this case, we have an equation along the lines of B-A=C with A representing the first matrix and the second one being represented by C. The goal of this is to isolate B and we accomplish this by adding A to both sides, leaving us with B=C+A. Now, we can substitue the matrices back in for the variables, leaving us with the answer. Look a little above this to see how Sal explained it.
• I put -11, 16, 16, 10 for problem 2, but it said it was incorrect. I clicked on the 'I need help' button, and it had the same answer, but it was still marked as incorrect. What did I do wrong?