# How do you solve x+4y-z=7, x+y+z=2 and -2x-2y+2z=-8 using matrices?

##### 1 Answer
Oct 14, 2016

Please see the explanation for the process.
$x = 2 , y = 1 , z = - 1$

#### Explanation:

Write $x + 4 y - z = 7$ into the first row of an augmented matrix:

[ (1,4,-1,|,7) ]

Write $x + y + z = 2$ into the second row:

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

Write $- 2 x - 2 y + 2 z = - 8$ into the third row:

[ (1,4,-1,|,7), (1,1,1,|,2), (-2, -2, 2, |, -8) ]

Multiply row 1 by -1 and add to row 2:

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

Multiply row 1 by 2 and add to row 3:

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

Divide row 3 by 6 and swap with row 2:

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

Multiply row 2 by 3 and add to row 3:

[ (1,4,-1,|,7), (0, 1, 0, |, 1), (0,0,2,|,-2) ]

Divide row 3 by 2:

[ (1,4,-1,|,7), (0, 1, 0, |, 1), (0,0,1,|,-1) ]

Add row 3 to row 1:

[ (1,4,0,|,6), (0, 1, 0, |, 1), (0,0,1,|,-1) ]

Multiply row 2 by -4 and add to row 1:

[ (1,0,0,|,2), (0, 1, 0, |, 1), (0,0,1,|,-1) ]

$x = 2 , y = 1 , z = - 1$