\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question}

Solve the equations
\begin{eqnarray*} 2x +4y+5z & = & -3\\ 4x-y-7z & = & 6\\ 6x+3y-z & = &
3 \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} 2 & 4 & 5\\ 4 & -1 & -7\\ 6 & 3 &
-1 \end{array} \right| \begin{array}{c} -3\\ 6\\ 3 \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)$

So to get zeros in $r_3$ use elementary row operations:
$r_3-(r_2+r_1)$

$\begin{array}{ccc} \overline{r_1}\\ \overline{r_2}\\
\overline{r_3} \end{array} \left(\left.\begin{array}{ccc} 2 & 4 &
5\\ 4 & -1 & -7\\ 0 & 0 & 1 \end{array} \right| \begin{array}{c}
-3\\ 6\\ 0 \end{array} \right)$

To get zeros in $\overline{r_2}$, use elementary row operation
$\overline{r_2}-2\overline{r_1}$

$\begin{array}{ccc} \overline{\overline{r_1}}\\
\overline{\overline{r_2}}\\ \overline{\overline{r_3}} \end{array}
\left(\left.\begin{array}{ccc} 2 & 4 & 5\\ 0 & -9 & -17\\ 0 & 0 &
1 \end{array} \right| \begin{array}{c} -3\\ 12\\ 0 \end{array}
\right)$

This is upper triangular form. We could divide
$\overline{\overline{r_1}}$ by 2 and $\overline{\overline{r_2}}$
by -9 to get 1's, but it's not necessary to find solution.

Now use \un{back} substitution;

$$\left(\begin{array}{ccc} 2 & 4 & 5\\ 0 & -9 & -17\\ 0 & 0 & 1
\end{array} \right)\left(\begin{array}{c}x\\y\\z
\end{array}\right)=\left(\begin{array}{c} -3 \\ 12 \\ 0 \end{array}
\right)$$

$\overline{\overline{r_3}} \Rightarrow z=0$

hence in $\overline{\overline{r_2}}$

$-9y-17z=12 \Rightarrow -9y=12 \Rightarrow y=-\ds\frac{4}{3}$

\newpage
hence in $\overline{\overline{r_1}}$

\begin{eqnarray*} 2x+4y+5z=-3 & \Rightarrow &
2x+4\left(-\ds\frac{4}{3}\right)+5(0)=-3\\ & \Rightarrow &
2x=\ds\frac{16}{3}-3=\ds\frac{7}{3}\\ & \Rightarrow &
x=\ds\frac{7}{6} \end{eqnarray*}

So the solution is:

$$x=\ds\frac{7}{6},\ y=-\ds\frac{4}{3},\ z=0$$

\end{document}
