Theory:

In this section, we shall discuss the addition and subtraction of matrices, multiplication of a matrix by a scalar and multiplication of matrices.
Addition and subtraction of matrices:
  • Two matrices can be added or subtracted if they have the same order.
  • To add or subtract two matrices, simply add or subtract the corresponding elements.
Example:
Addition in matrices:
 
\(\begin{bmatrix}
a & b & c\\
d & e & f
\end{bmatrix} + \begin{bmatrix}
g & h & i\\
j & k & l
\end{bmatrix} = \begin{bmatrix}
a+g & b+h & c+i\\
d+j & e+k & f+l
\end{bmatrix}\)
 
Subtraction in matrices:
 
\(\begin{bmatrix}
a & b\\
c & d
\end{bmatrix} - \begin{bmatrix}
e & f\\
g & h
\end{bmatrix} = \begin{bmatrix}
a-e & b-f\\
c-g & d-h
\end{bmatrix}\)
If \(A = (a_{ij})\),  \(B = (b_{ij})\), \(i = 1, 2,...m\), and \(j = 1, 2, ….n\)
 
Condition of addition of matrices:
The order of the matrices should be equal when performing the addition of the matrices.
Example:
Let's look at the below two matrices.
 
\(A = \begin{bmatrix}
1 & 2 & 3\\
4 & 5 & 6\\
7 & 8 & 9
\end{bmatrix}, B =\begin{bmatrix}
1 & 2\\
3 & 4\\
5 & 6
\end{bmatrix}\) what will be the sum of \(A\) and \(B\)?
 
Solution:
 
Observing the above two matrices we can see that, the matrix \(A\) have \(3\)-columns and \(3\)-rows but the matrix \(B\) have \(3\)-columns and \(2\)-rows only.
 
\(A = (a_{ij}) = 3 × 3\) matrices and \(B = (a_{ij}) = 3 × 2\). 
 
When the orders of the two matrices are not equal, then we cannot perform the addition of the same matrices.
 
Therefore, it is impossible to add \(A\) and \(B\) since they have different orders.