[Math] How to choose a free variable

gaussian eliminationlinear algebra

I have a question regarding the Gaussian method for solving linear equations. I had to solve 2 equations with 3 unknowns and naturally with the elimination process I had 2 variables left. I thought that it didn't matter which variable I chose as a free variable, but apparently after inputting random values after choosing the last variable as the free one, the values didn't match. So is there any method of how to choose a free variable?
\begin{cases}
& 4x_{1} + 2x_{2} + 3x_{3} = -2 \\
& 2x_{1} + 8x_{2} – x_{3} = -10
\end{cases}

\begin{pmatrix}
4 & 2 & 3 & | & -2 \\
2 & 8 & -1 & | & -10
\end{pmatrix}

\begin{pmatrix}
2 & 8 & -1 & | & -10 \\
4 & 2 & 3 & | & -2
\end{pmatrix}

\begin{pmatrix}
2 & 8 & -1 & | & -10 \\
0 & -14 & 5 & | & 18
\end{pmatrix}

$$
-14x_{2} + 5x_{3} = 18
$$

$$
x_{3} = C
$$

$$
x_2 = \frac{18-5C}{-14}
$$

$$
4x_1 = -2 -3C – 2*\frac{18-5C}{-14}
$$

$$
4x_1 = -2 -3C – \frac{18-5C}{-7}
$$

$$
x_1 = \frac{-14-21C-18+5C}{28}
$$

$$
x_1 = \frac{-16C-32}{28} = \frac{-8C-16}{14}
$$

this is what I did, but using x3 as a free variable was not a correct choice, because after inputting a random value, the first equation didn't equal to -2. so I want to find out why do I necessarily have to choose x2 instead of x3.

Best Answer

You did it correctly. You just made a little arithmetic mistake near the end. You got to here $$4x_1 = -2 -3C - \frac{18-5C}{-7}$$ correctly but the line beneath that is not correct. It should actually be $$x_1 = \frac{-14-21C+18-5C}{28}$$ So just be careful of your signs, and keep doing what you're doing because other than that mistake everything else you wrote is correct.

You can verify for yourself that this expression for $x_1$, along with what you gave for $x_2$ and $x_3$, solve both of your equations.

Related Question