Systems in two variables

Example 1

Solve the following system by Gauss Jordan.

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> b:=array(1..2,1..3,[[-2,7,18],[3,-5,24]]);

[Maple Math]

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);

[Maple Plot]

Switch row 1 and row 2

> b1:=linalg[swaprow](b,1,2);

[Maple Math]

> glinsys(b1);

[Maple Plot]

Multiply row 1 by 1/3

> b2:=linalg[mulrow](b1,1,1/3);

[Maple Math]

Multiplying a row by a nonzero number does not change the graph as the picture below confirms.

> glinsys(b2);

[Maple Plot]

Add to row 2 2 times row 1

> b3:=linalg[addrow](b2,1,2,2);

[Maple Math]

> glinsys(b3);

[Maple Plot]

> print(b3);

[Maple Math]

Multiply row 2 by 3/11

> b4:=linalg[mulrow](b3,2,3/11);

[Maple Math]

> glinsys(b4);

[Maple Plot]

> print(b4);

[Maple Math]

Add to row 1 5/3 times row 2

> b5:=linalg[addrow](b4,2,1,5/3);

[Maple Math]

> glinsys(b5);

[Maple Plot]

One point remained fixed in each step. The following "movie" may help you to see it.

> geSlideShow([b,b1,b2,b3,b4,b5]);

[Maple Plot]

Example 2

> a:=array(1.. 3,1.. 3,[[120,50,679],[30,5,139],[-60,50,-41]]);

[Maple Math]

> glinsys(a);

[Maple Plot]

Multiply row 1 by 1/120

> a1:=linalg[mulrow](a,1,1/120);

[Maple Math]

Add to row 2 -30 times row 1

> a2:=linalg[addrow](a1,1,2,-30);

[Maple Math]

> glinsys(a2);

[Maple Plot]

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);

[Maple Math]

Add to row 3 60 times row 1

> a3:=linalg[addrow](a2,1,3,60);

[Maple Math]

> glinsys(a3);

[Maple Plot]

> print(a3);

[Maple Math]

Multiply row 2 by -2/15

> a4:=linalg[mulrow](a3,2,-2/15);

[Maple Math]

Add to row 1 -5/12 times row 2

> a5:=linalg[addrow](a4,2,1,-5/12);

[Maple Math]

> glinsys(a5);

[Maple Plot]

> print(a5);

[Maple Math]

Add to row 3 -75 times row 2

> a6:=linalg[addrow](a5,2,3,-75);

[Maple Math]

> glinsys(a6);

[Maple Math]

>