# How do you solve x - y + 4z = 6, 2x + z = 1 and x + 5y + z = -9 using matrices?

Mar 25, 2017

There are several ways to do it, using matrices. I prefer the use of an augmented matrix

#### Explanation:

The first equation, $x - y + 4 z = 6$, makes the following row in the augmented matrix:

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

The second equation, $2 x + z = 1$, makes the following row in the augmented matrix:

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

The third equation, $x + 5 y + z = - 9$, makes the following row in the augmented matrix:

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

Now, perform elementary row operations until, you obtain an identity matrix on the left.

${R}_{2} - 2 {R}_{1} \to {R}_{2}$

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

${R}_{3} - {R}_{1} \to {R}_{3}$

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

${R}_{3} - 3 {R}_{2} \to {R}_{3}$

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

${R}_{3} / 18$

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

${R}_{2} + 7 {R}_{3} \to {R}_{2}$

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

${R}_{1} - 4 {R}_{2} \to {R}_{1}$

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

${R}_{2} / 2$

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

${R}_{1} + {R}_{2} \to {R}_{1}$

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

We have an identity matrix on the left, therefore, the solution set is on the right:

$x = 0 , y = - 2 , \mathmr{and} z = 1$

Check:

$x - y + 4 z = 6$
$2 x + z = 1$
$x + 5 y + z = - 9$

$0 - - 2 + 4 \left(1\right) = 6$
$2 \left(0\right) + 1 = 1$
$0 + 5 \left(- 2\right) + 1 = - 9$

$6 = 6$
$1 = 1$
$- 9 = - 9$

This checks.