Gaussian elimination with an unknown constant How do I do Gaussian elimination on this system of equations?
$$
\begin{cases}
x_1+x_2+x_3=0\\
x_1+2x_2+ax_3=1\\
x_1+ax_2+2x_3=-1
\end{cases}
$$
When I try to do this I end up with a coefficient with an $a^2$ term which I'm assuming is not supposed to be there.
 A: From the first equation we get
$$x_1=-x_2-x_3$$ plugging this in equation two:
$$x_3(a-1)+x_2=1$$
and
$$x_2(a-1)+x_3=-1$$
with $$x_3=-1-x_2(a-1)$$
we obtain
$$x_2(1-a^2+2a-1)=a$$
Can you finish?
A: Write down the augmented coefficients matrix...and reduce:
$$\begin{pmatrix}1&1&1&0\\
1&2&a&1\\
1&a&2&\!-1\end{pmatrix}\longrightarrow\begin{pmatrix}1&1&1&0\\
0&1&a-1&1\\
0&a-1&1&\!-1\end{pmatrix}\longrightarrow$$$${}$$
$$\longrightarrow\begin{pmatrix}1&1&1&0\\
0&1&a-1&1\\
0&0&1-(a-1)^2&\!-1-(a-1)\end{pmatrix}$$
Now, observe that
$$1-(a-1)^2=0\iff a-1=\pm1\iff a=0,\,2$$
but
$$-1-(a-1)=0\iff (a-1)=-1\iff a=0\ldots$$
Thus, if $\;a=0\;$ the whole third rows gets cancelled and we get in fact a $\;2\times3\;$ system, whereas if $\;a=2\;$ we get a contradiction row and the system has no solution. Thus, for $\;a\neq0,\,2\;$  say, row 3 tells us
$$\left(1-(a-1)^2\right)x_3=-1-(a-1)\stackrel{a\neq0,2}\implies x_3=\frac{a^2-2a}{a}=a-2 \quad \ldots \, \text{and etc.}$$
A: You equation is 
$$ \left[
     \begin{array}{ccc|c}
1  & 1  & 1  &  0   \\  
1  & 2 & a  & 1   \\ 
1  & a  &  2 &  -1  \\
      \end{array}
\right]$$
By doing $R_2 - R_1 \to R_2$, $R_3 - R_1 \to R_3$ you get
$$ \left[
     \begin{array}{ccc|c}
1  & 1  & 1  &  0   \\  
0  & 1 & a-1  & 1   \\ 
0  & a-1  &  1 &  -1  \\
      \end{array}
\right]$$
Now, $R_3 - (a-1)R_2\to R_3$
$$ \left[
     \begin{array}{ccc|c}
1  & 1  & 1  &  0   \\  
0  & 1 & a-1  & 1   \\ 
0  & 0  &  1 - (a-1)^2 &  -1 -(a-1)  \\
      \end{array}
\right]$$
Simplify
$$ \left[
     \begin{array}{ccc|c}
1  & 1  & 1  &  0   \\  
0  & 1 & a-1  & 1   \\ 
0  & 0  &  -a^2 + 2a &  -a  \\
      \end{array}
\right]$$
Now can divide the last row by $-a$ (assuming $a\ne0$), that is, $-\frac1a R_3\to R_3$
$$\left[
     \begin{array}{ccc|c}
1  & 1  & 1  &  0   \\  
0  & 1 & a-1  & 1   \\ 
0  & 0  &  a - 2 &  1  \\
      \end{array}
\right]$$
I assume you can finish from here.
