[Math] Solving a linear equation system with 3 equations and 5 unknowns

gaussian eliminationlinear algebra

I'm trying to solve this system with 3 equations and 5 unknowns:
$$\left\{\matrix{x_1+x_2-2x_3+x_4+3x_5=1\\2x_1-x_2+2x_3+2x_4+6x_5=2\\3x_1+2x_2-4x_3-3x_4-9x_5=3}\right.$$
using Gaussian elimination, and I'm very close to getting the right answer. According to my book, the answer should be:
$$x=\left(\matrix{1\\0\\0\\0\\0}\right) + s \left(\matrix{0\\2\\1\\0\\0}\right) + t \left(\matrix{0\\0\\0\\-3\\1}\right),\ s,t\in\mathbb{R}$$
I also want to avoid getting fractal scalars when reducing the system to row-echelon form, such that leading coefficients e.g. 2 and 3 in row2 and row3 are reduced with $2\over3$ or $3\over2$.

Best Answer

With Gaussian elimination, I reduced the system in row-echelon form: $$\left(\matrix{1&1&-2&1&3\\2&-1&2&2&6\\3&2&-4&-3&-9}\middle|\matrix{1\\2\\3}\right)\sim\matrix{r_2-2r_1\\r_3-3r_1}\sim r_3-{r_2\over3}\sim\matrix{r_2/3\\r_3/6}\sim\left(\matrix{1&1&-2&1&3\\0&-1&2&0&0\\0&0&0&-1&-3}\middle|\matrix{1\\0\\0}\right)$$ Then I converted it to a linear equation system and isolate the leading coefficients $x_1$, $x_2$ and $x_4$: $$\left\{\matrix{x_1+x_2-2x_3+x_4+3x_5=1\\-x_2+2x_3=0\\-x_4-3x_5=0}\right.\leftrightarrow\left\{\matrix{x_1=1-x_2+2x_3-x_4-3x_5\\x_2=2x_3\\x_4=-3x_5}\right.$$ Thus, I define the remaining coefficients: $$\matrix{x_3=s\\x_5=t}\ \ s,t\in\mathbb{R}$$ Finally, I get: $$\left\{\matrix{x_1=1\\x_2=2s\\x_3=s\\x_4=-3t\\x_5=t}\right.$$

Related Question