# Matrix Addition

Definition: Given two matrices $A$ and $B$, both of which are of size $m \times n$, then the sum denoted $A + B$ is an $m \times n$ matrix whose entries are formed by adding corresponding entries of $B$ to corresponding entries of $A$. If $C = A + B$, then $c_{ij} = a_{ij} + b_{ij}$. If the size of matrix $A$ and matrix $B$ are not the same size, then the sum $A + B$ is said to be undefined. |

Let's first look at the following $2 \times 3$ matrices $A$ and $B$:

(1)To determine the sum of matrix both matrices ($A + B$), we will add corresponding entries of $A$ to $B$. For example, to determine the first entry in our sum, we will take $a_{11} + b_{11}$, that is $3 + 2 = 5$:

(2)Therefore we have that:

(3)In general, if we have two $m \times n$ matrices $A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & & a_{2n}\\ \vdots & & \ddots & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix}$ and $B = \begin{bmatrix}b_{11} & b_{12} & \cdots & b_{1n}\\ b_{21} & b_{22} & & b_{2n}\\ \vdots & & \ddots & \vdots\\ b_{m1} & b_{m2} & \cdots & b_{mn} \end{bmatrix}$, then the sum $A + B$ is as follows:

(4)## Example 1

Given the following matrices, determine the resulting matrix $A + B$:

(5)We must first sum up corresponding entries:

(6)These are the entries of our matrix and therefore:

(7)# Matrix Subtraction

Definition: Given two matrices $A$ and $B$, both of which are of size $m \times n$, the difference $A - B$ is an $m \times n$ matrix whose entries are formed by subtracting entries of $B$ from corresponding entries of $A$. If $C = A - B$, then $c_{ij} = a_{ij} - b_{ij}$. If the size of matrix $A$ and matrix $B$ are not the same, then the difference $A - B$ is said to be undefined. |

Subtracting two same-size matrices is very similar to adding matrices with the only difference being subtracting corresponding entries.

## Example 2

**Using the matrices from example 1, determine the resulting matrix $A - B$.**

This time we will find the difference between the entries of $B$ from $A$ (taking an entry of $A$ and subtracting the corresponding entry in $B$):

(8)These are the entries of our matrix and therefore:

(9)