# Use RREF to solve the linear systems of equations.

The following deals with finding all the solutions to a linear systems of equations using reduced row echelon form.

I have an augmented matrix, $[A| \vec b]$, defined as $[A| \vec b]:=\left[\begin{array}{rrr|r} 0 & 2 & 2 & 4 \\ 1 & 2 & 3 & 3 \\ 2 & 0 & 2 & -2 \\ \end{array}\right]$, where the first row is $x_1$, second one is $x_2$ and third one is $x_3$.

I used the reduced row echelon form to make it easier to solve the equation and I get $[A| \vec b]:=\left[\begin{array}{rrr|r} 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 \\ \end{array}\right]$.

Now I have $x_1+x_2=0 => x_1=-x_2 => s$, $x_2+x_3=0 => x_2=-x_3 => t$ and $x_3=-x_2=>u$ and the solution set is therefore $\begin{pmatrix}-s \\ -t \\ -u \end{pmatrix}$ but I'm not sure if the last part of the working out is correct.

For the RREF system you have determined, from the third equation we see that $x_3$ is free then

$$x_3=s \implies x_1=x_2=-s$$

therefore the solutions to that system should be

$$\begin{pmatrix}x_1 \\ x_2\\ x_3 \end{pmatrix}=s\begin{pmatrix}-1 \\ -1 \\ 1 \end{pmatrix}$$

Note anyway that your RREF seems wrong indeed

$$\left[\begin{array}{rrr|r} 0 & 2 & 2 & 4 \\ 1 & 2 & 3 & 3 \\ 2 & 0 & 2 & -2 \\ \end{array}\right]\to \left[\begin{array}{rrr|r} 2 & 0 & 2 & -2\\ 0 & 4 & 4 & 8 \\ 0 & 2 & 2 & 4 \\ \end{array}\right]\to \left[\begin{array}{rrr|r} 1 & 0 & 1 & -1\\ 0 & 1 & 1 & 2 \\ 0 & 0 & 0 & 0 \\ \end{array}\right]$$

from which we obtain

$$x_3=s \implies x_2=2-s \quad x_1=-1-s$$

therefore the solutions are

$$\begin{pmatrix}x_1 \\ x_2\\ x_3 \end{pmatrix}=\begin{pmatrix}-1 \\ 2 \\ 0 \end{pmatrix}+s\begin{pmatrix}-1 \\ -1 \\ 1 \end{pmatrix}$$