Skip to main content
Mathematics LibreTexts

2.2: Matrix Multiplication

  • Page ID
    205205
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives


    After studying this section, I can:  

    - Determine when two matrices are conformable for multiplication.  
    - Multiply a row vector by a column vector and identify the dot product.  
    - Multiply a column vector by a row vector and identify the outer product.  
    - Multiply an \(m \times n\) matrix by an \(n \times 1\) column vector and interpret the result as a linear combination of the columns of the matrix.  
    - Multiply two matrices and determine the size of the product.  
    - Apply key properties of matrix multiplication, including distributive and associative laws, while recognizing that multiplication is not commutative.  
    - Express systems of linear equations in vector form and matrix form using matrix multiplication.  
    - Construct the augmented matrix of a system of equations from its coefficient matrix and constant vector.  

    In the previous section, matrix addition felt intuitive. Now we turn to the question of what it means to multiply matrices. To start, consider the product
    \[
    \left[\begin{array}{cc}1&2\\[2pt]3&4\end{array}\right]\:\times\:
    \left[\begin{array}{cc}1&-1\\[2pt]2&2\end{array}\right] \nonumber
    \]
    What does this mean? A natural (but incorrect) guess is the entrywise product
    \[
    \left[\begin{array}{cc}1&-2\\[2pt]6&8\end{array}\right] \nonumber
    \]
    However, that is not how matrix multiplication is defined. The correct product is
    \[
    \left[\begin{array}{cc}5&3\\[2pt]11&5\end{array}\right]. \nonumber
    \]
    So, unlike addition, matrix multiplication does not proceed entry by entry; it follows a different rule (which we will make precise shortly). To complicate matters further—and to hint at the real rule—look at
    \[
    \left[\begin{array}{cc}1&2\\[2pt]3&4\end{array}\right]\:\times\:
    \left[\begin{array}{ccc}1&-1&0\\[2pt]2&2&-1\end{array}\right]. \nonumber
    \]
    Even though these matrices do not have the same size (so they cannot be added), this product is defined, and it equals
    \[
    \left[\begin{array}{ccc}5&3&-2\\[2pt]11&5&-4\end{array}\right]. \nonumber
    \]
    (Notice that multiplying a \(2\times2\) matrix by a \(2\times3\) matrix produced a \(2\times3\) matrix.)

    We will now step back and build the rule for matrix multiplication carefully. As a first step, we give an alternative definitions of the row and column matrices introduced in the previous section. 

    Definition: Column and Row Vectors

    A row vector is a row matrix of size \(1 \times n\), for example  
    \[
    a = \begin{bmatrix} a_1 & a_2 & \cdots & a_n \end{bmatrix}.
    \]

    A column vector is a column matrix of size \(m \times 1\), for example  
    \[
    b = \begin{bmatrix} b_1 \\ b_2 \\ \vdots \\ b_m \end{bmatrix}.
    \]

     An example of a row vector is

    \[ a=\left[\begin{array}{cccc}{1}&{2}&{-1}&{0}\end{array}\right] \nonumber \]

    and an example of a column vector is

    \[b=\left[\begin{array}{c}{1}\\{7}\\{8}\end{array}\right] . \nonumber \]

    Before we learn how to multiply matrices in general, we will learn what it means to multiply a row vector by a column vector.

    Definition: Multiply a Row Vector by a Column Vector

    Let \(a\) be a \(1 \times n\) row vector with entries \(a_{1}, a_{2}, \cdots , a_{n}\) and let \(b\) be an \(n \times 1\) column vector with entries \(b_{1}, b_{2}, \cdots , b_{n}\). The product of \(a\) and \(b\), denoted \(ab\), is  

    \[
    a b =
    \begin{bmatrix}
    a_{1} & a_{2} & \cdots & a_{n}
    \end{bmatrix}
    \begin{bmatrix}
    b_{1} \\ b_{2} \\ \vdots \\ b_{n}
    \end{bmatrix}
    = a_{1}b_{1} + a_{2}b_{2} + \cdots + a_{n}b_{n}. \nonumber
    \]

    One should note the following in the definition:  

    •  The row vector \(a\) must have \(n\) columns and the column vector \(b\) must have \(n\) rows in order for the product \(ab\) to be defined.  
    •  The expression \(\sum_{i=1}^{n} a_{i} b_{i} = a_{1}b_{1} + a_{2}b_{2} + \cdots + a_{n}b_{n}\) is a scalar, or equivalently, a \(1 \times 1\) matrix 

    Before we state the condition for multiplying matrices in general, let us first look at an example.

    Example \(\PageIndex{1}\)

    Let

    \[
    a=\left[\begin{array}{ccc}{1}&{2}&{3}\end{array}\right],\:
    b=\left[\begin{array}{cccc}{2}&{0}&{1}&{-1}\end{array}\right],\:
    x=\left[\begin{array}{c}{-2}\\{4}\\{3}\end{array}\right],\:
    y=\left[\begin{array}{c}{1}\\{2}\\{5}\\{0}\end{array}\right] .\nonumber
    \]

    Find the following products.

    \[
    ax,\quad by,\quad ay,\quad ab,\quad xa
    \]

    Solution


    \[
    ax=\left[\begin{array}{ccc}{1}&{2}&{3}\end{array}\right]
    \left[\begin{array}{c}{-2}\\{4}\\{3}\end{array}\right]
    =1(-2)+2(4)+3(3)=15
    \]

    \[
    by=\left[\begin{array}{cccc}{2}&{0}&{1}&{-1}\end{array}\right]
    \left[\begin{array}{c}{1}\\{2}\\{5}\\{0}\end{array}\right]
    =2(1)+0(2)+1(5)-1(0)=7
    \]
    ay is not defined. A row vector and column vector must have the same number of entries in order to multiply.

    ab is not defined. We only know how to multiply a row vector by a column vector, not two row vectors.

    xa is defined, but we have not learned how to compute it yet. At this point, we only know how to multiply a row vector by a column vector, not a column vector by a row vector. (Indeed, \(ax \neq xa\)!).

    We notice that size is crucial when multiplying column and row matrices.  

    Before introducing the general definition of matrix multiplication, we say that two matrices \(A\) and \(B\) are multiplication conformable if and only if the number of columns of \(A\) equals the number of rows of \(B\).

    Definition: Matrix Multiplication

    Let \(A\) be an \(m\times r\) matrix, and let \(B\) be an \(r\times n\) matrix. The matrix product of \(A\) and \(B\), denoted \(A\cdot B\), or simply \(AB\), is the \(m\times n\) matrix \(M\) whose entry in the \(i^{\text{th}}\) row and \(j^{\text{th}}\) column is the product of the \(i^{\text{th}}\) row of \(A\) and the \(j^{\text{th}}\) column of \(B\).

    It may help to illustrate it in this way. Let matrix \(A\) have rows \(a_{1}, a_{2}, \cdots, a_{m}\) and let \(B\) have columns \(b_{1}, b_{2}, \cdots, b_{n}\). Thus \(A\) looks like

    \[
    \left[\begin{array}{ccc}
    {-}&{a_{1}}&{-}\\
    {-}&{a_{2}}&{-}\\
    {}&{\vdots}&{}\\
    {-}&{a_{m}}&{-}
    \end{array}\right] \nonumber
    \]

    where the “\(-\)” symbols just serve as reminders that the \(a_i\) represent rows, and \(B\) looks like

    \[
    \left[\begin{array}{cccc}
    {|}&{|}&{}&{|}\\
    {b_{1}}&{b_{2}}&{\cdots}&{b_{n}}\\
    {|}&{|}&{}&{|}
    \end{array}\right] \nonumber
    \]

    where again, the “\(|\)” symbols just remind us that the \(b_i\) represent column vectors. Then

    \[
    AB=\left[\begin{array}{cccc}
    a_{1}b_{1} & a_{1}b_{2} & \cdots & a_{1}b_{n} \\ 
    a_{2}b_{1} & a_{2}b_{2} & \cdots & a_{2}b_{n} \\ 
    \vdots & \vdots & \ddots & \vdots \\
    a_{m}b_{1} & a_{m}b_{2} & \cdots & a_{m}b_{n}
    \end{array}\right] \nonumber
    \]

    Two quick notes about this definition. First, in order for \(A\) and \(B\) to be conformable for multiplication, the number of columns of \(A\) must be the same as the number of rows of \(B\) (these are called the “inner dimensions”). Secondly, the resulting matrix has the same number of rows as \(A\) and the same number of columns as \(B\) (these are called the “outer dimensions”).

    \[\begin{array}{c}{\text{final dimensions are the outer}}\\{\text{dimensions}}\\{\overbrace{(m\times \underbrace{r)\times (r}\times n)}}\\{\text{these inner dimensions}}\\{\text{must match}}\end{array}\nonumber \]

    Example \(\PageIndex{2}\)

    Revisit the matrix product we saw at the beginning of this section; multiply

    \[\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right]\:\left[\begin{array}{ccc}{1}&{-1}&{0}\\{2}&{2}&{-1}\end{array}\right] \nonumber \]

    Solution

    Let’s call our first matrix \(A\) and the second \(B\). We should first check to see that we can actually perform this multiplication. Matrix \(A\) is \(2\times 2\) and \(B\) is \(2\times 3\). The “inner” dimensions match up, so we can compute the product; the “outer” dimensions tell us that the product will be \(2\times 3\). Let

    \[AB=\left[\begin{array}{ccc}{m_{11}}&{m_{12}}&{m_{13}}\\{m_{21}}&{m_{22}}&{m_{23}}\end{array}\right] . \nonumber \]

    Let’s find the value of each of the entries.

    The entry \(m_{11}\) is in the first row and first column; therefore to find its value, we need to multiply the first row of \(A\) by the first column of \(B\). Thus

    \[m_{11}=\left[\begin{array}{cc}{1}&{2}\end{array}\right]\:\left[\begin{array}{c}{1}\\{2}\end{array}\right] \nonumber \]=1(1)+2(2)=5. \nonumber \]

    So now we know that

    \[AB=\left[\begin{array}{ccc}{5}&{m_{12}}&{m_{13}}\\{m_{21}}&{m_{22}}&{m_{23}}\end{array}\right] . \nonumber \]

    Finishing out the first row, we have

    \[m_{12}=\left[\begin{array}{cc}{1}&{2}\end{array}\right]\:\left[\begin{array}{c}{-1}\\{2}\end{array}\right]=1(-1)+2(2)=3 \nonumber \]

    using the first row of \(A\) and the second column of \(B\), and

    \[m_{13}=\left[\begin{array}{cc}{1}&{2}\end{array}\right]\:\left[\begin{array}{c}{0}\\{-1}\end{array}\right]=1(0)+2(-1)=-2 \nonumber \]

    using the first row of \(A\) and the third column of \(B\). Thus we have

    \[AB=\left[\begin{array}{ccc}{5}&{3}&{-2}\\{m_{21}}&{m_{22}}&{m_{23}}\end{array}\right] . \nonumber \]

    To compute the second row of \(AB\), we multiply with the second row of \(A\). We find

    \[m_{21}=\left[\begin{array}{cc}{3}&{4}\end{array}\right]\:\left[\begin{array}{c}{1}\\{2}\end{array}\right]=11, \nonumber \]

    \[m_{22}=\left[\begin{array}{cc}{3}&{4}\end{array}\right]\:\left[\begin{array}{c}{-1}\\{2}\end{array}\right]=5, \nonumber \]

    and

    \[m_{23}=\left[\begin{array}{cc}{3}&{4}\end{array}\right]\:\left[\begin{array}{c}{0}\\{-1}\end{array}\right]=-4 . \nonumber \]

    Thus

    \[AB=\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right]\:\left[\begin{array}{ccc}{1}&{-1}&{0}\\{2}&{2}&{-1}\end{array}\right]=\left[\begin{array}{ccc}{5}&{3}&{-2}\\{11}&{5}&{-4}\end{array}\right] . \nonumber \]

    Example \(\PageIndex{3}\)

    Multiply

    \[\left[\begin{array}{cc}{1}&{-1}\\{5}&{2}\\{-2}&{3}\end{array}\right]\:\left[\begin{array}{cccc}{1}&{1}&{1}&{1}\\{2}&{6}&{7}&{9}\end{array}\right] . \nonumber \]

    Solution

    Let’s first check to make sure this product is defined. Again calling the first matrix \(A\) and the second \(B\), we see that \(A\) is a \(3\times 2\) matrix and \(B\) is a \(2\times4\) matrix; the inner dimensions match so the product is defined, and the product will be a \(3\times 4\) matrix,

    \[AB=\left[\begin{array}{cccc}{m_{11}}&{m_{12}}&{m_{13}}&{m_{14}}\\{m_{21}}&{m_{22}}&{m_{23}}&{m_{24}} \\ {m_{31}}&{m_{32}}&{m_{33}}&{m_{34}}\end{array}\right] . \nonumber \]

    We will demonstrate how to compute some of the entries, then give the final answer. The reader can fill in the details of how each entry was computed.

    \[m_{11}=\left[\begin{array}{cc}{1}&{-1}\end{array}\right]\:\left[\begin{array}{c}{1}\\{2}\end{array}\right]=-1 . \nonumber \]

    \[m_{13}=\left[\begin{array}{cc}{1}&{-1}\end{array}\right]\:\left[\begin{array}{c}{1}\\{7}\end{array}\right]=-6 . \nonumber \]

    \[m_{23}=\left[\begin{array}{cc}{5}&{2}\end{array}\right]\:\left[\begin{array}{c}{1}\\{7}\end{array}\right]=19 . \nonumber \]

    \[m_{24}=\left[\begin{array}{cc}{5}&{2}\end{array}\right]\:\left[\begin{array}{c}{1}\\{9}\end{array}\right]=23 . \nonumber \]

    \[m_{32}=\left[\begin{array}{cc}{-2}&{3}\end{array}\right]\:\left[\begin{array}{c}{1}\\{6}\end{array}\right]=16 . \nonumber \]

    \[m_{34}=\left[\begin{array}{cc}{-2}&{3}\end{array}\right]\:\left[\begin{array}{c}{1}\\{9}\end{array}\right]=25 . \nonumber \]

    So far, we’ve computed this much of \(AB\):

    \[AB=\left[\begin{array}{cccc}{-1}&{m_{12}}&{-6}&{m_{14}}\\{m_{21}}&{m_{22}}&{19}&{23}\\{m_{31}}&{16}&{m_{33}}&{25}\end{array}\right] . \nonumber \]

    The final product is

    \[AB=\left[\begin{array}{cccc}{-1}&{-5}&{-6}&{-8}\\{9}&{17}&{19}&{23}\\{4}&{16}&{19}&{25}\end{array}\right] . \nonumber \]

    Example \(\PageIndex{4}\)

    Multiply, if possible

    \[\left[\begin{array}{ccc}{2}&{3}&{4}\\{9}&{8}&{7}\end{array}\right]\:\left[\begin{array}{cc}{3}&{6}\\{5}&{-1}\end{array}\right] . \nonumber \]

    Solution

    Notice that \(A)\ and \(B)\ are not conformable.

    Example \(\PageIndex{5}\)

    In Example \(\PageIndex{1}\), we were told that the product \(\vec{x}\vec{u}\) was defined, where

    \[\vec{x}=\left[\begin{array}{c}{-2}\\{4}\\{3}\end{array}\right]\quad\text{and}\quad\vec{u}=\left[\begin{array}{ccc}{1}&{2}&{3}\end{array}\right] , \nonumber \]

    although we were not shown what the product was. Find \(\vec{x}\vec{u}\).

    Solution

    Again, we need to check to make sure the dimensions work correctly (remember that even though we are referring to \(u\) and \(x\) as vectors, they are, in fact, just matrices).

    The column vector \(x\) has dimensions \(3\times1\), whereas the row vector \(u\) has dimensions \(1\times 3\). Since the inner dimensions do match, the matrix product is defined; the outer dimensions tell us that the product will be a \(3\times3\) matrix, as shown below:

    \[
    xu=\left[\begin{array}{ccc}
    m_{11} & m_{12} & m_{13} \\
    m_{21} & m_{22} & m_{23} \\
    m_{31} & m_{32} & m_{33}
    \end{array}\right]. \nonumber
    \]

    To compute the entry \(m_{11}\), we multiply the first row of \(x\) by the first column of \(u\). What is the first row of \(x\)? It is just the number \(-2\). What is the first column of \(u\)? It is the number 1. Thus \(m_{11} = -2\).

    For the entry \(m_{12}\), we multiply the first row of \(x\) by the second column of \(u\); that is, we compute \(-2(2)\). So \(m_{12} = -4\).

    For the entry \(m_{23}\), we multiply the second row of \(x\) by the third column of \(u\); that is, \(4(3)\), so \(m_{23} = 12\).

    One final example: \(m_{31}\) comes from multiplying the third row of \(x\), which is 3, by the first column of \(u\), which is 1. Therefore \(m_{31} = 3\).

    So far we have computed

    \[
    xu=\left[\begin{array}{ccc}
    -2 & -4 & m_{13} \\
    m_{21} & m_{22} & 12 \\
    3 & m_{32} & m_{33}
    \end{array}\right]. \nonumber
    \]

    After performing all 9 multiplications, we find

    \[
    xu=\left[\begin{array}{ccc}
    -2 & -4 & -6 \\
    4 & 8 & 12 \\
    3 & 6 & 9
    \end{array}\right]. \nonumber
    \]

    In this last example, we saw a “nonstandard” multiplication (at least, it felt nonstandard). Studying the entries of this matrix, it seems that there are several different patterns that can be seen amongst the entries. (Remember that mathematicians like to look for patterns. Also remember that we often guess wrong at first; don’t be scared and try to identify some patterns.)
    In Section 2.1, we identified the zero matrix \(\mathbf{0}\) that had a nice property in relation to matrix addition (i.e., \(A+\mathbf{0}=A\) for any matrix \(A\)). In the following example we’ll identify a matrix that works well with multiplication as well as some multiplicative properties. For instance, we’ve learned how \(1\cdot A=A\); is there a matrix that acts like the number 1? That is, can we find a matrix \(X\) where \(X\cdot A=A\)?\(^{3}\)

    Example \(\PageIndex{6}\)

    Let

    \[\begin{array}{cc}{A=\left[\begin{array}{ccc}{1}&{2}&{3}\\{2}&{-7}&{5}\\{-2}&{-8}&{3}\end{array}\right],}&{B=\left[\begin{array}{ccc}{1}&{1}&{1}\\{1}&{1}&{1}\\{1}&{1}&{1}\end{array}\right]}\\ {C=\left[\begin{array}{ccc}{1}&{0}&{2}\\{2}&{1}&{0}\\{0}&{2}&{1}\end{array}\right],} &{I=\left[\begin{array}{ccc}{1}&{0}&{0}\\{0}&{1}&{0}\\{0}&{0}&{1}\end{array}\right] .}\end{array}\nonumber \]

    Find the following products.

    1. \(AB\)
    2. \(BA\)
    3. \(A\mathbf{0}_{3\times 4}\)
    4. \(AI\)
    5. \(IA\)
    6. \(I^{2}\)
    7. \(BC\)
    8. \(B^{2}\)

    Solution

    We will find each product, but we leave the details of each computation to the reader.

    1. \(AB=\left[\begin{array}{ccc}{1}&{2}&{3}\\{2}&{-7}&{5}\\{-2}&{-8}&{3}\end{array}\right]\:\left[\begin{array}{ccc}{1}&{1}&{1}\\{1}&{1}&{1}\\{1}&{1}&{1}\end{array}\right]=\left[\begin{array}{ccc}{6}&{6}&{6}\\{0}&{0}&{0}\\{-7}&{-7}&{-7}\end{array}\right]\)
    2. \(BA=\left[\begin{array}{ccc}{1}&{1}&{1}\\{1}&{1}&{1}\\{1}&{1}&{1}\end{array}\right]\:\left[\begin{array}{ccc}{1}&{2}&{3}\\{2}&{-7}&{5}\\{-2}&{-8}&{3}\end{array}\right]=\left[\begin{array}{ccc}{1}&{-13}&{11}\\{1}&{-13}&{11}\\{1}&{-13}&{11}\end{array}\right]\)
    3. \(A\mathbf{0}_{3\times 4}=\mathbf{0}_{3\times 4}\).
    4. \(AI=\left[\begin{array}{ccc}{1}&{2}&{3}\\{2}&{-7}&{5}\\{-2}&{-8}&{3}\end{array}\right]\:\left[\begin{array}{ccc}{1}&{0}&{0}\\{0}&{1}&{0}\\{0}&{0}&{1}\end{array}\right]=\left[\begin{array}{ccc}{1}&{2}&{3}\\{2}&{-7}&{5}\\{-2}&{-8}&{3}\end{array}\right]\)
    5. \(IA=\left[\begin{array}{ccc}{1}&{0}&{0}\\{0}&{1}&{0}\\{0}&{0}&{1}\end{array}\right]\:\left[\begin{array}{ccc}{1}&{2}&{3}\\{2}&{-7}&{5}\\{-2}&{-8}&{3}\end{array}\right]=\left[\begin{array}{ccc}{1}&{2}&{3}\\{2}&{-7}&{5}\\{-2}&{-8}&{3}\end{array}\right]\)
    6. We haven't formally defined what \(I^{2}\) means, but we could probably make the reasonable guess that \(I^{2}=I\cdot I\). Thus
      \[I^{2}=\left[\begin{array}{ccc}{1}&{0}&{0}\\{0}&{1}&{0}\\{0}&{0}&{1}\end{array}\right]\:\left[\begin{array}{ccc}{1}&{0}&{0}\\{0}&{1}&{0}\\{0}&{0}&{1}\end{array}\right]=\left[\begin{array}{ccc}{1}&{0}&{0}\\{0}&{1}&{0}\\{0}&{0}&{1}\end{array}\right]\nonumber \]
    7. \(BC=\left[\begin{array}{ccc}{1}&{1}&{1}\\{1}&{1}&{1}\\{1}&{1}&{1}\end{array}\right]\:\left[\begin{array}{ccc}{1}&{0}&{2}\\{2}&{1}&{0}\\{0}&{2}&{1}\end{array}\right]=\left[\begin{array}{ccc}{3}&{3}&{3}\\{3}&{3}&{3}\\{3}&{3}&{3}\end{array}\right]\)
    8. \(B^{2}=BB=\left[\begin{array}{ccc}{1}&{1}&{1}\\{1}&{1}&{1}\\{1}&{1}&{1}\end{array}\right]\:\left[\begin{array}{ccc}{1}&{1}&{1}\\{1}&{1}&{1}\\{1}&{1}&{1}\end{array}\right]=\left[\begin{array}{ccc}{3}&{3}&{3}\\{3}&{3}&{3}\\{3}&{3}&{3}\end{array}\right]\)

    This example is simply chock full of interesting ideas; it is almost hard to think about where to start.

    Interesting Idea #1: Notice that in our example, \(AB\neq BA\)! When dealing with numbers, we were used to the idea that \(ab = ba\). With matrices, multiplication is not commutative. (Of course, we can find special situations where it does work. In general, though, it doesn’t.)

    Interesting Idea #2: Right before this example we wondered if there was a matrix that “acted like the number 1,” and guessed it may be a matrix of all 1s. However, we found out that such a matrix does not work in that way; in our example, \(AB\neq A\). We did find that \(AI=IA=A\). There is a Multiplicative Identity; it just isn’t what we thought it would be. And just as \(1^2 = 1\), \(I^{2}=I\).

    Interesting Idea #3: When dealing with numbers, we are very familiar with the notion that “If \(ax = bx\), then \(a=b\).” (As long as \(x\neq 0\).) Notice that, in our example, \(BB=BC\), yet \(B\neq C\). In general, just because \(AX=BX\), we cannot conclude that \(A=B\).
    Matrix multiplication is turning out to be a very strange operation. We are very used to multiplying numbers, and we know a bunch of properties that hold when using this type of multiplication. When multiplying matrices, though, we probably find ourselves asking two questions, “What does work?” and “What doesn’t work?” We’ll answer these questions; first we’ll do an example that demonstrates some of the things that do work.

    Example \(\PageIndex{7}\)

    Let

    \[A=\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right],\quad B=\left[\begin{array}{cc}{1}&{1}\\{1}&{-1}\end{array}\right]\quad\text{and}\quad C=\left[\begin{array}{cc}{2}&{1}\\{1}&{2}\end{array}\right] . \nonumber \]

    Find the following:

    1. \(A(B+C)\)
    2. \(AB+AC\)
    3. \(A(BC)\)
    4. \((AB)C\)

    Solution

    We’ll compute each of these without showing all the intermediate steps. Keep in mind order of operations: things that appear inside of parentheses are computed first.

    1. \[\begin{aligned}A(B+C)&=\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right]\left(\left[\begin{array}{cc}{1}&{1}\\{1}&{-1}\end{array}\right]+\left[\begin{array}{cc}{2}&{1}\\{1}&{2}\end{array}\right]\right) \\ &=\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right]\left[\begin{array}{cc}{3}&{2}\\{2}&{1}\end{array}\right] \\ &=\left[\begin{array}{cc}{7}&{4}\\{17}&{10}\end{array}\right]\end{aligned} \nonumber \]
    2. \[\begin{aligned}AB+AC&=\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right]\left[\begin{array}{cc}{1}&{1}\\{1}&{-1}\end{array}\right]+\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right]\left[\begin{array}{cc}{2}&{1}\\{1}&{2}\end{array}\right] \\ &=\left[\begin{array}{cc}{3}&{-1}\\{7}&{-1}\end{array}\right]+\left[\begin{array}{cc}{4}&{5}\\{10}&{11}\end{array}\right] \\ &=\left[\begin{array}{cc}{7}&{4}\\{17}&{10}\end{array}\right]\end{aligned} \nonumber \]
    3. \[\begin{aligned}A(BC)&=\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right]\left(\left[\begin{array}{cc}{1}&{1}\\{1}&{-1}\end{array}\right]\left[\begin{array}{cc}{2}&{1}\\{1}&{2}\end{array}\right]\right) \\ &=\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right]\left[\begin{array}{cc}{3}&{3}\\{1}&{-1}\end{array}\right] \\ &=\left[\begin{array}{cc}{5}&{1}\\{13}&{5}\end{array}\right]\end{aligned} \nonumber \]
    4. \[\begin{aligned}(AB)C&=\left(\left[\begin{array}{cc}{1}&{2}\\{3}&{4}\end{array}\right]\left[\begin{array}{cc}{1}&{1}\\{1}&{-1}\end{array}\right]\right) \left[\begin{array}{cc}{2}&{1}\\{1}&{2}\end{array}\right] \\ &=\left[\begin{array}{cc}{3}&{-1}\\{7}&{-1}\end{array}\right]\left[\begin{array}{cc}{2}&{1}\\{1}&{2}\end{array}\right] \\ &=\left[\begin{array}{cc}{5}&{1}\\{13}&{5}\end{array}\right]\end{aligned} \nonumber \]

    Looking back at our example, two important patterns appear. First, the distributive property seems to hold; that is, \(A(B+C)=AB+AC\). This is encouraging, since many of the algebraic rules we are used to from ordinary algebra still apply to matrices. Second, the associative property also seems to hold; that is, \(A(BC)=(AB)C\). This means that when multiplying several matrices, we do not have to worry about the order in which we carry out the pairwise products.  

    With these observations in place, we are ready to move toward an important theorem. To do so, let us recall a matrix we encountered in an earlier example.


    In the previous section we introduced an important type of matrix. We now give its official definition.

    Definition: Identity Matrix

    The \(n\times n\) matrix with 1’s on the diagonal and zeros elsewhere is the \(n\times n\) identity matrix, denoted \(I_{n}\). When the context makes the dimension of the identity clear, the subscript is generally omitted.

    Just as the zero matrix can take many different shapes and sizes, the identity matrix has a special property: it is always square. A few examples are shown below.

    \[
    I_{2}=\left[\begin{array}{cc}1&0\\0&1\end{array}\right],\quad 
    I_{3}=\left[\begin{array}{ccc}1&0&0\\0&1&0\\0&0&1\end{array}\right],\quad 
    I_{4}=\left[\begin{array}{cccc}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&1\end{array}\right] \nonumber
    \]

    Up to this point, we have experimented with examples to see what works and what does not. Examples are helpful, but they have limits. If someone claimed that \(AB=BA\) always holds, it would only take one counterexample to show that the claim is false. On the other hand, if someone claimed that \(A(B+C)=AB+AC\) is always true, one example is not enough to prove the claim; we need something stronger—a proof.  

    In this text we will not provide full proofs for every statement. The important point to remember is that whenever we present a theorem, there is a proof behind it. Our confidence comes from more than just trying out examples.  

    With that in mind, let us now turn to the good news: the properties of matrix multiplication that always work.

    Theorem \(\PageIndex{1}\)

    Properties of Matrix Multiplication

    Let \(A\), \(B\) and \(C\) be matrices with dimensions so that the following operations make sense, and let \(k\) be a scalar. The following equalities hold:

    1. \(A(BC) = (AB)C\) (Associative Property)
    2. \(A(B + C) = AB + AB\) and
      \((B + C)A = BA + CA\) (Distributive Property)
    3. \(k(AB) = (kA)B = A(kB)\)
    4. \(AI = IA = A\)

    The box above contained some very good news—and perhaps some surprising news. Matrix multiplication may seem like a strange operation, so it would not be shocking to learn that \(A(BC)\neq (AB)C\). Fortunately, the associative property does hold, and this makes our work with matrices much easier.  

    Before moving on, we raise one more issue of notation. We define \(A^{0}=I\). If \(n\) is a positive integer, we define  
    \[
    A^{n}=\underbrace{A\cdot A\cdot\cdots\cdot A}_{n\ \text{times}}. \nonumber
    \]

    When working with numbers, we are used to the fact that \(a^{-n} = \tfrac{1}{a^n}\). Do negative exponents make sense with matrices as well? The answer is yes, but with some care. We will study this more fully after defining the inverse of a matrix. For now, it is important to remember that \(A^{-1}\neq \tfrac{1}{A}\), since division of matrices does not make sense in the same way it does for numbers.  

    There are also a few things that do not work with matrix multiplication. The good news is that the list is short:  

    - Matrix multiplication is not commutative; in general, \(AB\neq BA\).  
    - Even if \(AX=BX\), we cannot conclude that \(A=B\).  

    These facts can lead to pitfalls. For example, we are familiar with  
    \[
    (a+b)^2 = a^2+2ab+b^2. \nonumber
    \]  
    But what about \((A+B)^{2}\)? Here,  
    \[
    (A+B)^{2}\neq A^{2}+2AB+B^{2}. \nonumber
    \]  

    With these properties in mind, we are now prepared to revisit systems of linear equations and view them through the lens of matrices.

     

    Systems of Linear Equations Matrix multiplication 

    Thinking of matrix multiplication gives us a new perspective on systems of linear equations. Instead of writing each equation separately, we can represent an entire system more compactly using vectors and matrices. This approach not only shortens notation but also reveals deeper connections between linear equations and the structure of matrix algebra. In this section, we will see how to express systems of equations in both vector form and matrix form.

     

    \textbf{Vector Form of a System of Linear Equations}  

    Definition:Vector Form of a System of Linear Equation 

    Suppose we have a system of equations  
    \[
    \begin{array}{c} 
    a_{11}x_{1}+\cdots +a_{1n}x_{n}=b_{1} \\ 
    \vdots \\ 
    a_{m1}x_{1}+\cdots +a_{mn}x_{n}=b_{m} 
    \end{array} \nonumber
    \]  

    This system can be written in vector form as  
    \[
    x_1 \begin{bmatrix} a_{11}\\ a_{21}\\ \vdots \\ a_{m1} \end{bmatrix} 
    + x_2 \begin{bmatrix} a_{12}\\ a_{22}\\ \vdots \\ a_{m2} \end{bmatrix} 
    + \cdots 
    + x_n \begin{bmatrix} a_{1n}\\ a_{2n}\\ \vdots \\ a_{mn} \end{bmatrix} 
    = \begin{bmatrix} b_1\\ b_2\\ \vdots \\ b_m \end{bmatrix}.
    \]  

    Notice that each column vector here comes directly from the corresponding coefficient matrix. There is one column vector for each variable, along with the constant vector on the right-hand side.  

    This observation leads us naturally to the first important case of matrix multiplication: multiplying a matrix by a column vector. For example, consider  
    \[
    \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}
    \begin{bmatrix} 7 \\ 8 \\ 9 \end{bmatrix}.
    \]  
    This equals  
    \[
    7\begin{bmatrix} 1 \\ 4 \end{bmatrix} 
    + 8\begin{bmatrix} 2 \\ 5 \end{bmatrix} 
    + 9\begin{bmatrix} 3 \\ 6 \end{bmatrix} 
    = \begin{bmatrix} 50 \\ 122 \end{bmatrix}.
    \]  

    Definition \(\PageIndex{4}\): The Matrix Form of a System of Linear Equations

    Suppose we have a system of equations given by \[\begin{array}{c} a_{11}x_{1}+\cdots +a_{1n}x_{n}=b_{1} \\ a_{21}x_{1}+ \cdots + a_{2n}x_{n} = b_{2} \\ \vdots \\ a_{m1}x_{1}+\cdots +a_{mn}x_{n}=b_{m} \end{array}\nonumber \] Then we can express this system in matrix form is \(AX=B\)  \[\left[ \begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{array} \right] \left[ \begin{array}{c} x_{1} \\ x_{2} \\ \vdots \\ x_{n} \end{array} \right] = \left[ \begin{array}{c} b_{1}\\ b_{2}\\ \vdots \\ b_{m} \end{array} \right]\nonumber \]

    The expression \(AX=B\) is also known as the Matrix Form of the corresponding system of linear equations. The matrix \(A\) is simply the coefficient matrix of the system, the vector \(X\) is the column vector constructed from the variables of the system, and finally the vector \(B\) is the column vector constructed from the constants of the system. It is important to note that any system of linear equations can be written in this form.

    Notice that if we write a homogeneous system of equations in matrix form, it would have the form \(AX=0\), for the zero vector \(0\).

    These forms will be very useful later when we introduce the inverse of a matrix, vector spaces, and linear transformations. They give us a compact way to represent systems and highlight the structure behind the equations. For now, let us look at an example to see how this works in practice.

    Example \(\PageIndex{1}\)

    Given \(A = \begin{bmatrix} 1 & 2 & 1 & 3 \\ 0 & 2 & 1 & -2 \\ 2 & 1 & 4 & 1 \end{bmatrix}\) as the coefficient matrix and \(X = \begin{bmatrix} 1 \\ 2 \\ 0 \\ 1 \end{bmatrix}\).

    Solution

    To write the system of linear equation, we need the column vector for the constant, \(b). Thus first we compute the right-hand side \(b = AX\):
    \[
    b
    = \begin{bmatrix} 1 & 2 & 1 & 3 \\ 0 & 2 & 1 & -2 \\ 2 & 1 & 4 & 1 \end{bmatrix}
      \begin{bmatrix} 1 \\ 2 \\ 0 \\ 1 \end{bmatrix}
    = \begin{bmatrix}
    1(1)+2(2)+1(0)+3(1) \\
    0(1)+2(2)+1(0)-2(1) \\
    2(1)+1(2)+4(0)+1(1)
    \end{bmatrix}
    = \begin{bmatrix} 8 \\ 2 \\ 5 \end{bmatrix}.
    \]

    The augmented matrix \([A \mid b]\) for the system \(AX=b\) is
    \[
    \left[\, A \mid b \,\right]
    = \left[ \begin{array}{cccc|c}
    1 & 2 & 1 & 3 & 8 \\
    0 & 2 & 1 & -2 & 2 \\
    2 & 1 & 4 & 1 & 5
    \end{array} \right].
    \]

     

    Exercise   

    In Exercises \(\PageIndex{1}\) - \(\PageIndex{12}\), row and column vectors \(\vec{u}\) and \(\vec{v}\) are defined. Find the product \(\vec{u}\vec{v}\), where possible.

    Exercise \(\PageIndex{1}\)

    \(u=\left[\begin{array}{cc}{1}&{-4}\end{array}\right]\quad v=\left[\begin{array}{c}{-2}\\{5}\end{array}\right]\)

    Answer

    \(-22\)

    Exercise \(\PageIndex{2}\)

    \(u=\left[\begin{array}{cc}{2}&{3}\end{array}\right]\quad v=\left[\begin{array}{c}{7}\\{-4}\end{array}\right]\)

    Answer

    \(2\)

    Exercise \(\PageIndex{3}\)

    \(\vec{u}=\left[\begin{array}{cc}{1}&{-1}\end{array}\right]\quad\vec{v}=\left[\begin{array}{c}{3}\\{3}\end{array}\right]\)

    Answer

    \(0\)

    Exercise \(\PageIndex{4}\)

    \(a=\left[\begin{array}{cc}{0.6}&{0.8}\end{array}\right]\quad b=\left[\begin{array}{c}{0.6}\\{0.8}\end{array}\right]\)

    Answer

    \(1\)

    Exercise \(\PageIndex{5}\)

    \(b =\left[\begin{array}{ccc}{1}&{2}&{-1}\end{array}\right]\quad d=\left[\begin{array}{c}{2}\\{1}\\{-1}\end{array}\right]\)

    Answer

    \(5\)

    Exercise \(\PageIndex{6}\)

    \(a =\left[\begin{array}{ccc}{3}&{2}&{-2}\end{array}\right]\quad b=\left[\begin{array}{c}{-1}\\{0}\\{9}\end{array}\right]\)

    Answer

    \(-21\)

    Exercise \(\PageIndex{7}\)

    \(a=\left[\begin{array}{ccc}{8}&{-4}&{3}\end{array}\right]\quad b=\left[\begin{array}{c}{2}\\{4}\\{5}\end{array}\right]\)

    Answer

    \(15\)

    Exercise \(\PageIndex{8}\)

    \(a=\left[\begin{array}{ccc}{-3}&{6}&{1}\end{array}\right]\quad b=\left[\begin{array}{c}{1}\\{-1}\\{1}\end{array}\right]\)

    Answer

    \(-8\)

    Exercise \(\PageIndex{9}\)

    \(a=\left[\begin{array}{cccc}{1}&{2}&{3}&{4}\end{array}\right]\quad b=\left[\begin{array}{c}{1}\\{-1}\\{1}\\{-1}\end{array}\right]\)

    Answer

    \(-2\)

    Exercise \(\PageIndex{10}\)

    \(b=\left[\begin{array}{cccc}{6}&{2}&{-1}&{2}\end{array}\right]\quad c=\left[\begin{array}{c}{3}\\{2}\\{9}\\{5}\end{array}\right]\)

    Answer

    \(23\)

    Exercise \(\PageIndex{11}\)

    \(a=\left[\begin{array}{ccc}{1}&{2}&{3}\end{array}\right]\quad b=\left[\begin{array}{c}{3}\\{2}\end{array}\right]\)

    Answer

    Not possible.

    Exercise \(\PageIndex{12}\)

    \(\vec{u}=\left[\begin{array}{cc}{2}&{-5}\end{array}\right]\quad\vec{v}=\left[\begin{array}{c}{1}\\{1}\\{1}\end{array}\right]\)

    Answer

    Not possible.

    In Exercises \(\PageIndex{13}\) - \(\PageIndex{27}\), matrices \(A\) and \(B\) are defined.

    1. Give the dimensions of \(A\) and \(B\). If the dimensions properly match, give the dimensions of \(AB\) and \(BA\).
    2. Find the products \(AB\) and \(BA\), if possible.
    Exercise \(\PageIndex{13}\)

    \(A=\left[\begin{array}{cc}{1}&{2}\\{-1}&{4}\end{array}\right]\) \(B=\left[\begin{array}{cc}{2}&{5}\\{3}&{-1}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{cc}{8}&{3}\\{10}&{-9}\end{array}\right]\)

    \(BA=\left[\begin{array}{cc}{-3}&{24}\\{4}&{2}\end{array}\right]\)

    Exercise \(\PageIndex{14}\)

    \(A=\left[\begin{array}{cc}{3}&{7}\\{2}&{5}\end{array}\right]\) \(B=\left[\begin{array}{cc}{1}&{-1}\\{3}&{-3}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{cc}{24}&{-24}\\{17}&{-17}\end{array}\right]\)

    \(BA=\left[\begin{array}{cc}{1}&{2}\\{3}&{6}\end{array}\right]\)

    Exercise \(\PageIndex{15}\)

    \(A=\left[\begin{array}{cc}{3}&{-1}\\{2}&{2}\end{array}\right]\) \(B=\left[\begin{array}{ccc}{1}&{0}&{7}\\{4}&{2}&{9}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{ccc}{-1}&{-2}&{12}\\{10}&{4}&{32}\end{array}\right]\)

    \(BA\) is not possible.

    Exercise \(\PageIndex{16}\)

    \(A=\left[\begin{array}{cc}{0}&{1}\\{1}&{-1}\\{-2}&{-4}\end{array}\right]\) \(B=\left[\begin{array}{cc}{-2}&{0}\\{3}&{8}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{cc}{3}&{8}\\{-5}&{-8}\\{-8}&{-32}\end{array}\right]\)

    \(BA\) is not possible.

    Exercise \(\PageIndex{17}\)

    \(A=\left[\begin{array}{ccc}{9}&{4}&{3}\\{9}&{-5}&{9}\end{array}\right]\) \(B=\left[\begin{array}{cc}{-2}&{5}\\{-2}&{-1}\end{array}\right]\)

    Answer

    \(AB\) is not possible.

    \(BA=\left[\begin{array}{ccc}{27}&{-33}&{39}\\{-27}&{-3}&{-15}\end{array}\right]\)

    Exercise \(\PageIndex{18}\)

    \(A=\left[\begin{array}{cc}{-2}&{-1}\\{9}&{-5}\\{3}&{-1}\end{array}\right]\) \(B=\left[\begin{array}{ccc}{-5}&{6}&{-4}\\{0}&{6}&{-3}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{ccc}{10}&{-18}&{11}\\{-45}&{24}&{-21}\\{-15}&{12}&{-9}\end{array}\right]\)

    \(BA=\left[\begin{array}{cc}{52}&{-21}\\{45}&{-27}\end{array}\right]\)

    Exercise \(\PageIndex{19}\)

    \(A=\left[\begin{array}{cc}{2}&{6}\\{6}&{2}\\{5}&{-1}\end{array}\right]\) \(B=\left[\begin{array}{ccc}{-4}&{5}&{0}\\{-4}&{4}&{-4}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{ccc}{-32}&{34}&{-24}\\{-32}&{38}&{-8}\\{-16}&{21}&{4}\end{array}\right]\)

    \(BA=\left[\begin{array}{cc}{22}&{-14}\\{-4}&{-12}\end{array}\right]\)

    Exercise \(\PageIndex{20}\)

    \(A=\left[\begin{array}{cc}{-5}&{2}\\{-5}&{-2}\\{-5}&{-4}\end{array}\right]\) \(B=\left[\begin{array}{ccc}{0}&{-5}&{6}\\{-5}&{-3}&{-1}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{ccc}{-10}&{19}&{-32}\\{10}&{31}&{-28}\\{20}&{37}&{-26}\end{array}\right]\)

    \(BA=\left[\begin{array}{cc}{-5}&{-14}\\{45}&{0}\end{array}\right]\)

    Exercise \(\PageIndex{21}\)

    \(A=\left[\begin{array}{cc}{8}&{-2}\\{4}&{5}\\{2}&{-5}\end{array}\right]\) \(B=\left[\begin{array}{ccc}{-5}&{1}&{-5}\\{8}&{3}&{-2}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{ccc}{-56}&{2}&{-36}\\{20}&{19}&{-30}\\{-50}&{-13}&{0}\end{array}\right]\)

    \(BA=\left[\begin{array}{cc}{-46}&{40}\\{72}&{9}\end{array}\right]\)

    Exercise \(\PageIndex{22}\)

    \(A=\left[\begin{array}{cc}{1}&{4}\\{7}&{6}\end{array}\right]\) \(B=\left[\begin{array}{cccc}{1}&{-1}&{-5}&{5}\\{-2}&{1}&{3}&{-5}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{cccc}{-7}&{3}&{7}&{-15}\\{-5}&{-1}&{-17}&{5}\end{array}\right]\)

    \(BA\) is not possible.

    Exercise \(\PageIndex{23}\)

    \(A=\left[\begin{array}{cc}{-1}&{5}\\{6}&{7}\end{array}\right]\) \(B=\left[\begin{array}{cccc}{5}&{-3}&{-4}&{-4}\\{-2}&{-5}&{-5}&{-1}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{cccc}{-15}&{-22}&{-21}&{-1}\\{16}&{-53}&{-59}&{-31}\end{array}\right]\)

    \(BA\) is not possible.

    Exercise \(\PageIndex{24}\)

    \(A=\left[\begin{array}{ccc}{-1}&{2}&{1}\\{-1}&{2}&{-1}\\{0}&{0}&{-2}\end{array}\right]\) \(B=\left[\begin{array}{ccc}{0}&{0}&{-2}\\{1}&{2}&{-1}\\{1}&{0}&{0}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{ccc}{3}&{4}&{0}\\{1}&{4}&{0}\\{-2}&{0}&{0}\end{array}\right]\)

    \(BA=\left[\begin{array}{ccc}{0}&{0}&{4}\\{-3}&{6}&{1}\\{-1}&{2}&{1}\end{array}\right]\)

    Exercise \(\PageIndex{25}\)

    \(A=\left[\begin{array}{ccc}{-1}&{1}&{1}\\{-1}&{-1}&{-2}\\{1}&{1}&{-2}\end{array}\right]\) \(B=\left[\begin{array}{ccc}{-2}&{-2}&{-2}\\{0}&{-2}&{0}\\{-2}&{0}&{2}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{ccc}{0}&{0}&{4}\\{6}&{4}&{-2}\\{2}&{-4}&{-6}\end{array}\right]\)

    \(BA=\left[\begin{array}{ccc}{2}&{-2}&{6}\\{2}&{2}&{4}\\{4}&{0}&{-6}\end{array}\right]\)

    Exercise \(\PageIndex{26}\)

    \(A=\left[\begin{array}{ccc}{-4}&{3}&{3}\\{-5}&{-1}&{-5}\\{-5}&{0}&{-1}\end{array}\right]\) \(B=\left[\begin{array}{ccc}{0}&{5}&{0}\\{-5}&{-4}&{3}\\{5}&{-4}&{3}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{ccc}{0}&{-44}&{18}\\{-20}&{-1}&{-18}\\{-5}&{-21}&{-3}\end{array}\right]\)

    \(BA=\left[\begin{array}{ccc}{-25}&{-5}&{-25}\\{25}&{-11}&{2}\\{-15}&{19}&{32}\end{array}\right]\)

    Exercise \(\PageIndex{27}\)

    \(A=\left[\begin{array}{ccc}{-4}&{-1}&{3}\\{2}&{-3}&{5}\\{1}&{5}&{3}\end{array}\right]\) \(B=\left[\begin{array}{ccc}{-2}&{4}&{3}\\{-1}&{1}&{-1}\\{4}&{0}&{2}\end{array}\right]\)

    Answer

    \(AB=\left[\begin{array}{ccc}{21}&{-17}&{-5}\\{19}&{5}&{19}\\{5}&{9}&{4}\end{array}\right]\)

    \(BA=\left[\begin{array}{ccc}{19}&{5}&{23}\\{5}&{-7}&{-1}\\{-14}&{6}&{18}\end{array}\right]\)

    In Exercises \(\PageIndex{28}\) - \(\PageIndex{33}\), a diagonal matrix \(D\) and a matrix \(A\) are given. Find the products \(DA\) and \(AD\), where possible.

    Exercise \(\PageIndex{28}\)

    \(D=\left[\begin{array}{cc}{3}&{0}\\{0}&{-1}\end{array}\right]\) \(A=\left[\begin{array}{cc}{2}&{4}\\{6}&{8}\end{array}\right]\)

    Answer

    \(DA=\left[\begin{array}{cc}{6}&{-4}\\{18}&{-8}\end{array}\right]\)

    \(AD=\left[\begin{array}{cc}{6}&{12}\\{-6}&{-8}\end{array}\right]\)

    Exercise \(\PageIndex{29}\)

    \(D=\left[\begin{array}{cc}{4}&{0}\\{0}&{-3}\end{array}\right]\) \(A=\left[\begin{array}{cc}{1}&{2}\\{1}&{2}\end{array}\right]\)

    Answer

    \(DA=\left[\begin{array}{cc}{4}&{-6}\\{4}&{-6}\end{array}\right]\)

    \(AD=\left[\begin{array}{cc}{4}&{8}\\{-3}&{-6}\end{array}\right]\)

    Exercise \(\PageIndex{30}\)

    \(D=\left[\begin{array}{ccc}{-1}&{0}&{0}\\{0}&{2}&{0}\\{0}&{0}&{3}\end{array}\right]\) \(A=\left[\begin{array}{ccc}{1}&{2}&{3}\\{4}&{5}&{6}\\{7}&{8}&{9}\end{array}\right]\)

    Answer

    \(DA=\left[\begin{array}{ccc}{-1}&{4}&{9}\\{-4}&{10}&{18}\\{-7}&{16}&{27}\end{array}\right]\)

    \(AD=\left[\begin{array}{ccc}{-1}&{-2}&{-3}\\{8}&{10}&{12}\\{21}&{24}&{27}\end{array}\right]\)

    Exercise \(\PageIndex{31}\)

    \(D=\left[\begin{array}{ccc}{1}&{1}&{1}\\{2}&{2}&{2}\\{-3}&{-3}&{-3}\end{array}\right]\) \(A=\left[\begin{array}{ccc}{2}&{0}&{0}\\{0}&{-3}&{0}\\{0}&{0}&{5}\end{array}\right]\)

    Answer

    \(DA=\left[\begin{array}{ccc}{2}&{2}&{2}\\{-6}&{-6}&{-6}\\{-15}&{-15}&{-15}\end{array}\right]\)

    \(AD=\left[\begin{array}{ccc}{2}&{-3}&{5}\\{4}&{-6}&{10}\\{-6}&{9}&{-15}\end{array}\right]\)

    Exercise \(\PageIndex{32}\)

    \(D=\left[\begin{array}{cc}{d_{1}}&{0}\\{0}&{d_{2}}\end{array}\right]\) \(A=\left[\begin{array}{cc}{a}&{b}\\{c}&{d}\end{array}\right]\)

    Answer

    \(DA=\left[\begin{array}{cc}{d_{1}a}&{d_{1}b}\\{d_{2}c}&{d_{2}d}\end{array}\right]\)

    \(AD=\left[\begin{array}{cc}{d_{1}a}&{d_{2}b}\\{d_{1}c}&{d_{2}d}\end{array}\right]\)

    Exercise \(\PageIndex{33}\)

    \(D=\left[\begin{array}{ccc}{d_{1}}&{0}&{0}\\{0}&{d_{2}}&{0}\\{0}&{0}&{d_{3}}\end{array}\right]\) \(A=\left[\begin{array}{ccc}{a}&{b}&{c}\\{d}&{e}&{f}\\{g}&{h}&{i}\end{array}\right]\)

    Answer

    \(DA=\left[\begin{array}{ccc}{d_{1}a}&{d_{1}b}&{d_{1}c}\\{d_{2}d}&{d_{2}e}&{d_{2}f}\\{d_{3}g}&{d_{3}h}&{d_{3}i}\end{array}\right]\)

    \(AD=\left[\begin{array}{ccc}{d_{1}a}&{d_{2}b}&{d_{3}c}\\{d_{1}d}&{d_{2}e}&{d_{3}f}\\{d_{1}g}&{d_{2}h}&{d_{3}i}\end{array}\right]\)

    In Exercises \(\PageIndex{34}\) - \(\PageIndex{39}\), a matrix \(A\) and a vector \(\vec{x}\) are given. Find the product \(A\vec{x}\).

    Exercise \(\PageIndex{34}\)

    \(A=\left[\begin{array}{cc}{2}&{3}\\{1}&{-1}\end{array}\right]\), \(\vec{x}=\left[\begin{array}{c}{4}\\{9}\end{array}\right]\)

    Answer

    \(A\vec{x}=\left[\begin{array}{c}{35}\\{-5}\end{array}\right]\)

    Exercise \(\PageIndex{35}\)

    \(A=\left[\begin{array}{cc}{-1}&{4}\\{7}&{3}\end{array}\right]\), \(\vec{x}=\left[\begin{array}{c}{2}\\{-1}\end{array}\right]\)

    Answer

    \(A\vec{x}=\left[\begin{array}{c}{-6}\\{11}\end{array}\right]\)

    Exercise \(\PageIndex{36}\)

    \(A=\left[\begin{array}{ccc}{2}&{0}&{3}\\{1}&{1}&{1}\\{3}&{-1}&{2}\end{array}\right]\), \(\vec{x}=\left[\begin{array}{c}{1}\\{4}\\{2}\end{array}\right]\)

    Answer

    \(A\vec{x}=\left[\begin{array}{c}{8}\\{7}\\{3}\end{array}\right]\)

    Exercise \(\PageIndex{37}\)

    \(A=\left[\begin{array}{ccc}{-2}&{0}&{3}\\{1}&{1}&{-2}\\{4}&{2}&{-1}\end{array}\right]\), \(\vec{x}=\left[\begin{array}{c}{4}\\{3}\\{1}\end{array}\right]\)

    Answer

    \(A\vec{x}=\left[\begin{array}{c}{-5}\\{5}\\{21}\end{array}\right]\)

    Exercise \(\PageIndex{38}\)

    \(A=\left[\begin{array}{cc}{2}&{-1}\\{4}&{3}\end{array}\right]\), \(\vec{x}=\left[\begin{array}{c}{x_{1}}\\{x_{2}}\end{array}\right]\)

    Answer

    \(A\vec{x}=\left[\begin{array}{c}{2x_{1}-x_{2}}\\{4x_{1}+3x_{2}}\end{array}\right]\)

    Exercise \(\PageIndex{39}\)

    \(A=\left[\begin{array}{ccc}{1}&{2}&{3}\\{1}&{0}&{2}\\{2}&{3}&{1}\end{array}\right]\), \(\vec{x}=\left[\begin{array}{c}{x_{1}}\\{x_{2}}\\{x_{3}}\end{array}\right]\)

    Answer

    \(A\vec{x}\left[\begin{array}{c}{x_{1}+2x_{2}+3x_{3}}\\{x_{1}+2x_{3}}\\{2x_{1}+3x_{2}+x_{3}}\end{array}\right]\)

    Exercise \(\PageIndex{40}\)

    Let \(A=\left[\begin{array}{cc}{0}&{1}\\{1}&{0}\end{array}\right]\). Find \(A^{2}\) and \(A^{3}\).

    Answer

    \(A^{2}=\left[\begin{array}{cc}{1}&{0}\\{0}&{1}\end{array}\right]\); \(A^{3}=\left[\begin{array}{cc}{0}&{1}\\{1}&{0}\end{array}\right]\)

    Exercise \(\PageIndex{41}\)

    Let \(A=\left[\begin{array}{cc}{2}&{0}\\{0}&{3}\end{array}\right]\). Find \(A^{2}\) and \(A^{3}\).

    Answer

    \(A^{2}=\left[\begin{array}{cc}{4}&{0}\\{0}&{9}\end{array}\right]\); \(A^{3}=\left[\begin{array}{cc}{8}&{0}\\{0}&{27}\end{array}\right]\)

    Exercise \(\PageIndex{42}\)

    Let \(A=\left[\begin{array}{ccc}{-1}&{0}&{0}\\{0}&{3}&{0}\\{0}&{0}&{5}\end{array}\right]\). Find \(A^{2}\) and \(A^{3}\).

    Answer

    \(A^{2}=\left[\begin{array}{ccc}{1}&{0}&{0}\\{0}&{9}&{0}\\{0}&{0}&{25}\end{array}\right]\); \(A^{3}=\left[\begin{array}{ccc}{-1}&{0}&{0}\\{0}&{27}&{0}\\{0}&{0}&{125}\end{array}\right]\)

    Exercise \(\PageIndex{43}\)

    Let \(A=\left[\begin{array}{ccc}{0}&{1}&{0}\\{0}&{0}&{1}\\{1}&{0}&{0}\end{array}\right]\). Find \(A^{2}\) and \(A^{3}\).

    Answer

    \(A^{2}=\left[\begin{array}{ccc}{0}&{0}&{1}\\{1}&{0}&{0}\\{0}&{1}&{0}\end{array}\right]\); \(A^{3}=\left[\begin{array}{ccc}{1}&{0}&{0}\\{0}&{1}&{0}\\{0}&{0}&{1}\end{array}\right]\)

    Exercise \(\PageIndex{44}\)

    Let \(A=\left[\begin{array}{ccc}{0}&{0}&{1}\\{0}&{0}&{0}\\{0}&{1}&{0}\end{array}\right]\). Find \(A^{2}\) and \(A^{3}\).

    Answer

    \(A^{2}=\left[\begin{array}{ccc}{0}&{1}&{0}\\{0}&{0}&{0}\\{0}&{0}&{0}\end{array}\right]\); \(A^{3}=\left[\begin{array}{ccc}{0}&{0}&{0}\\{0}&{0}&{0}\\{0}&{0}&{0}\end{array}\right]\)

    Exercise \(\PageIndex{45}\)

    In the text, we state that \((A+B)^{2}\neq A^{2}+2AB+B^{2}\). We investigate that claim here.

    1. Let \(A=\left[\begin{array}{cc}{5}&{3}\\{-3}&{-2}\end{array}\right]\) and let \(B=\left[\begin{array}{cc}{-5}&{-5}\\{-2}&{1}\end{array}\right]\). Compute \(A+B\).
    2. Find \((A+B)^{2}\) by using your answer from (a).
    3. Compute \(A^{2}+2AB+B^{2}\).
    4. Are the results from (a) and (b) the same?
    5. Carefully expand the expression \((A+B)^{2}=(A+B)(A+B)\) and show why this is not equal to \(A^{2}+2AB+B^{2}\).
    Answer
    1. \(\left[\begin{array}{cc}{0}&{-2}\\{-5}&{-1}\end{array}\right]\)
    2. \(\left[\begin{array}{cc}{10}&{2}\\{5}&{11}\end{array}\right]\)
    3. \(\left[\begin{array}{cc}{-11}&{-15}\\{37}&{32}\end{array}\right]\)
    4. No
    5. \((A+B)(A+B)=AA+AB+BA+BB=A^{2}+AB+BA+B^{2}\)

     


    2.2: Matrix Multiplication is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?