How do you solve using gaussian elimination or gauss-jordan elimination, 3x-2y-z=7, z=x+2y-5, -x+4y+2z=-4?

1 Answer
Apr 16, 2017

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


Try setting up a matrix:

[(3,-2,-1,|,7),(1,2,-1,|,5),(-1,4,2,|,-4)]

Do note that your second equation has z on the wrong side compared to the other equations in the system, so you must add (5-z) to both sides of the second equation before you form this matrix.

To row-reduce this using gaussian elimination, simply row-reduce this using elementary row operations, i.e. any of the following in any combination:

  • Scale a row, i.e. cR_i, where c is a constant.
  • Add row i onto row j and store in row j, i.e. R_i + R_j

Hence, if I write cR_i + R_j, it means cR_i is added to each entry in row R_j and the result is stored into row j.

Our process in general will be to get the matrix down to a solvable form. Gauss-Jordan elimination would have gotten it down to reduced-row-echelon form, though that is not necessary to solve this system.

stackrel(R_2 + R_3" ")(->)[(3,-2,-1,|,7),(1,2,-1,|,5),(0,6,1,|,1)]

stackrel(-1/3R_1 + R_2" ")(->)[(3,-2,-1,|,7),(0,8/3,-2/3,|,8/3),(0,6,1,|,1)]

stackrel(3/2R_2" ")(->)[(3,-2,-1,|,7),(0,4,-1,|,4),(0,6,1,|,1)]

stackrel(R_3 + R_2; 1/5R_2" ")(->)[(3,-2,-1,|,7),(0,2,0,|,1),(0,6,1,|,1)]

Good enough; we can solve backwards now. The current system of equations looks like:

3x - 2y - z = 7
0x + 2y + 0 = 1
0x + 6y + 1 = 1

Thus, from the second equation we have:

2y = 1 => color(green)(y = 1/2)

6y + z = 1

=> 6(1/2) + z = 1 => color(green)(z = -2)

3x - 2y - z = 7

=>3x - 2(1/2) - (-2) = 7

=> 3x = 6 => color(green)(x = 2)

Hence, we got color(blue)((x,y,z) = (2,1/2,-2)).


Let's check...

3x - 2y - z

= 3(2) - 2(1/2) - (-2) = 6 - 1 + 2 = 7 color(blue)(sqrt"")

x + 2y - 5

= 2 + 2(1/2) - 5 = 2 + 1 - 5 = -2 color(blue)(sqrt"")

-x + 4y + 2z

= -(2) + 4(1/2) + 2(-2) = -2 + 2 - 4 = -4 color(blue)(sqrt"")