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.
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\times 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 $A=\left[\begin{array}{rr}{4} &8 \\ 3 & 7 \end{array}\right]$ and $B=\left[\begin{array}{rr}{1} &0 \\ 5 & 2 \end{array}\right]$, let's find $A+B$.
We can find the sum simply by adding the corresponding entries in matrices $A$ and $B$. This is shown below.
\begin{aligned} {A}+{B} &= \left[\begin{array}{rr}{\blueD4} &\blueD{8} \\\blueD {3} & \blueD{7} \end{array}\right]+\left[\begin{array}{rr}{\goldD{1}} &\goldD{0} \\ \goldD{5} & \goldD{2} \end{array}\right] \\\\\\\\ &= \left[\begin{array}{rr}{\blueD4+\goldD{1}} &\blueD{8}+\goldD{0} \\\blueD{ 3}+\goldD{5} & \blueD7+\goldD2 \end{array}\right] \\\\\\\\ &= \left[\begin{array}{rr}{5} &8 \\ 8 & 9 \end{array}\right] \end{aligned}

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

\begin{aligned}A+B&=\left[\begin{array}{rr}{5} &2 \\ 0& 1 \\ 1 & 9 \end{array}\right]+\left[\begin{array}{rr}{2} &3 \\ 4& 1 \\ 0 & 2 \end{array}\right]\\ \\\\\\ &=\left[\begin{array}{rr}{5+2} &2+3 \\ 0+4& 1+1 \\ 1+0 & 9+2 \end{array}\right]\\ \\\\ &=\left[\begin{array}{rr}{7} &5 \\ 4& 2 \\ 1 & 11 \end{array}\right]\\ \end{aligned}
2)
${\left[\begin{array}{rr}{-10} &12 \\ -6& 3 \end{array}\right]}+\left[\begin{array}{rr}{-1} &4 \\ 22& 7 \end{array}\right]=$

\begin{aligned}{\left[\begin{array}{rr}{-10} &12 \\ -6& 3 \end{array}\right]}+\left[\begin{array}{rr}{-1} &4 \\ 22& 7 \end{array}\right]&={\left[\begin{array}{rr}{-10+(-1)} &12+4 \\ -6+22~~~~& 3+7 \end{array}\right]} \\\\ &=\left[\begin{array}{rr}{-11} &16 \\ 16& 10 \end{array}\right]\\ \end{aligned}

# Subtracting matrices

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

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

\begin{aligned}X-Y&=\left[\begin{array}{rr}{4} &16 \\ 10& 22 \end{array}\right]-\left[\begin{array}{rr}{1} &15 \\ 6& 3 \end{array}\right]\\ \\\\\\ &=\left[\begin{array}{rr}{4-1} &16-15 \\ 10-6& 22-3 \end{array}\right]\\ \\\\ &=\left[\begin{array}{rr}{3} &1 \\ 4& 19 \end{array}\right] \end{aligned}
4)
${\left[\begin{array}{rrr}{3} &4&9 \\ 6& 8&6 \\ 7& 3&4 \end{array}\right]}-\left[\begin{array}{rrr}{1} &6&7 \\ 6& 4&2 \\4&1&5 \end{array}\right]=$

\begin{aligned}{\left[\begin{array}{rrr}{3} &4&9 \\ 6& 8&6 \\ 7& 3&4 \end{array}\right]}-\left[\begin{array}{rrr}{1} &6&7 \\ 6& 4&2 \\4&1&5 \end{array}\right]&={\left[\begin{array}{rrr}{3-1} &4-6&9-7 \\ 6-6& 8-4&6-2 \\ 7-4& 3-1&4-5 \end{array}\right]}\\ \\\\ &=\left[\begin{array}{rrr}{2} &-2&2 \\ 0& 4&4 \\3&2&-1 \end{array}\right]\\ \end{aligned}

# Matrix equations

