Section 1.4

Solving Systems of Linear Equations

Introduction

In this section we shall consider systems of linear equations and analyze their solution set.

Systems of linear equations arise in the mathematical modeling of many problems.

> with(linalg): with(linsys);

>

Systems of Linear Equations

Let us begin with some examples of two equations with two unknowns

Example 1: Consider the system of two equations with two unknowns:

> eq1:= x+y =2: eq2:=x -2*y=4: print(eq1); print(eq2);

x+y = 2

x-2*y = 4

>

Let us check graphically whether this system has a solution:

> graph(eq1,eq2);

Warning, the name changecoords has been redefined

`The purpose of this function is to graph a set of ...

`in 2D or 3D. For more information type: ?graph`

` `

`The following equations will be graphed now`

x+y = 2

x-2*y = 4

` `

   I am working on graphs.....

[Maple Plot]

>

>

In this example, the system has a unique solution.

Example 2: Consider the system of two equations with two unknowns:

> eq1:= x+ 2*y =2: eq2:=2*x +4*y=4: print(eq1); print(eq2);

x+2*y = 2

2*x+4*y = 4

>

Let us check graphically whether this system has a solution:

> graph(eq1,eq2);

`The purpose of this function is to graph a set of ...

`in 2D or 3D. For more information type: ?graph`

` `

`The following equations will be graphed now`

x+2*y = 2

2*x+4*y = 4

` `

   I am working on graphs.....

[Maple Plot]

>

>

In this example, the system has infinitely many solutions.

Example 3: Consider the system of two equations with two unknowns:

> eq1:= x+2*y =2: eq2:=x+2* y=8: print(eq1); print(eq2);

x+2*y = 2

x+2*y = 8

>

Let us check graphically whether this system has a solution:

> graph(eq1,eq2);

`The purpose of this function is to graph a set of ...

`in 2D or 3D. For more information type: ?graph`

` `

`The following equations will be graphed now`

x+2*y = 2

x+2*y = 8

` `

   I am working on graphs.....

[Maple Plot]

>

>

In this example, the system has no solution.

The same graphing technique can be applied for a system with three unknowns:

Example 4: Consider the system of three equations with three unknowns:

> eq1:= x+y +z =2: eq2:=x -2*y -z=4: eq3:=x-y-z=1: print(eq1); print(eq2); print(eq3);

x+y+z = 2

x-2*y-z = 4

x-y-z = 1

>

Let us check graphically whether this system has a solution:

> graph(eq1,eq2,eq3);

`The purpose of this function is to graph a set of ...

`in 2D or 3D. For more information type: ?graph`

` `

`The following equations will be graphed now`

x+y+z = 2

x-2*y-z = 4

x-y-z = 1

` `

   I am working on graphs...

[Maple Plot]

>

>

In this example, the system has a unique solution.

Example 5: Consider the system of three equations with three unknowns:

> eq1:= x+y +z =2: eq2:=x +y +z=2: eq3:=x-y-z=1: print(eq1); print(eq2); print(eq3);

x+y+z = 2

x+y+z = 2

x-y-z = 1

>

Let us check graphically whether this system has a solution:

> graph(eq1,eq2,eq3);

`The purpose of this function is to graph a set of ...

`in 2D or 3D. For more information type: ?graph`

` `

`The following equations will be graphed now`

x+y+z = 2

x+y+z = 2

x-y-z = 1

` `

   I am working on graphs...

[Maple Plot]

>

>

In this example, the system has infinitely many solutions.

Example 6: Consider the system of two equations with three unknowns:

> eq1:= x+y +z =2: eq2:=x +y +z=10: print(eq1); print(eq2);

x+y+z = 2

x+y+z = 10

>

Let us check graphically whether this system has a solution:

> graph(eq1,eq2);

`The purpose of this function is to graph a set of ...

`in 2D or 3D. For more information type: ?graph`

` `

`The following equations will be graphed now`

x+y+z = 2

x+y+z = 10

` `

   I am working on graphs...

[Maple Plot]

>

>

In this example, the system has no solution.

***************************************************************

The above examples show that one of the following must hold for a system

of linear equations:

. The system has a unique solution

. The system has infinitely many solutions

. The system has no solution

A linear system having no solutions is inconsistent . If it has one or more solutions,

the linear system is said to be consistent.

***************************************************************

