Linear System and Matrix
Matrix Inverse

Suppose

(1)   \begin{equation*}A =\left (\begin{array}{cc}1 & -1 \\ 2 & 1\end{array}\right ) ,B =\left (\begin{array}{cc}3 & 1 \\ 0 & -1\end{array}\right ) ,C =\left (\begin{array}{c}5 \\ -1\end{array}\right ) \end{equation*}

and we would like to compute 2A ,AB ,BA ,AC ,CA ,AB -BA ,\left (A +B\right )^{2} ,A^{2} +2AB +B^{2} when possible.

 

Let’s begin with the first one

(2)   \begin{equation*}2A =2\left (\begin{array}{cc}1 & -1 \\ 2 & 1\end{array}\right ) =\left (\begin{array}{cc}2 & -2 \\ 4 & 2\end{array}\right ) \end{equation*}

 

Next, we know multiplying two matrices

(3)   \begin{equation*}M_{a ,b}N_{b ,c} \end{equation*}

results in a matrix of size a by c. So, multiplyin two 2 by 2 matrices will result in a 2 by 2 matrix. We show the details of computation

(4)   \begin{align*}AB =\left (\begin{array}{cc}1 & -1 \\ 2 & 1\end{array}\right )\left (\begin{array}{cc}3 & 1 \\ 0 & -1\end{array}\right )\\ =\left (\begin{array}{cc}\left (1\right )\left (3\right ) +\left ( -1\right )\left (0\right ) & \left (1\right )\left (1\right ) +\left ( -1\right )\left ( -1\right ) \\ \left (2\right )\left (3\right ) +\left (1\right )\left (0\right ) & \left (2\right )\left (1\right ) +\left (1\right )\left ( -1\right )\end{array}\right ) \\ =\left (\begin{array}{cc}3 & 2 \\ 6 & 1\end{array}\right )\end{align*}

 

Next

(5)   \begin{align*}BA =\left (\begin{array}{cc}3 & 1 \\ 0 & -1\end{array}\right )\left (\begin{array}{cc}1 & -1 \\ 2 & 1\end{array}\right ) \\ =\left (\begin{array}{cc}\left (3\right )\left (1\right ) +\left (1\right )\left (2\right ) & \left (3\right )\left ( -1\right ) +\left (1\right )\left (1\right ) \\ \left (0\right )\left (1\right ) +\left ( -1\right )\left (2\right ) & \left (0\right )\left ( -1\right ) +\left ( -1\right )\left (1\right )\end{array}\right ) \\ =\left (\begin{array}{cc}5 & -1 \\ -2 & -1\end{array}\right )\end{align*}

 

This observation shows that in general for two matrices M and N the rule MN =NM may not be true. Next,

(6)   \begin{align*}AC =\left (\begin{array}{cc}1 & -1 \\ 2 & 1\end{array}\right )\left (\begin{array}{c}5 \\ -1\end{array}\right ) \\ =\left (\begin{array}{c}\left (1\right )\left (5\right ) +\left ( -1\right )\left ( -1\right ) \\ \left (2\right )\left (5\right ) +\left (1\right )\left ( -1\right )\end{array}\right ) \\ =\left (\begin{array}{c}6 \\ 9\end{array}\right )\end{align*}

As you see, the result of multiplying a 2 by 2 matrix by a 2 by 1 matrix on the right is a matrix of size 2 by 1. However, CA does not exist since we cannot multiply a 2 by 1 matrix by a 2 by 2 matrix on the right. Remember that the number of columns of the first matrix must be equal to the number of rows of the second one. Next

(7)   \begin{align*}AB -BA =\left (\begin{array}{cc}3 & 2 \\ 6 & 1\end{array}\right ) -\left (\begin{array}{cc}5 & -1 \\ -2 & -1\end{array}\right ) \\ =\left (\begin{array}{cc}3 -5 & 2 -\left ( -1\right ) \\ 6 -\left ( -2\right ) & 1 -\left ( -1\right )\end{array}\right ) \\ =\left (\begin{array}{cc} -2 & 3 \\ 8 & 2\end{array}\right )\end{align*}

 

Next, we compute \left (A +B\right )^{2}

(8)   \begin{align*}A +B =\left (\begin{array}{cc}1 & -1 \\ 2 & 1\end{array}\right ) +\left (\begin{array}{cc}3 & 1 \\ 0 & -1\end{array}\right ) \\ =\left (\begin{array}{cc}4 & 0 \\ 2 & 0\end{array}\right ) \\ \left (A +B\right )^{2} =\left (A +B\right )\left (A +B\right ) \\ =\left (\begin{array}{cc}4 & 0 \\ 2 & 0\end{array}\right )\left (\begin{array}{cc}4 & 0 \\ 2 & 0\end{array}\right ) \\ =\left (\begin{array}{cc}16 & 0 \\ 8 & 0\end{array}\right )\end{align*}

 

Next, we compute A^{2} +2AB +B^{2}

(9)   \begin{align*}A^{2} =\left (\begin{array}{cc}1 & -1 \\ 2 & 1\end{array}\right )\left (\begin{array}{cc}1 & -1 \\ 2 & 1\end{array}\right ) \\ =\left (\begin{array}{cc} -1 & -2 \\ 4 & -1\end{array}\right ) \\ 2AB =2\left (\begin{array}{cc}3 & 2 \\ 6 & 1\end{array}\right ) =\left (\begin{array}{cc}6 & 4 \\ 12 & 2\end{array}\right ) \\ B^{2} =\left (\begin{array}{cc}3 & 1 \\ 0 & -1\end{array}\right )\left (\begin{array}{cc}3 & 1 \\ 0 & -1\end{array}\right ) \\ =\left (\begin{array}{cc}9 & 2 \\ 0 & 1\end{array}\right ) \\ A^{2} +2AB +B^{2} =\left (\begin{array}{cc} -1 & -2 \\ 4 & -1\end{array}\right ) +\left (\begin{array}{cc}6 & 4 \\ 12 & 2\end{array}\right ) +\left (\begin{array}{cc}9 & 2 \\ 0 & 1\end{array}\right ) \\ =\left (\begin{array}{cc}14 & 4 \\ 16 & 2\end{array}\right )\end{align*}

As you see, in the world of matrices \left (A +B\right )^{2} \neq A^{2} +2AB +B^{2}. This is also due to the fact that AB \neq BA.

Leave a Reply