Lecture 9 - Matrix Equations

Learning Objectives

Multiplying a Matrix By a Vector

We have frequently discussed the "augmented matrix" for a system of linear equations:

Sometimes, we will want to leave off the last column of the augmented matrix and just focus on the variable coefficients.

Definition. The coefficient matrix for a system of linear equations contains just the variable coefficients. It is identical to the augmented matrix, but without the final column of "right-hand side" values.

Example 1. Consider the linear system: \[ \begin{eqnarray*} 3x_1 -x_2 +x_3 & = & 6\\ x_1 - 5x_3 & = & -7\\ x_2 + 2x_3 & = & 0 \end{eqnarray*} \] Find the augmented and coefficient matrices for this system.

The augmented matrix is: \[ \begin{bmatrix} 3 & -1 & 1 & 6 \\ 1 & 0 & -5 & -7 \\ 0 & 1 & 2 & 0 \end{bmatrix}. \]

The coefficient matrix is: \[ \begin{bmatrix} 3 & -1 & 1 \\ 1 & 0 & -5 \\ 0 & 1 & 2 \end{bmatrix}. \Box \]

In this lecture, we also define the product of a matrix and a vector:

Definition. Given an \( m\times n\) matrix \( A \), with columns \( \bbm a_1, \bbm a_2, \ldots, \bbm a_n \in \mathbb R^m \), and given \( \bbm x\in \mathbb R^n \), the product of \( A \) and \( \bbm x \), written \( A\bbm x\), is \[ A \bbm x = \begin{bmatrix} \bbm a_1 & \bbm a_2 & \cdots & \bbm a_n \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} = x_1 \bbm a_1 + x_2 \bbm a_2 + \cdots + x_n \bbm a_n. \]

We can think of \( A \bbm x \) as a shorthand for a linear combination of the columns of \( A \), where the entries of \( \bbm x \) are the scalars in the linear combination. Also, notice that when \( A \) is the coefficient matrix for a linear system and \( \bbm x \) is a vector of variables, \( A \bbm x \) is a vector whose entries are the right-hand sides of the equations in the system.

Example 2A. Multiply \( \begin{bmatrix} 1 & 2 & -1 \\ 0 & -5 & 3 \end{bmatrix} \vecthree 4 3 7 \).

Using the defintion, we rewrite this as a linear combination of the columns of the matrix: \[ \begin{bmatrix} 1 & 2 & -1 \\ 0 & -5 & 3 \end{bmatrix} \vecthree 4 3 7 = 4 \vectwo 1 0 + 3 \vectwo 2 {-5} + 7 \vectwo {-1} 3 = \vectwo 3 6. \Box \]

Example 2B. Multiply \( \begin{bmatrix} 3 & -1 \\ 0 & 2 \\ -4 & 6 \end{bmatrix} \vectwo {x_1} {x_2} \).

Using the definition, we have: \[ \begin{bmatrix} 3 & -1 \\ 0 & 2 \\ -4 & 6 \end{bmatrix} \vectwo {x_1} {x_2} = x_1 \vecthree 3 0 {-4} + x_2 \vecthree {-1} 2 6 = \vecthree {3x_1 - x_2} {2x_2} {-4x_1 + 6x_2}. \Box \]

Example 2C. Multiply \( \begin{bmatrix} -1 & 6 & 2 \\ 0 & -2 & 3 \end{bmatrix} \vectwo 2 {-4} \).

Since the matrix has three columns but the vector only has two entries, this product is undefined. \( \Box \)

These examples illustrate that the product \( A \bbm x \) is only defined when the number of columns of \( A \) matches the number of entries of \( \bbm x \). When \( A \bbm x\) is defined, it has a number of entries equal to the number of rows of \( A \).

Matrix Equations

This new definition gives us a total of three equivalent ways of writing a system of linear equations:

Linear Equations Vector Equation Matrix Equation
\[ \begin{eqnarray*} x_1 + 2x_2 - x_3 & = & 4 \\ -5x_2 + 3x_3 & = & 1 \end{eqnarray*} \] \[ x_1 \vectwo 1 0 + x_2 \vectwo 2 {-5} + x_3 \vectwo {-1} 3 + \vectwo 4 1 \] \[ \begin{bmatrix} 1 & 2 & -1 \\ 0 & 5 & -3 \end{bmatrix} \vecthree {x_1} {x_2} {x_3} = \vectwo 4 1 \]

Example 3. Let \( A = \begin{bmatrix} 2 & 1 \\ -4 & 3 \\ 0 & -3 \end{bmatrix} \) and \( \bbm b = \vecthree 2 {-9} 3 \). Solve the matrix equation \( A \bbm x = \bbm b \).

The matrix \( A \) is the coefficient matrix, so the augmented matrix is: \[ \begin{bmatrix} 2 & 1 & 2 \\ -4 & 3 & -9 \\ 0 & -3 & 3 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & 0 & 3/2 \\ 0 & 1 & -1 \\ 0 & 0 & 0 \end{bmatrix} \]

The solution is \( x_1 = 3/2 \) and \( x_2 = -1\), or \( \bbm x = \vectwo {3/2} {-1} \). \( \Box \)

In general, given an \( m\times n\) matrix \( A\) with columns \( \bbm a_1, \bbm a_2, \ldots, \bbm a_n \) and a vector \( \bbm b \in \mathbb R^m \), we can solve the matrix equation \( A\bbm x = \bbm b\) using the augmented matrix \[ \begin{bmatrix} \bbm a_1 & \bbm a_2 & \cdots & \bbm a_n & \bbm b \end{bmatrix}, \] which we can also write as just \( [ A \ \ \bbm b ] \).

The matrix equation \( A \bbm x = \bbm b \) has a solution if and only if \( \bbm b \) is a linear combination of the columns of \( A \). In Lecture 8, we considered the question of whether every vector \( \bbm b \) is in \( \mbox{Span} \{ \bbm a_1, \bbm a_2, \ldots, \bbm a_n \} \). This is the same as asking whether the equation \( A \bbm x = \bbm b \) is consistent for every possible vector \( \bbm b\).

Example 4. Let \( A = \begin{bmatrix} 1 & 3 & -1 \\ -4 & -9 & 0 \\ 0 & -6 & 8 \end{bmatrix} \) and \( \bbm b = \vecthree {b_1} {b_2} {b_3} \). Is the equation \( A\bbm x = \bbm b\) consistent for all \( \bbm b\)?

Even though we don't know the values of the entries of \( \bbm b\), we proceed in the normal way, setting up an augmented matrix: \[ \begin{bmatrix} 1 & 3 & -1 & b_1 \\ -4 & -9 & 0 & b_2 \\ 0 & -6 & 8 & b_3 \end{bmatrix} \]

We can start by replacing Row 2 by the sum of itself and 4 times Row 1: \[ \begin{bmatrix} 1 & 3 & -1 & b_1 \\ 0 & 3 & -4 & 4b_1 + b_2 \\ 0 & -6 & 8 & b_3 \end{bmatrix} \]

Next, we can replace Row 3 by the sum of itself and 2 times Row 2: \[ \begin{bmatrix} 1 & 3 & -1 & b_1 \\ 0 & 3 & -4 & 4b_1 + b_2 \\ 0 & 0 & 0 & 8b_1 + 2b_2 + b_3 \end{bmatrix} \]

At this point, we can stop as the matrix is in echelon form. Does this matrix have a pivot in the last column? We don't know the values of \( b_1, b_2\), and \( b_3\), so there could be a pivot in the final column. For example, if \( b_1 = 1\), \( b_2 = 2\), and \(b_3 = 3\), then \( A\bbm x = \bbm b\) is not consistent. This means that, no, the equation \( A\bbm x = \bbm b\) is not consistent for all \( \bbm b\). \( \Box \)