In general, a system of m equations in n unknowns variables x[i] ( i=1..n ) is of the form :

a[11]*x[1]+a[12]*x[2]+a[13]*x[3] + ........ + a[1*n]*x[n] = b[1]

a[21]*x[1]+a[22]*x[2]+a[23]*x[3] + ........ + a[2*n]*x[n] = b[2]

a[31]*x[1]+a[32]*x[2]+a[33]*x[3] + ........ + a[3*n]*x[n] = b[3]

.............

a[m1]*x[1]+a[m2]*x[2]+a[m3]*x[3] + ........ + a[mn]*x[n] = b[m]

where the a[ij] 's are the coefficients of the unknown variables and the b 's are known quantities.

If the number of equations ( m ) is equal to the number of variables ( n ), the system is a square

system. If all the b 's are equal to zero, the system is called a Homogeneous System ;

otherwise, it is called a Nonhomogeneous System .

********************************************************************

Equivalent Systems

Example 7: Consider the following two systems of linear equations

System S[1] consists of the equations:

> eq1:= x+y+z=1: eq2:= 2*x +3*y-z=2: eq3:=x +y + 2*z=3:

> print(eq1); print(eq2); print(eq3);

x+y+z = 1

2*x+3*y-z = 2

x+y+2*z = 3

>

System S[2] consists of the equations:

> eq11:= x+y+z=1: eq22:= y-3*z = 0: eq33:= z = 2:

> print(eq11); print(eq22); print(eq33);

x+y+z = 1

y-3*z = 0

z = 2

The solution of the system S[1] :

> solveqns({eq1,eq2,eq3},{x,y,z});

Select one of the following modes

     1. Demonstration mode

     2. No-Step mode

2;

` `

`The values of the variables are given by`

vector([x = -7, y = 6, z = 2])

>

The solution of the system S[2] is:

> solveqns({eq11,eq22,eq33},{x,y,z});

Select one of the following modes

     1. Demonstration mode

     2. No-Step mode

2;

` `

` `

`The values of the variables are given by`

vector([x = -7, y = 6, z = 2])

>

Systems S[1] and S[2] have the same solution. System S[2] is easier to solve than system S[1] .

Indeed by substituting the value z = 2 into eq[22] we find y , and then by substituting the

values of z and y into eq[11] we find x.

***********************************************************************

Systems that have the same solution set are called Equivalent Systems .

***********************************************************************

Elementary Row Operations

1. Will the solution set of a system change upon multiplying one of its equations by

a nonzero scalar?

Example 8: Consider the system S[1] consisting of

> eq1:= x+2*y=3: print(eq1);

x+2*y = 3

and the system S[2] consisting of the multiple of eq[1]

> eq2:=3*x+6*y=9: print(eq2);

3*x+6*y = 9

Check graphically whether the two systems have the same solution set

> graph(eq1,eq2);

`The purpose of this function is to graph a set of ...

`in 2D or 3D. For more information type: ?graph`

` `

`The following equations will be graphed now`

x+2*y = 3

3*x+6*y = 9

` `

   I am working on graphs.....

[Maple Plot]

>

>

The above graph implies that the two lines overlap. Thus the two systems have the same

solution set.

Check algebraically

> solveqns(eq1,{x,y});

Select one of the following modes

     1. Demonstration mode

     2. No-Step mode

2;

` `

`The values of the variables are given by`

vector([x = 3-2*a, y = a])

>

> solveqns(eq2,{x,y});

Select one of the following modes

     1. Demonstration mode

     2. No-Step mode

2;

` `

`The values of the variables are given by`

vector([x = 3-2*a, y = a])

>

********************************************************************************

I.) Multiplying an equation of a system of linear equations by a nonzero scalar yields an equivalent equation.

********************************************************************************

2. Will the solution set of a system of linear equations change if two equations are interchanged?

Example 9: Consider the system S[1]

> eq1:=x+y+3*z=4: eq2:=x-y+z=0: eq3:=x-y-z=10: print(eq1); print(eq2); print(eq3);

x+y+3*z = 4

x-y+z = 0

x-y-z = 10

>

Interchange equation 2 and equation 3 of S[1] to get new system a S[2]

> eq11:=x+y+3*z=4: eq22:=x-y-z=10: eq33:=x-y+z=0: print(eq11); print(eq22); print(eq33);

x+y+3*z = 4

x-y-z = 10

x-y+z = 0

>

Are systems S[1] and S[2] equivalent?

Check the solution set

> solveqns({eq1,eq2,eq3},{x,y,z});

Select one of the following modes

     1. Demonstration mode

     2. No-Step mode

2;

` `

`The values of the variables are given by`

vector([x = 12, y = 7, z = -5])

>

>

> solveqns({eq11,eq22,eq33},{x,y,z});

Select one of the following modes

     1. Demonstration mode

     2. No-Step mode

2;

` `

`The values of the variables are given by`

vector([x = 12, y = 7, z = -5])

>

Since they have the same solution, the two systems are equivalent.

*******************************************************************

II.) Interchanging equations of a system of linear equations yields an equivalent system

******************************************************************

3. Will the solution set of a system of linear equations change if we replace any equation

by the sum of that equation and a nonzero multiple of another equation?

Example 10: Consider the system S[1]

> eq1:=x-2*y=2: eq2:=x+3*y=1: print(eq1); print(eq2);

x-2*y = 2

x+3*y = 1

>

Obtain new system S[2] by multiplying eq1 of S[1] by 2 and adding it to eq2

> eq11:=x-2*y=2: eq22:=3*x- y=5: print(eq11); print(eq22);

x-2*y = 2

3*x-y = 5

Check graphically whether both systems have the same solution set

The graph of the system S[1] is

> graph(eq1,eq2);

`The purpose of this function is to graph a set of ...

