Question 1139653
<pre>
Here's one exactly like it.  Just put your numbers instead:

2x +  y -  z = 2 
 x +  y +  z = 2 
 x + 3y + 2z = 1

{{{(matrix(3,5,

2, 1, -1, "|",2,
1, 1,  1, "|",2,
1, 3,  2, "|",1))}}}

The object is to get the matrix like this:

{{{(matrix(3,5,

1, "@", "@", "|","@",
0, 1,  "@", "|","@",
0, 0,  1, "|","@"))}}}

where there will be 1's on the diagonal, 0's underneath the
diagonal, and numbers where the @'s are.

Start with:

{{{(matrix(3,5,

2, 1, -1, "|",2,
1, 1,  1, "|",2,
1, 3,  2, "|",1))}}}

Swap rows 1 and 2, because it's easier when there's a 1
in the upper left corner.

R1 <-> R2

{{{(matrix(3,5,
1, 1,  1, "|",2,
2, 1, -1, "|",2,
1, 3,  2, "|",1))}}}
 
Multiply row 1 by -2
-2R1->R1

{{{(matrix(3,5,
-2, -2,  -2, "|",-4,
2, 1, -1, "|",2,
1, 3,  2, "|",1))}}}

Add Row 1 and Row 2 and put that in place of Row 2

R1+R2->R2 

{{{(matrix(3,5,
-2, -2,  -2, "|",-4,
0, -1, -3, "|",-2,
1, 3,  2, "|",1))}}}

Restore Row 1 both 

R1/(-2) -> R1

{{{(matrix(3,5,
1, 1,  1, "|",2,
0, -1, -3, "|",-2,
1, 3,  2, "|",1))}}}

Multiply Row 1 by -1

{{{(matrix(3,5,
-1, -1,  -1, "|",-2,
0, -1, -3, "|",-2,
1, 3,  2, "|",1))}}}

Add row 1 to Row 3

{{{(matrix(3,5,
-1, -1,  -1, "|",-2,
0, -1, -3, "|",-2,
0, 2,  1, "|",-1))}}}

Restore row 1

-R1 <-> R1

{{{(matrix(3,5,
1, 1,  1, "|",2,
0, -1, -3, "|",-2,
0, 2,  1, "|",-1))}}}

Multiply row 2 by -1

-R2 <-> R2


{{{(matrix(3,5,
1, 1,  1, "|",2,
0, 1, 3, "|",2,
0, 2,  1, "|",-1))}}}

Multiply Row by -2

{{{(matrix(3,5,
1, 1,  1, "|",2,
0,-2, -6, "|",-4,
0, 2,  1, "|",-1))}}}

Add row 2 and Row 3 and put that sum in row 3

R2+R3 -> R3

{{{(matrix(3,5,
1, 1,  1, "|",2,
0,-2, -6, "|",-4,
0, 0, -5, "|",-5))}}}

Restore Row 2

R2/(-2) -> R2

{{{(matrix(3,5,
1, 1,  1, "|",2,
0, 1, 3, "|",2,
0, 0, -5, "|",-5))}}}

Divide row 3 by -5

{{{(matrix(3,5,
1, 1,  1, "|",2,
0, 1, 3, "|",2,
0, 0, 1, "|",1))}}}

R3/(-5)( -> R3

Rewrite as a system of equations:

1x + 1y + 1z = 2
0x + 1y + 3z = 2
0x + 0y + 1z = 1

Remove the understood 1's and 0's

x + y +  z = 2
    y + 3z = 2
         z = 1
         
The bottom equation of the system is already solved for z

         z = 1

Substitute in the middle equation of the system for y:

    y + 3z =  2
  y + 3(1) =  2
     y + 3 =  2
         y = -1
 
 Substitute in the top equation of the system for z

    x + y +  z = 2
x + (-1) + (1) = 2
             x = 2  

(x,y,z) = (2,-1,1)

Edwin</pre>