If I've got three equations:
$$\begin{array}{ccccccc} x & + & y & + & z & = 3 \\ 2x & + & ay & - & 2z & = 4 \\ x & + & 2y & - & az & = 1 \end{array}$$
How do I solve them using Gaussian elimination. I get to this point:
$$\begin{array}{ccccccc} x & + & y & + & z & = 3 \\ & & y & - & (a+1)z & = -2 \\ & & (a-2)y & - & 4z & = -2 \end{array}$$
but I don't know where to go from here. I'd try to multiply the second by $-(a-2)$ and add it to the third but it doesn't seem to work out well. My textbook says that the next step should look like:
$$\begin{array}{ccccccc} x & + & y & + & z & = 3 \\ & & y & - & (a+1)z & = -2 \\ & & & & (a+2)(a-3)z & = 2(a-3) \end{array}$$
How do I get to that?
I will use the convention $pR_i+R_j$ to mean that you multiply row $i$ by $p$ and then add it to the row $j$.
Assuming that your coefficient matrix is $A$ and the right side vector is $b$. You do the following row operations
$$[A|b] \rightarrow(-2R_1+R_2) \rightarrow(-1R_1+R_3) \rightarrow(\text{swap} R_2 \text{with} R_3) \rightarrow(-(a-2)R_2+R_3).$$
This should lead you to the correct matrix.