`in 2D or 3D. For more information type: ?graph`

` `

`The following equations will be graphed now`

x-2*y = 2

x+3*y = 1

` `

   I am working on graphs.....

[Maple Plot]

>

>

The graph of the system S[2] is

> graph(eq11,eq22);

`The purpose of this function is to graph a set of ...

`in 2D or 3D. For more information type: ?graph`

` `

`The following equations will be graphed now`

x-2*y = 2

3*x-y = 5

` `

   I am working on graphs.....

[Maple Plot]

>

>

What do you conclude from the graphs of the two systems?

The graphs indicate that the two system have the same unique solution. What does this imply

about the two systems?

**************************************************************************

III.) Replacing an equation by adding it to a multiple of another equation of a system of

linear equations yields an equivalent system.

**************************************************************************

Examples 8-10 show that the following operations yield equivalent systems

of linear equations:

. I.) multiply one equation by a nonzero constant.

. II.) interchange two equations.

. III.) add a multiple of one equation to another equation.

These three operations are called: elementary row operations.

********************************************************************

Matrix Representation of Linear Systems

Example 11: Consider the system of equations

> eq1:=2*x-3*y+z-w=0: eq2:=x-y+z-5*w=0: eq3:=x-y+z-w=9: eq4:=x+6*y-9*z+w=21:

> print(eq1); print(eq2); print(eq3); print(eq4);

2*x-3*y+z-w = 0

x-y+z-5*w = 0

x-y+z-w = 9

x+6*y-9*z+w = 21

>

The coefficient matrix associated with this system is

> AUG:=matrix([[2,-3,1,-1],[1,-1,1,-5],
[1,-1,1,-1],[1,6,-9,1]]);

AUG := matrix([[2, -3, 1, -1], [1, -1, 1, -5], [1, ...

The augmented matrix associated with this system is

> AUG:=matrix([[2,-3,1,-1,0],[1,-1,1,-5,0],
[1,-1,1,-1,9],[1,6,-9,1,21]]);

AUG := matrix([[2, -3, 1, -1, 0], [1, -1, 1, -5, 0]...

>

Example 12: Consider the system of equations

> eq1:=2*x-3*y+z=0: eq2:=7*x+11*y-9*z=2:

> print(eq1); print(eq2);

2*x-3*y+z = 0

7*x+11*y-9*z = 2

>

The augmented matrix associated with this system is the 2x4 matrix:

> AUG:=matrix([[2,-3,1,0],[7,11,-9,2]]);

AUG := matrix([[2, -3, 1, 0], [7, 11, -9, 2]])

>

We can also establish the following association : for every augmented matrix , one can write

the system of linear equations.

Example 13: Consider the augmented matrix

> A:=matrix([[2,3,5,1],[1,0,2,5],[2,4,0,0]]);

A := matrix([[2, 3, 5, 1], [1, 0, 2, 5], [2, 4, 0, ...

>

The set of equations associated with this matrix is

> eq1:=2*x+3*y+5*z=1: eq2:=x+2*z=5: eq3:=2*x+4*y=0:

> print(eq1); print(eq2); print(eq3);

2*x-3*y+z = 0

7*x+11*y-9*z = 2

x-y+z-w = 9

>

Example 14: Consider the augmented matrix:

> A:=matrix([[2,3,5,1,0],[-1,8,2,5,0],[2,4,9,-7,0]]);

A := matrix([[2, 3, 5, 1, 0], [-1, 8, 2, 5, 0], [2,...

>

The set of equations associated with this matrix is

> eq1:=2*x+3*y+5*z+w=0: eq2:=-x+8*y +2*z+5*w=0: eq3:=2*x+4*y+9*z-7*w=0:

> print(eq1); print(eq2); print(eq3);

2*x+3*y+5*z+w = 0

-x+8*y+2*z+5*w = 0

2*x+4*y+9*z-7*w = 0

>

It is clear by now that matrix notation is a convenient way to represent a given system

of linear equations.

The linear system Ax=b can also be written as linear combination of the columns

of A set equal to the right hand side b.

> A:=matrix(4,3,[]): x:=matrix(3,1,[x_1,x_2,x_3]): b:=matrix(4,1,[b_1,b_2,b_3,b_4]):

> evalm(A)*evalm(x) = evalm(b);

matrix([[A[1,1], A[1,2], A[1,3]], [A[2,1], A[2,2], ...

> x_1*evalm(matrix(4,1,[A_11,A_21,A_31,A_41])) + x_2*evalm(matrix(4,1,[A_12,A_22,A_32,A_42])) + x_3*evalm(matrix(4,1,[A_13,A_23,A_33,A_43])) = evalm(b);

x_1*matrix([[A_11], [A_21], [A_31], [A_41]])+x_2*ma...

>

Let A be an m x n matrix. The linear system Ax=b is consistent if and only if the vector b is in the span of

the column vectors of A .

Gauss-Reduction

Example 15: Assume we are given the system

>

> eq1:=x1+2*x2-3*x3=4: eq2:=-3*x1-6*x2-5*x3=7: eq3:=-x1+5*x2-11*x3=12:

> print(eq1); print(eq2); print(eq3);

x1+2*x2-3*x3 = 4

-3*x1-6*x2-5*x3 = 7

-x1+5*x2-11*x3 = 12

>

The augmented matrix associated with this system is

>

> AUG:=matrix([[1,2,-3,4],[-3,-6,-5,7],[-1,5,-11,12]]);

AUG := matrix([[1, 2, -3, 4], [-3, -6, -5, 7], [-1,...

The idea is to get a system equivalent to the original one yet easier to solve.

We perform elementary row operations on AUG to eliminate x[1] from the second

and third equation.

Multiply row 1 by 3 and add to row 2

>

> AUG1:=addrow(AUG,1,2,3);

AUG1 := matrix([[1, 2, -3, 4], [0, 0, -14, 19], [-1...

Multiply row 1 by 1 and add to row 3

>

> AUG2:=addrow(AUG1,1,3,1);

AUG2 := matrix([[1, 2, -3, 4], [0, 0, -14, 19], [0,...

and then eliminate x[2] from the third equation of the resulting system.

Interchange row 2 and row 3

>

> AUG3:=swaprow(AUG2,2,3);

AUG3 := matrix([[1, 2, -3, 4], [0, 7, -14, 16], [0,...

Multiply row 2 by 1/7

>

> AUG4:=mulrow(AUG3,2,1/7);

AUG4 := matrix([[1, 2, -3, 4], [0, 1, -2, 16/7], [0...

Multiply row 3 by -1/14

>

> AUG5:=mulrow(AUG4,3,-1/14);

AUG5 := matrix([[1, 2, -3, 4], [0, 1, -2, 16/7], [0...

The matrix AUG[5] is referred to as the "echelon form" of AUG. The new system associated

with AUG[5] is:

>

> eq1:=x1 + 2*x2 - 3*x3 = 4: eq2:=x2 - 2*x3 = 16/7: eq3:= x3 = -19/14:

> print(eq1); print(eq2); print(eq3);

x1+2*x2-3*x3 = 4

x2-2*x3 = 16/7

x3 = -19/14

>

This system is equivalent to the original system since it is obtained by a sequence of

elementary row operations.

To obtain the "echelon form" of the matrix AUG, we perform a sequence of elementary row

operations until we get a form that resembles AUG[5] in this example.

What does the reduced matrix AUG[5] or the new system tell us about the solution of the

original system?

Example 16: Assume we are given the system associated with the following augmented matrix:

>

>

> AUG:=matrix([[1,2,-3,4],[-3,-6,-5,7],[-1,-2,-11,15]]);

AUG := matrix([[1, 2, -3, 4], [-3, -6, -5, 7], [-1,...

Perform a sequence of elementary row operations on the matrix AUG

>

> AUG1:=addrow(AUG,1,2,3);

AUG1 := matrix([[1, 2, -3, 4], [0, 0, -14, 19], [-1...

>

> AUG2:=addrow(AUG1,1,3,1);

AUG2 := matrix([[1, 2, -3, 4], [0, 0, -14, 19], [0,...

>

> AUG3:=mulrow(AUG2,2,-1/14);

AUG3 := matrix([[1, 2, -3, 4], [0, 0, 1, -19/14], [...

>

> AUG4:=addrow(AUG3,2,3,14);

AUG4 := matrix([[1, 2, -3, 4], [0, 0, 1, -19/14], [...

The matrix AUG[4] is the "echelon form" of AUG. The new system associated with AUG[4] is

>

> eq1:=x1 + 2*x2 - 3*x3 = 4: eq2:=x3 = - 19/14: eq3:= 0 = 0:

> print(eq1); print(eq2); print(eq3);

x1+2*x2-3*x3 = 4

x3 = -19/14

0 = 0

>

>

The "echelon form" AUG[4] of the matrix AUG indicates that this new system is consistent

and has infinitely many solutions.

Example 17: Assume we are given the system associated with the following augmented matrix:

>

> AUG:=matrix([[1,2,-3,4],[-3,-6,-5,7],[-2,-4,-8,15]]);

AUG := matrix([[1, 2, -3, 4], [-3, -6, -5, 7], [-2,...

>

>

Perform a sequence of elementary row operations on the new matrix AUG:

>

> AUG1:=addrow(AUG,1,2,3);

AUG1 := matrix([[1, 2, -3, 4], [0, 0, -14, 19], [-2...

>

> AUG2:=addrow(AUG1,1,3,2);

AUG2 := matrix([[1, 2, -3, 4], [0, 0, -14, 19], [0,...

>

> AUG3:=mulrow(AUG2,2,-1/14);

AUG3 := matrix([[1, 2, -3, 4], [0, 0, 1, -19/14], [...

>

> AUG4:=addrow(AUG3,2,3,14);

AUG4 := matrix([[1, 2, -3, 4], [0, 0, 1, -19/14], [...

>

>

The matrix AUG[4] is the "echelon form" of AUG. The new system associated with AUG[4] is:

>

> eq1:=x1 + 2*x2 - 3*x3 = 4: eq2:=x3 = - 19/14: eq3:= 0 = 4:

> print(eq1); print(eq2); print(eq3);

>

x1+2*x2-3*x3 = 4

x3 = -19/14

0 = 4

The "echelon form" AUG[4] of the matrix AUG indicates that this new system is inconsistent

(note: eq3 is absurd).

*********************************************************************

We have used elementary row operations to reduce a given matrix to its "ECHELON FORM"

to deduce consistency of the system.

Following is a representation of an original system and its reduced form.

Original System Reduced System

x x x x x x x x x x x x x x x x

x x x x x x x x 0 x x x x x x x

x x x x x x x x -------------> 0 0 0 x x x x x

x x x x x x x x 0 0 0 0 x x x x

x x x x x x x x 0 0 0 0 0 0 0 0

***********************************************************************

The reduced system should have the following properties:

. All entries below the leading entry must be made zero.

. The leading entry in row i >= 2 is always to the right of the leading entry in previous rows.

. All zero rows must appear at the end of the matrix .

The resulting matrix is a matrix in row echelon form.

In addition, to the above four steps, if

. The first nonzero entry in any row must be 1.

. All entries above and below a leading 1 are zero,

then the resulting matrix is a matrix in reduced row echelon form .

*******************************************************************

The algorithm that yields the row echelon form of a matrix is

The GAUSS ELIMINATION ALGORITHM

The algorithm that yields the reduced row echelon form of a matrix is

The GAUSS - JORDAN ALGORITHM

If either form results in a consistent system of linear equations, then we apply

BACKSUBSTITUTION ALGORITHM

to the reduced form of the augmented matrix to obtain the solution of the original system .

*********************************************************************

Algorithm

Let us go over the Gauss elimination algorithm.

Example 18: Given the matrix:

>

> A:=matrix([[1,2,-1],[2,4,6],[5,7,9]]);

A := matrix([[1, 2, -1], [2, 4, 6], [5, 7, 9]])

>

> gausselim(A);

` `

`The purpose of this procedure is to demonstrate th...

