<s>[INST] Solve the system for the given parameter a \begin{align}
ax+y+z&=1,\\
2x+2ay+2z&=3\\
x+y+az&=1
\end{align}
I tried forming the system matrix and discuss it using its rank, but I'm not sure how to row reduce:
$$\begin{pmatrix}a&1&1&1\\ 2&2a&2&3\\ 1&1&a&1\end{pmatrix}$$
 [/INST] Consider the matrix $$A=\begin{pmatrix}
a&1&1\\2&2a&2\\1&1&a
\end{pmatrix}.$$ We have that $\det(A)=2(a-1)^2(a+2)$. Hence if $a\neq 1$ and $a\neq -2$, then $A$ is invertible and the solution of the system of equations is $A^{-1}b$, where $b=\begin{pmatrix}1\\3\\1
\end{pmatrix}$.
If $a=1$, then the system of equations is false, hence there are no solutions. If $a=-2$, then again the system of equations has no solutions.
</s>