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.

Definition

Let A be an m×n matrix with columns v1,v2,,vn:

A=(|||v1v2vn|||).

Then the product of A with a vector xRn is the linear combination

Ax=(|||v1v2vn|||)(x1x2xn)=x1v1+x2v2++xnvn.

Ax is a vector in Rm.

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

A=(456789)

and

x=(123)

then

Ax=(456789)(123)=1(47)+2(58)+3(609)=(3250).

Given a vectors v1,v2,,vn and b in Rm then we can form the vector equation

x1v1+x2v2++xnvn=b.

This is equivalent to the matrix equation Ax=b where

A=(|||v1v2vn|||)andx=(x1x2xn).

Four Ways to Write a Linear System

We now have four equivalent ways to express a linear system:

1. As a system of equations:

2x1+3x22x3=7x1x23x3=5.

2. As an augmented matrix:

(23271135).

3. As a vector equation:

x1(21)+x2(31)+x3(23)=(75).

4. As a matrix equation:

(232114)(x1x2x3)=(75).

Example

Let A=(100100). Does the equation Ax=(111) have a solution?

Solution

First we answer the question geometrically. The columns of A are

v1=(100)andv2=(010),

and the target vector (the right-hand side of the equation) is b=(111). 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:

Span{v1,v2} 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

(101011001)

is already in echelon form. The last equation is 0=1, so the system is indeed inconsistent and the matrix equation (111) has no solution.

Example

Let

v1=(211),v2=(101)andb=(112).

Does b lie in the subset spanned by v1 and v2?

Solution

b is in Span{v1,v2} if an only if there exist x1,x2 such that

x1(211)+x2(101)=(112).

We can write this as a matrix system and solve by row reduction of the augmented matrix:

(211101112)RREF(101011000).

The system is consistent with solution x1=1 and x2=1 and we conclude that b lies in the subset spanned by v1 and v2.

Geometrically, Span{v1,v2} 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.

Theorem

Let A be an m×n matrix. The following are equivalent:

  1. Ax=b has a solution for all bRm.

  2. The span of the columns of A is all of Rm.

  3. 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.

Definition

An equation of the form Ax=0 is homogeneous.

An equation of the form Ax=b with b0 is inhomogeneous.

For example, given the homogeneous equation Ax=0, where

A=(134212101)

we can use row operations to reduce the augmented matrix

(134021201010)

to reduced row echelon form:

(100001000010)

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

A=(108701430000).

Solution

The matrix A is already in echelon form. The equivalent system of equations is

x18x37x4=0x2+4x3+3x4=0

which can be written in parametric form:

x1=8x3+7x4x2=4x33x4x3=x3x4=x4.

Or as a vector equation:

x=(x1x2x3x4)=x3(8410)+x4(7301)

for any x3,x4R.

The two vectors (8410) and (7301) are the special solutions corresponding to the free variables x3 and x4 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

Ax=b

The general solution to Ax=b

Let A be an (m×n) matrix and b a length-m vector. Then the general solution to

Ax=b

is

x=t1v1++tkvk+v0

where t1, tkR are real numbers and v1,,vk are the k special solutions corresponding to the k free variables.

  1. Form the augmented matrix A|b.

  2. Use Gaussian elimination to find the reduced row echelon form and determine the k free variables.

  3. Write the parametric form of the solution set (write the corresponding system of linear equations, moving all free variables to the right hand side.)

  4. Write the solution as a vector equation v=t1v1++tkvk+v0.

Example

Determine the general solution to the following system of equations, expressing the answer in vector form:

2x14x22x310x4=02x1+4x2+x3+9x4=23x1+6x2+x3+13x4=4.

Solution

The augmented matrix is:

(24210024192361134).

We have already determined the reduced row echelon form in this example:

(120420011200000).

Write as a system of equations with the free variables x2 and x4 on the right hand side:

x1=2x24x42x2=x2x3=x4+2x4=x4.

Write this in vector form:

(x1x2x3x4)=(2x24x42x2x4+2x4)=x2(2100)+x4(4011)+(2020)

for any x2,x4R.

Exercise 12.1

For the matrix

A=(1100),
  1. What are the special solution(s) to the homogeneous equation Ax=0?

  2. What is the null space of A?

  3. Find the general solution to Ax=b where b=(50). Describe the solution geometrically.

12.4. Solutions#

Solution to Exercise 12.1

The matrix A is already in reduced row echelon form, and x1 is a pivot variable and x2 a free variable.

  1. There is one special solution corresponding to x2=1 and it is (x1x2)=(11)

  2. The null space is the space of all vectors t(11),tR.

  3. The general solution to Ax=b is x=t(11)+(50) for tR which is a straight line parallel to (11) through the point (50).