Matrix Equation Ax = b
Contents
12. Matrix Equation \(Ax = b\)#
12.1. Product of a Vector with a Matrix#
In this section we introduce the idea of multiplying a vector by a matrix.
Let \(A\) be an \(m \times n\) matrix with columns \(v_1, v_2, \ldots, v_n\):
Then the product of \(A\) with a vector \(x \in \mathbb{R}^n\) is the linear combination
\(Ax\) is a vector in \(\mathbb{R}^m\).
In order for \(Ax\) to make sense, the number of entries of \(x\) has to be the same as the number of columns of \(A\). We are using the entries of \(x\) as the coefficients of the columns of \(A\) in a linear combination. The resulting vector has the same number of entries as the number of rows of \(A\), since each column of \(A\) has that number of entries.
Note that this definition of muliplication of a vector by a matrix accords exactly with the definition you already studied for multiplying a matrix by a matrix.
Example
Let
and
then
Given a vectors \(v_1, v_2, \ldots, v_n\) and \(b\) in \(\mathbb{R}^m\) then we can form the vector equation
This is equivalent to the matrix equation \(Ax = b\) where
Four Ways to Write a Linear System
We now have four equivalent ways to express a linear system:
1. As a system of equations:
2. As an augmented matrix:
3. As a vector equation:
4. As a matrix equation:
Example
Let \(A = \begin{pmatrix}1&0\\0&1\\0&0\end{pmatrix}\). Does the equation \(Ax = \begin{pmatrix}1\\1\\1\end{pmatrix}\) have a solution?
Solution
First we answer the question geometrically. The columns of \(A\) are
and the target vector (the right-hand side of the equation) is \(b = \begin{pmatrix}1\\1\\1\end{pmatrix}\). The equation \(Ax = b\) is consistent if and only if \(b\) is contained in the span of the columns of \(A\). So we draw a picture:
\(\mathrm{Span}\{v_1, v_2\}\) is a horizontal plane through the origin. \(b\) does not lie in this plane therefore the equation is inconsistent.
We can check our geometric answer by solving the matrix equation. The augmented matrix of the system
is already in echelon form. The last equation is \(0 = 1\), so the system is indeed inconsistent and the matrix equation \(\begin{pmatrix}1\\1\\1\end{pmatrix}\) has no solution.
Example
Let
Does \(b\) lie in the subset spanned by \(v_1\) and \(v_2\)?
Solution
\(b\) is in \(\mathrm{Span}\{v_1,v_2\}\) if an only if there exist \(x_1, x_2\) such that
We can write this as a matrix system and solve by row reduction of the augmented matrix:
The system is consistent with solution \(x_1=1\) and \(x_2 = -1\) and we conclude that \(b\) lies in the subset spanned by \(v_1\) and \(v_2\).
Geometrically, \(\mathrm{Span}\{v_1, v_2\}\) is a 2-dimensional plane and \(b\) is a vector lying in the same plane. The figure below demonstrates what that might look like schematically.
Let \(A\) be an \(m \times n\) matrix. The following are equivalent:
\(Ax = b\) has a solution for all \(b\in\mathbb{R}^m\).
The span of the columns of \(A\) is all of \(\mathbb{R}^m\).
\(A\) has \(m\) pivots.
12.2. Solving \(Ax = 0\)#
The equation \(Ax=0\) has special significance and is easier to solve than the general equation \(Ax = b\).
Attention
The \(0\) on the right hand side of the equation \(Ax=0\) is shorthand for a vector containing \(m\) zeros.
An equation of the form \(Ax = 0\) is homogeneous.
An equation of the form \(Ax = b\) with \(b \neq 0\) is inhomogeneous.
For example, given the homogeneous equation \(Ax=0\), where
we can use row operations to reduce the augmented matrix
to reduced row echelon form:
which has only the trivial solution \(x=0\).
Note that the augmented part of the matrix is redundant since the zeros are not affected by the row operations. It is not necessary to write an augmented matrix when solving homogeneous systems.
Example
Solve the homogeneous equation \(Ax=0\) where
Solution
The matrix \(A\) is already in echelon form. The equivalent system of equations is
which can be written in parametric form:
Or as a vector equation:
for any \(x_3, x_4 \in \mathbb{R}\).
The two vectors \(\begin{pmatrix}8 \\-4\\ 1 \\ 0\end{pmatrix}\) and \(\begin{pmatrix}7 \\ -3 \\ 0\\1\end{pmatrix}\) are the special solutions corresponding to the free variables \(x_3\) and \(x_4\) respectively. The solution is the set of all linear combinations of the special solutions.
The solution set is a plane passing through the origin.
12.3. Solving \(Ax = b\)#
We now have everything we need to find the general solution to the inhomogeneous equation
The general solution to \(Ax = b\)
Let \(A\) be an \((m \times n)\) matrix and \(b\) a length-\(m\) vector. Then the general solution to
is
where \(t_1, \ldots\ t_k \in \mathbb{R}\) are real numbers and \(v_1, \ldots, v_k\) are the \(k\) special solutions corresponding to the \(k\) free variables.
Form the augmented matrix \(A|b\).
Use Gaussian elimination to find the reduced row echelon form and determine the \(k\) free variables.
Write the parametric form of the solution set (write the corresponding system of linear equations, moving all free variables to the right hand side.)
Write the solution as a vector equation \(v = t_1v_1 + \ldots + t_kv_k + v_0\).
Example
Determine the general solution to the following system of equations, expressing the answer in vector form:
Solution
The augmented matrix is:
We have already determined the reduced row echelon form in this example:
Write as a system of equations with the free variables \(x_2\) and \(x_4\) on the right hand side:
Write this in vector form:
for any \(x_2, x_4 \in \mathbb{R}\).
For the matrix
What are the special solution(s) to the homogeneous equation \(Ax=0\)?
What is the null space of \(A\)?
Find the general solution to \(Ax = b\) where \(b = \begin{pmatrix}5 \\ 0\end{pmatrix}\). Describe the solution geometrically.
12.4. Solutions#
Solution to Exercise 12.1
The matrix \(A\) is already in reduced row echelon form, and \(x_1\) is a pivot variable and \(x_2\) a free variable.
There is one special solution corresponding to \(x_2=1\) and it is \(\begin{pmatrix}x_1\\x_2\end{pmatrix}=\begin{pmatrix}-1\\1\end{pmatrix}\)
The null space is the space of all vectors \(t\begin{pmatrix}-1\\1\end{pmatrix}, t \in \mathbb{R}\).
The general solution to \(Ax = b\) is \(x = t\begin{pmatrix}-1\\1\end{pmatrix} + \begin{pmatrix}5\\0\end{pmatrix}\) for \(t \in \mathbb{R}\) which is a straight line parallel to \(\begin{pmatrix}-1\\1\end{pmatrix}\) through the point \(\begin{pmatrix}5\\0\end{pmatrix}\).