Systems in two variables
Example 1
Solve the following system by Gauss Jordan.
> b:=array(1..2,1..3,[[-2,7,18],[3,-5,24]]);
Note that the with math191 statement makes the custom Maple commands that we will be using (such as glinsys) available for use. The command glinsys(b) produces the graph of the equations associated with matrix b.
> with(math191):
> glinsys(b);
Switch row 1 and row 2
> b1:=linalg[swaprow](b,1,2);
> glinsys(b1);
Multiply row 1 by 1/3
> b2:=linalg[mulrow](b1,1,1/3);
Multiplying a row by a nonzero number does not change the graph as the picture below confirms.
> glinsys(b2);
Add to row 2 2 times row 1
> b3:=linalg[addrow](b2,1,2,2);
> glinsys(b3);
> print(b3);
Multiply row 2 by 3/11
> b4:=linalg[mulrow](b3,2,3/11);
> glinsys(b4);
> print(b4);
Add to row 1 5/3 times row 2
> b5:=linalg[addrow](b4,2,1,5/3);
> glinsys(b5);
One point remained fixed in each step. The following "movie" may help you to see it.
> geSlideShow([b,b1,b2,b3,b4,b5]);
Example 2
> a:=array(1.. 3,1.. 3,[[120,50,679],[30,5,139],[-60,50,-41]]);
> glinsys(a);
Multiply row 1 by 1/120
> a1:=linalg[mulrow](a,1,1/120);
Add to row 2 -30 times row 1
> a2:=linalg[addrow](a1,1,2,-30);
> glinsys(a2);
This next command will redisplay the last matrix so that we can decide what to do next without scrolling back up the window.
> print(a2);
Add to row 3 60 times row 1
> a3:=linalg[addrow](a2,1,3,60);
> glinsys(a3);
> print(a3);
Multiply row 2 by -2/15
> a4:=linalg[mulrow](a3,2,-2/15);
Add to row 1 -5/12 times row 2
> a5:=linalg[addrow](a4,2,1,-5/12);
> glinsys(a5);
> print(a5);
Add to row 3 -75 times row 2
> a6:=linalg[addrow](a5,2,3,-75);
> glinsys(a6);
>