<s>[INST] For which $a$ does this system have one solution, infinite solutions, or no solution? Consider the system of linear equations:

\begin{cases} x+y+az=1 \\ x+ay+z=1 \\ ax+y+z=1 \end{cases}
For which $a$ does the system have: 


*

*no solution 

*one solution 

*an infinite number of solutions?


So first I reduced the matrix to echelon form

\begin{pmatrix}{cc|cc}
1&1&a&1\\1&a&1&1\\a&1&1&1\end{pmatrix} 
and after raw operations got to 
\begin{pmatrix}{cc|c}
1&1&a&1\\0&a-1&1-a&0\\0&0&-a^2-a+2&1-a\end{pmatrix} 
Therefore $-a^2-a+2=1-a$ so when $a=1, a=-1$ there are infinitely many solutions, but when is there one solution? 
 [/INST] If $a = 1$, the system reduces to $x + y + z = 1$, and it has more unknowns than equation, hence infinite solutions. If $a \neq 1$, then subtract the second from the first equation:
$(a-1)(z-y) = 0$. So: $z-y = 0$, and $y = z$. Similarly subtract the third from the second equation: $(a-1)(y-x) = 0$. So $y - x  = 0$, and $x = y$. Thus: $x = y = z$, and $x + x + ax = 1$. So: $(a+2)x = 1$. So if $a = -2$, system has no solutions, and if $a \neq -2$, it has unique solution: $x = y = z = \dfrac{1}{a+2}$
</s>