One way to think about what happened in the previous example is that not every row of the coefficient matrix \( A \) had a pivot. This allowed room for there to be a possible pivot in the last column of the augmented matrix. If instead every row of \( A \) had a pivot, then it would not have been possible for there to be a pivot in the last column of the augmented matrix. We can put these ideas together into the "Spanning Columns Theorem."

Spanning Columns Theorem. Let \( A \) be an \( m\times n\) matrix. The following statements are equivalent:

  1. The columns of \( A \) span \( \mathbb R^m \)
  2. The equation \( A \bbm x = \bbm b \) is consistent for all \( \bbm b \in \mathbb R^m \)
  3. Every vector \( \bbm b \in \mathbb R^m \) can be written as a linear combination of the columns of \( A \)
  4. The matrix \( A \) has a pivot in every row

Saying "the following statements are equivalent" means that, for any given matrix \( A \), these four statements will either be all true or all false. If any one of these statements is true for a matrix \( A \), then they must all be true. If any one of these statements is false for a matrix \( A \), then they must all be false.

Why is the Spanning Columns Theorem true? We discussed in Lecture 8 how statements 1, 2, and 3 are different ways to rephrase the same statement. Our discussion of Example 4 illustrates why statement 4 is equivalent to the other three.

The Spanning Columns Theorem is useful because it allows us to now figure out whether a set of vectors spans \( \mathbb R^m \) more efficiently. We no longer have to work with "\( b \) values" like we did in Example 4.

Example 5. Let \( A = \begin{bmatrix} -1 & 2 & 1 & 0 \\ 0 & 0 & -3 & 4 \\ 3 & -6 & 2 & -1 \end{bmatrix} \). Do the columns of \( A\) span \( \mathbb R^3 \)?

We row-reduce \( A \): \[ \begin{bmatrix} -1 & 2 & 1 & 0 \\ 0 & 0 & -3 & 4 \\ 3 & -6 & 2 & -1 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & -2 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]

Since \( A \) has a pivot in every row, the Spanning Columns Theorem tells us that, yes, the columns of \( A \) do span \( \mathbb R^3 \). \( \Box \)

Pay attention to the fact that the matrix we row-reduced in Example 5 is not an augmented matrix. There is no one system of equations that we are solving. It doesn't matter that we had a pivot in the last column. We are using the Spanning Columns Theorem to answer a different question than the ones we have considered previously.

As we get further into this course, always pay attention to why you are row-reducing a matrix and what you are looking for. Always write down what the matrix represents. Is it an augmented matrix that represents a system or equations, or does the matrix represent something else?

The Row-Vector Rule

We have seen that the product \( A \bbm x \) represents a linear combination of the columns of \( A \), where the entries of \( \bbm x \) represent the coefficients in that linear combination.

There is a shortcut for computing \( A \bbm x \) that can save time when performing this calculation by hand. The "Row-Vector Rule" states:

Example 6. Use the Row-Vector Rule to compute the product \( \begin{bmatrix} 4 & 0 & 7 & 1 \\ 2 & 5 & -2 & 0 \\ 0 & 3 & -4 & 1 \end{bmatrix} \vecfour 2 {-1} 0 5 \).

We compute:

This tells us that \( \begin{bmatrix} 4 & 0 & 7 & 1 \\ 2 & 5 & -2 & 0 \\ 0 & 3 & -4 & 1 \end{bmatrix} \vecfour 2 {-1} 0 5 = \vecthree {13} {-1} 2. \Box \)

Properties of Matrix-Vector Multiplication

The new matrix-vector multiplication operation that we learned in this lecture has some nice algebraic properties:

(i) \( A (\bbm u + \bbm v) = A\bbm u + A\bbm v \) Distributivity
(ii) \( A (c\ \bbm u) = c (A\bbm u) \) Compatibility

As with the algebraic properties we discussed in Lecture 6, these properties ensure that we can use our algebraic intuition when working with algebraic expressions involving matrix-vector multiplication.

« Lecture 8 Back to Top Lecture 10 »