<s>[INST] 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.
 [/INST] 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.
</s>