A matrix equation is simply an equation in which the variable stands for a matrix.
For example, the equation below is a matrix equation.
$A+{\left[\begin{array}{rr}{3} &5 \\ 2& 2 \end{array}\right]}={\left[\begin{array}{rr}{1} &0 \\ 10& 12 \end{array}\right]}$
A variable substitution makes solving this matrix equation easy.
If we let ${\greenD B= \greenD{ {\left[\begin{array}{rr}{3} &5 \\ 2& 2 \end{array}\right]}}}$ and ${\purpleC C=\purpleC{{\left[\begin{array}{rr}{1} &0 \\ 10& 12 \end{array}\right]}}}$, we obtain this equation:
\begin{aligned}A+\greenD B&=\purpleC C\\\\ A&=\purpleC C-\greenD B\qquad\text{Subtract B} \end{aligned}
We can now substitute matrices ${B}$ and ${C}$ and solve for $A$.
\begin{aligned}A &=\purpleC{C}-\greenD{B}\\\\\\ &=\purpleC{{\left[\begin{array}{rr}{1} &0 \\ 10& 12 \end{array}\right]}}{-\greenD{\left[\begin{array}{rr}{3} &5 \\ 2& 2 \end{array}\right]}}\\\\\\ &=\left[\begin{array}{rr}{1-3} &0-5 \\ 10-2&12-2 \end{array}\right]\\\\\\ &=\left[\begin{array}{rr}{-2} &-5 \\ 8& 10 \end{array}\right]\\ \end{aligned}
In general, we solve a matrix equation just like we would solve any linear equation, except that the operations we perform are with matrices!

5) Solve for $B$.
$~~~B-{\left[\begin{array}{rr}{1} &6 \\ 19& 3 \end{array}\right]}={\left[\begin{array}{rr}{4} &2 \\ 8& 1 \end{array}\right]}$
$B=$

If we let $A={\left[\begin{array}{rr}{1} &6 \\ 19& 3 \end{array}\right]}$ and $C={\left[\begin{array}{rr}{4} &2 \\ 8& 1 \end{array}\right]}$, we can rewrite the matrix equation as $B-A=C$.
Solving for $B$, we get $B=C+A$
We can now substitute matrices ${C}$ and ${A}$ and solve for $B$.
\begin{aligned} B&=C+A\\\\ &={\left[\begin{array}{rr}{4} &2 \\ 8& 1 \end{array}\right]}{+{\left[\begin{array}{rr}{1} &6 \\ 19& 3 \end{array}\right]}} \\\\\\&={\left[\begin{array}{}{4+1} &2+6 \\8+19& 1+3 \end{array}\right]}\\ \\\\ &=\left[\begin{array}{rr}{5} &8 \\ 27&4 \end{array}\right] \end{aligned}
6) Solve for $C$.
$~~~{\left[\begin{array}{rr}{5} &11 \\ -2& 6 \\13&-17 \end{array}\right]}+C={\left[\begin{array}{rr}{0} &1 \\ -3&20 \\4&14 \end{array}\right]}$
$C=$

If we let $A={\left[\begin{array}{rr}{5} &11 \\ -2& 6 \\13&-17 \end{array}\right]}$ and $B={\left[\begin{array}{rr}{0} &1 \\ -3&20 \\4&14 \end{array}\right]}$, we can rewrite the matrix equation as $A+C=B$.
Solving for $C$, we get $C=B-A$
We can now substitute matrices ${B}$ and ${A}$ and solve for $C$.
\begin{aligned}C&=B-A\\\\ &={\left[\begin{array}{rr}{0} &1 \\ -3&20 \\4&14 \end{array}\right]}{-{\left[\begin{array}{rr}{5} &11 \\ -2& 6 \\13&-17 \end{array}\right]}}\\\\\\ &={\left[\begin{array}{}{~~~0-5} &~~1-11 \\ -3-(-2)&20-6 \\~~~4-13&14-(-17) \end{array}\right]}\\ \\\\ &={\left[\begin{array}{rr}{-5} &-10 \\ -1& 14 \\-9&31 \end{array}\right]} \end{aligned}