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

Jan 29, 2016

First, let's put this into an augmented matrix, where the last column contains the answers to the system represented by the left columns.

$\left[\begin{matrix}2 & - 1 & - 1 & | & 9 \\ 3 & 2 & 1 & | & 17 \\ 1 & 2 & 2 & | & 7\end{matrix}\right]$

Now, let's go for Gauss-Jordan elimination, since that covers both row echelon and reduced-row echelon forms.

The goal for row echelon form is to get the first nonzero entry in each row to be a $1$ and entries below each $1$ to be $0$, while any zeroed row is at the bottom, and the leading $1$ in each successive row is at least one column to the right of the leading $1$ in the preceding row.

For reduced-row echelon form, go further and achieve $0$'s above and below all leading $1$'s.

We can use elementary row operations to achieve this. Common ones are:

• Scaling a row
• Swapping two rows
• Adding/subtracting two rows, even if one row is scaled as well

I will use the notation where the rightmost indicated row is where the operation occurs.

$\stackrel{- {R}_{3} + {R}_{1} \text{ }}{\to} \left[\begin{matrix}1 & - 3 & - 3 & | & 2 \\ 3 & 2 & 1 & | & 17 \\ 1 & 2 & 2 & | & 7\end{matrix}\right]$

$\stackrel{- 3 {R}_{3} + {R}_{2} \text{ }}{\to} \left[\begin{matrix}1 & - 3 & - 3 & | & 2 \\ 0 & - 4 & - 5 & | & - 4 \\ 1 & 2 & 2 & | & 7\end{matrix}\right]$

$\stackrel{- {R}_{1} + {R}_{3} \text{ }}{\to} \left[\begin{matrix}1 & - 3 & - 3 & | & 2 \\ 0 & - 4 & - 5 & | & - 4 \\ 0 & 5 & 5 & | & 5\end{matrix}\right]$

$\stackrel{{R}_{3} + {R}_{2} \text{ }}{\to} \left[\begin{matrix}1 & - 3 & - 3 & | & 2 \\ 0 & 1 & 0 & | & 1 \\ 0 & 5 & 5 & | & 5\end{matrix}\right]$

$\stackrel{\frac{1}{5} {R}_{3} \text{ }}{\to} \left[\begin{matrix}1 & - 3 & - 3 & | & 2 \\ 0 & 1 & 0 & | & 1 \\ 0 & 1 & 1 & | & 1\end{matrix}\right]$

$\stackrel{- {R}_{2} + {R}_{3} \text{ }}{\to} \left[\begin{matrix}1 & - 3 & - 3 & | & 2 \\ 0 & 1 & 0 & | & 1 \\ 0 & 0 & 1 & | & 0\end{matrix}\right]$

stackrel(3R_3 + R_1; 3R_2 + R_1" ")(->)color(green)([(1,0,0,|,5),(0,1,0,|,1),(0,0,1,|,0)])

At this point, we can reconstruct the system of equations to get:

$\textcolor{b l u e}{\left(x , y , z\right) = \left(5 , 1 , 0\right)}$

If we check with the original equations, we get:

$2 \left(5\right) - 1 \left(1\right) - 1 \left(0\right) = 9$
$3 \left(5\right) + 2 \left(1\right) + 1 \left(0\right) = 17$
$1 \left(5\right) + 2 \left(1\right) + 2 \left(0\right) = 7$