Finding a coefficient of a unknown to have a unique solution in a system I am resolving the following matrix:
 1  2 1|1
-1  4 3|2
 2 -2 a|3

Where I have to find all the values of $a$ so that the system can have a unique solution. Doing elementary row operations I ended up with:
1 2  1 |1
0 1 2/3|1/3
0 0 2+a|4

Where I see that $a$=2. Using this for back substitution: $z$=1, $y$=-1/3 and $x$=-2/3 The problem is that this values does not satisfy the system (last equation of the original matrix)
Can someone explain the right procedure to find all the values of $a$?
What I am doing wrong?
 A: There is a mistake in your Gaussian Elimination. The $1/3$ should be $1/2$.
Start with the original system. Add $r_1 + r_2$ to get $(0, 6, 4 \mid 3)$ in the second row. Divide by $6$ to get $(0, 1, 2/3 \mid 1/2)$.
And to double check: the solution is: $ z = 1, y = -1/6, x = 1/3$.

Wordy update: The system is consistent if there is no row in the reduced echelon form of the augmented system of the form $(0\ 0 \dots 0 \mid b)$. In this case, if $a \neq -2$ the system is consistent. A linear system has free variables, if there is a row in the reduced echelon form of the augmented system that looks like $(0\ 0\dots 0 \mid 0)$. So the system in hand has no free variables. A consistent system with no free variables has a unique solution. (and for the records, a consistent system with $1$ or more free variables has infinitely many solutions.)
Alternatively, and easily: a linear system $Ax = b \neq 0$ has a unique solution if the coefficient matrix $A$ is square and its determinant $\neq 0$. The determinant (up to multiplying by a factor $=6$ from the second row) can be easily read off from the reduced matrix, as the product of the pivots: $1\times 1\times (2+a) = 2+a$. Hence the system has a unique solution if $\det \neq 0 \iff a \neq -2$.
A: Simply compute the determinant of $\begin{pmatrix}1 & 2 &1 \\-1 & 4 &3\\2 & -2 & a\end{pmatrix}$, which is $6a+12$, so $a\in(-\infty,-2)\cup(-2,\infty)$