`the row echelon form of a matrix or to interact wi...

`the correct operations that will give the row eche...

`also has the option of obtaining the row echelon f...

` `

`Select one of the following modes:`

   1. Demonstration mode

   2. Interactive mode

   3. No Intermediate steps. Just give me the answer

` `

<Select from 1; 2; or 3; >

1;

`Now we are ready to perform Gauss elimination on t...

A = matrix([[1, 2, -1], [2, 4, 6], [5, 7, 9]])

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` Perform elimination on column :`, 1

`************************************`

` `

`multiply row`, 1, `of the matrix`, matrix([[1, 2, ...

` `

`to get:`, matrix([[1, 2, -1], [0, 0, 8], [5, 7, 9]...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`multiply row`, 1, `of the matrix`, matrix([[1, 2, ...

` `

`to get:`, matrix([[1, 2, -1], [0, 0, 8], [0, -3, 1...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`Since we need a nonzero element in row  `, 2, `to ...

rows, 3, proc () option builtin; 139 end proc, 2, `...

` `

`to get :`, matrix([[1, 2, -1], [0, -3, 14], [0, 0,...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

`divide row`, 2, `of the matrix`, matrix([[1, 2, -1...

` `

`to get :`, matrix([[1, 2, -1], [0, 1, -14/3], [0, ...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

` `

`divide row`, 3, `of the matrix`, matrix([[1, 2, -1...

` `

`to get :`, matrix([[1, 2, -1], [0, 1, -14/3], [0, ...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

` `

`The matrix in row echelon form is :`

matrix([[1, 2, -1], [0, 1, -14/3], [0, 0, 1]])

` `

` `

`This is the end of gausselim demonstration procedu...

`the sequence of elementary row operations needed t...

`form of the matrix. Now try your own examples`

>

If the resulting matrix is the augmented matrix of a system of linear equations, is the system consistent or not? If consistent, how many solutions does it have?

Example 19: Given the matrix

>

> A:=matrix([[5,2,-9,7],[2,4,6,11],[15,7,29,45]]);

A := matrix([[5, 2, -9, 7], [2, 4, 6, 11], [15, 7, ...

Obtain the echelon form of the matrix:

>

> gausselim(A);

` `

`The purpose of this procedure is to demonstrate th...

`the row echelon form of a matrix or to interact wi...

`the correct operations that will give the row eche...

`also has the option of obtaining the row echelon f...

` `

`Select one of the following modes:`

   1. Demonstration mode

   2. Interactive mode

   3. No Intermediate steps. Just give me the answer

` `

<Select from 1; 2; or 3; >

1;

`Now we are ready to perform Gauss elimination on t...

A = matrix([[5, 2, -9, 7], [2, 4, 6, 11], [15, 7, 2...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` Perform elimination on column :`, 1

`************************************`

` `

`divide row`, 1, `of the matrix`, matrix([[5, 2, -9...

` `

`to get :`, matrix([[1, 2/5, -9/5, 7/5], [2, 4, 6, ...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

`multiply row`, 1, `of the matrix`, matrix([[1, 2/5...

` `

`to get:`, matrix([[1, 2/5, -9/5, 7/5], [0, 16/5, 4...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`multiply row`, 1, `of the matrix`, matrix([[1, 2/5...

` `

`to get:`, matrix([[1, 2/5, -9/5, 7/5], [0, 16/5, 4...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` Perform elimination on column :`, 2

`************************************`

` `

`divide row`, 2, `of the matrix`, matrix([[1, 2/5, ...

` `

`to get :`, matrix([[1, 2/5, -9/5, 7/5], [0, 1, 3, ...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

`multiply row`, 2, `of the matrix`, matrix([[1, 2/5...

` `

`to get:`, matrix([[1, 2/5, -9/5, 7/5], [0, 1, 3, 4...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

`divide row`, 3, `of the matrix`, matrix([[1, 2/5, ...

` `

`to get :`, matrix([[1, 2/5, -9/5, 7/5], [0, 1, 3, ...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

` `

`The matrix in row echelon form is :`

matrix([[1, 2/5, -9/5, 7/5], [0, 1, 3, 41/16], [0, ...

` `

` `

`This is the end of gausselim demonstration procedu...

`the sequence of elementary row operations needed t...

`form of the matrix. Now try your own examples`

>

>

>

If the resulting matrix is the augmented matrix of a system of linear equations,

is the system consistent or not? If consistent, how many solutions does it have?

Example 20: Given the matrix

> A:=matrix([[3,1,-9,6],[4,6,1,1],[7,7,-8,7]]);

A := matrix([[3, 1, -9, 6], [4, 6, 1, 1], [7, 7, -8...

>

The echelon form of A is obtained by:

>

> gausselim(A);

` `

`The purpose of this procedure is to demonstrate th...

`the row echelon form of a matrix or to interact wi...

`the correct operations that will give the row eche...

`also has the option of obtaining the row echelon f...

` `

`Select one of the following modes:`

   1. Demonstration mode

   2. Interactive mode

   3. No Intermediate steps. Just give me the answer

` `

<Select from 1; 2; or 3; >

1;

`Now we are ready to perform Gauss elimination on t...

A = matrix([[3, 1, -9, 6], [4, 6, 1, 1], [7, 7, -8,...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` Perform elimination on column :`, 1

`************************************`

` `

`divide row`, 1, `of the matrix`, matrix([[3, 1, -9...

` `

`to get :`, matrix([[1, 1/3, -3, 2], [4, 6, 1, 1], ...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

`multiply row`, 1, `of the matrix`, matrix([[1, 1/3...

` `

`to get:`, matrix([[1, 1/3, -3, 2], [0, 14/3, 13, -...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`multiply row`, 1, `of the matrix`, matrix([[1, 1/3...

` `

`to get:`, matrix([[1, 1/3, -3, 2], [0, 14/3, 13, -...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` Perform elimination on column :`, 2

`************************************`

` `

`divide row`, 2, `of the matrix`, matrix([[1, 1/3, ...

` `

`to get :`, matrix([[1, 1/3, -3, 2], [0, 1, 39/14, ...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

`multiply row`, 2, `of the matrix`, matrix([[1, 1/3...

` `

`to get:`, matrix([[1, 1/3, -3, 2], [0, 1, 39/14, -...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

` `

`The matrix in row echelon form is :`

matrix([[1, 1/3, -3, 2], [0, 1, 39/14, -3/2], [0, 0...

` `

` `

`This is the end of gausselim demonstration procedu...

`the sequence of elementary row operations needed t...

`form of the matrix. Now try your own examples`

>

If the resulting matrix is the augmented matrix of a system of linear equations,

is the system consistent or not? If consistent, how many solutions does it have?

The reduced row echelon form of matrix A in Example 20 can be obtained by using

Gauss-Jordan algorithm

>

> rref(A);

` `

`The purpose of this procedure is to either demonst...

`needed to obtain the reduced row echelon form of a...

`interact with the function to select the correct o...

`will yield the reduced row echelon form of the mat...

`will also allow you to obtain the reduced row eche...

`any intermediate steps`

` `

`Select one of the following modes:`

   1. Demonstration mode

   2. Interactive mode

   3. No Intermediate steps. Just give me the answer

1;

`The original matrix is :`, matrix([[3, 1, -9, 6], ...

`Note that the given matrix`, matrix([[3, 1, -9, 6]...

     Choose from the following menu

     1. To perform the Gauss elimination and obtain 

        the row echelon form type  rowec; or 1;

     2. If you do not want to go through the process 

        of obtaining the row echelon form type bypass; or 2;

bypass;

` `

`The matrix in ROW-ECHELON form is :`

matrix([[1, 1/3, -3, 2], [0, 1, 39/14, -3/2], [0, 0...

`Now let us put this matrix into Reduced Row echelo...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`Perform elimination on column`, 2

`*************************`

`multipliy row`, 2, `of the matrix`, matrix([[1, 1/...

` `

`The new matrix is :`, matrix([[1, 0, -55/14, 5/2],...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`The matrix in REDUCED row echelon form is :`, matr...

` `

`This is the end of demonstration version of the re...

`form procedure. You may try other examples to lear...

>

If the resulting matrix is the augmented matrix of a system of linear equations,

is the system consistent or not? If consistent, how many solutions does it have?

Example 21:

>

> A:=matrix([[1,3,5,6,15],[2,3,7,9,11],[4,9,17,21,41]]);

A := matrix([[1, 3, 5, 6, 15], [2, 3, 7, 9, 11], [4...

>

First put the matrix in row echelon form. Use the nostep mode of the "gausselim" function

>

> gausselim(A);

` `

`The purpose of this procedure is to demonstrate th...

`the row echelon form of a matrix or to interact wi...

`the correct operations that will give the row eche...

`also has the option of obtaining the row echelon f...

` `

`Select one of the following modes:`

   1. Demonstration mode

   2. Interactive mode

   3. No Intermediate steps. Just give me the answer

` `

<Select from 1; 2; or 3; >

3;

`The matrix in row echelon form is :`

matrix([[1, 3, 5, 6, 15], [0, 1, 1, 1, 19/3], [0, 0...

>

>

The echelon form of the matrix is

>

> A1:=matrix([[1,3,5,6,15],[0,1,1,1,19/3],[0,0,0,0,0]]);

A1 := matrix([[1, 3, 5, 6, 15], [0, 1, 1, 1, 19/3],...

Apply the backsub algorithm:

>

> backsub(A1);

`The purpose of this procedure is to demonstrate th...

`of linear equations using the back substitution al...

`function to select the correct responses that will...

`also shows the solution obtained using back substi...

` `

`Select one of the following modes:`

   1. Demonstration mode

   2. Interactive mode

   3. No Intermediate steps. Just give me the answer

1;

` `

`The augmented matrix you entered is :`, AUG = matr...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`The above augmented matrix is equivalent to the fo...

x[1]+3*x[2]+5*x[3]+6*x[4] = 15

x[2]+x[3]+x[4] = 19/3

0 = 0

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

` `

`From the reduced row echelon form of the matrix, w...

`can deduce that the system has infinitely many sol...

` `

`Since we have`, 4, `variables and only`, 2, `indep...

`we will have to choose`, 2, `free variables .`

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`Recall that the original system of equations is eq...

x[1]+3*x[2]+5*x[3]+6*x[4] = 15

x[2]+x[3]+x[4] = 19/3

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`Choose the free variable(s) and substitute`

x[3] = a

x[4] = b

` `

`in equation : `, x[2]+x[3]+x[4] = 19/3

`to find the variable`, x[2] = 19/3-a-b

` `

`Substitute new values in the solution vector:`, ve...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`substitute :`

x[2] = 19/3-a-b

x[3] = a

x[4] = b

` `

`in equation : `, x[1]+3*x[2]+5*x[3]+6*x[4] = 15

`to find the variable`, x[1] = -4-2*a-3*b

` `

`Substitute new values in the solution vector:`, ve...

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`Therefore the values of the variables are given by...

x[1] = -4-2*a-3*b

x[2] = 19/3-a-b

x[3] = a

x[4] = b

` `

< type ; and press Enter to continue ?topic for help  exit; to quit >

;

` `

`and the solution to the equivalent system of equat...

x[1]+3*x[2]+5*x[3]+6*x[4] = 15

x[2]+x[3]+x[4] = 19/3

`Solution ` = vector([-4-2*a-3*b, 19/3-a-b, a, b])

` `

`This is the end of the demonstration mode of backs...

`try other examples to learn how to solve a system ...

>

>

Elementary matrix

Any matrix that can be obtained from the identity matrix by means of elementary row operation

is called an elementary matrix.

Muliplication of A on the left by elementary matrix E effects the same elementary row operation

on A that was performed on the identity matrix to obtain E.

> A:=matrix(3,3,[]);

A := array(1 .. 3,1 .. 3,[])

> E := matrix(3,3,[1, 0, 0, 0, 0, 1, 0, 1, 0]);

E := matrix([[1, 0, 0], [0, 0, 1], [0, 1, 0]])

> multiply(E,A);

matrix([[A[1,1], A[1,2], A[1,3]], [A[3,1], A[3,2], ...

>

Exercise

1-15(odd), 21, 23, 25, 29, 41-45, 47, 49, 56