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

Jan 31, 2016

First, let's convert this to an augmented matrix form because I find it faster to write out.

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

Each number is a coefficient in the original system of equations, except for the last column, which contains the answers to the equalities.

I've done an answer already where I showed Gauss-Jordan elimination, but this time let's do Gaussian elimination, which we just perform elementary row operations until we get row echelon form instead of reduced-row echelon form. Essentially, it's fewer steps, but is still solvable (if and only if there is one solution).

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.)

The notation I will use is that the rightmost row in the step is the one operated upon.

Here we go!

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

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

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

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

Oh boy. Yeah, this has infinite solutions. Why? Because at this point, ${R}_{3} = {R}_{2} \times \text{scalar}$. In other words, we've got a free variable. Watch this:

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

We lost an equation, so we have three variables and two equations. Not good. When you turn this back to algebraic form, you get:

$x - y + z = - 1$
$y + z = 1$

If I attempt to solve this, I get:

$y = 1 - z$

$x - \left(1 - z\right) + z = - 1$

$x - 1 + 2 z = - 1$

$\textcolor{red}{z = - \frac{x}{2}}$

$\textcolor{red}{y = 1 + \frac{x}{2}}$

But $x$ could be anything. So this system has infinite solutions.