\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question}

Solve the equations
\begin{eqnarray*} 3x+2y-z & = & 4\\ 2x-5y+2z & = & 1\\ 5x+16y-7z & = &
10 \end{eqnarray*}

by Gaussian elimination.

\medskip

{\bf Answer}

Augmented matrix is

$\begin{array}{ccc} r_1\\ r_2\\ r_3 \end{array}
\left(\left.\begin{array}{ccc} 3 & 2 & -1\\ 2 & -5 & 2\\ 5 & 16 &
-7 \end{array} \right| \begin{array}{c} 4\\ 1\\ 10 \end{array}
\right)$

Want to get this in the upper echelon form

$\left(\left.\begin{array}{ccc} a & . & .\\ 0 & b & .\\ 0 & 0 & c
\end{array} \right| \begin{array}{c} .\\ .\\ . \end{array}
\right)$

Carry out elementary row operations:
$\overline{r_3}=r_3-(r_1+r_2)$

$\begin{array}{ccc} \overline{r_1}\\ \overline{r_2}\\
\overline{r_3} \end{array} \left(\left.\begin{array}{ccc} 3 & 2 &
-1\\ 2 & -5 & 2\\ 0 & 19 & -8 \end{array} \right| \begin{array}{c}
4\\ 1\\ 5 \end{array} \right)$

$\overline{\overline{r_2}}=3\overline{r_2}$

$\begin{array}{ccc} \overline{\overline{r_1}}\\
\overline{\overline{r_2}}\\ \overline{\overline{r_3}} \end{array}
\left(\left.\begin{array}{ccc} 3 & 2 & -1\\ 6 & -15 & 6\\ 0 & 19 &
-8 \end{array} \right| \begin{array}{c} 4\\ 3\\ 5 \end{array}
\right)$

$\overline{\overline{\overline{r_2}}}=\overline{\overline{r_2}}-
2\overline{\overline{r_1}}$

$\begin{array}{ccc} \overline{\overline{\overline{r_1}}}\\
\overline{\overline{\overline{r_2}}}\\
\overline{\overline{\overline{r_3}}}
\end{array} \left(\left.\begin{array}{ccc} 3 & 2 & -1\\ 0 & -19 &
8\\ 0 & 19 & -8 \end{array} \right| \begin{array}{c} 4\\ -5\\ 5
\end{array} \right)$

$r_3^{(iv)}=\overline{\overline{\overline{r_2}}}+\overline{\overline{\overline{r_3}}}$

$\begin{array}{ccc} {r_1}^{(iv)}\\{r_2}^{(iv)}\\{r_3}^{(iv)}
\end{array} \left(\left.\begin{array}{ccc} 3 & 2 & -1\\ 0 & -19 &
8\\ 0 & 0 & 0 \end{array} \right| \begin{array}{c} 4\\ -5\\ 0
\end{array} \right)$

We are in \un{trouble}! The third row has vanished, and hence the
third equation is a linear combination of the other two. It is
linearly dependent and thus gives no further information. (This
could have been spotted originally by considering

$det \left(\begin{array}{ccc} 3 & 2 & -1\\ 2 & -5 & 2\\ 5 & 16 &
-7 \end{array} \right)=9+48-57=0$.

Hence no inverse exists)

We thus have a rank 2 system (only 2 equations in 3 unknowns).

To solve the system we assign $z$ arbitrarily, say $z=\lambda$ and
then solve

\begin{eqnarray*} 3x+2y-\lambda & = & 4\ \ \ (1)\\ -19y+8\lambda &
= & -5 \end{eqnarray*}

$(2) \Rightarrow y=\ds\frac{8\lambda+5}{19}$

Therefore in $(1)$
$3x+\ds\frac{16\lambda}{19}+\ds\frac{10}{19}-\lambda=4$

$$x=\ds\frac{(22+\lambda)}{19}$$

\un{or} $19x-22=\ds\frac{19y-5}{8}=z$ a line in 3-D. Here we have
case 3.
\end{document}
