Solutions to a linear system of equations. I want to find the solution of this system when the parameter $a \in R$ varies.
\begin{cases} (a+2)x_2 + x_4 = 1 \\ -x_1 +x_3  = a+1 \\ (a+1)x_1 + 2x_2 -x_3 = 0 \\ x_1 -2x_2 -(a+1)x_3 = -2 \end{cases} 
I notice that the matrix associated with the homogeneous system has rank $= 3$ for $a \ne 0,-2$ and never has $rank = 4$.
Now taking the matrix \begin{bmatrix} 0 & a+2 & 0 & 1 \\ -1 & 0 & 1 & a+1 \\
a+2 & 2 & -1 & 0 \\
0 & -2 & -a-1 & -2 \end{bmatrix}
this has rank $= 4 \quad \forall a \ne 3,2$
and taking \begin{bmatrix} 1 & a+2 & 0 & 1 \\ 0 & 0 & 1 & a+1 \\
0 & 2 & -1 & 0 \\
0 & -2 & -a-1 & -2 \end{bmatrix}
I get that this has rank $= 4 \quad \forall a \ne \frac{-2 + 2 \sqrt{11}}{4}, \frac{-2 - 2 \sqrt{11}}{4}$
So the original system has no solutions, correct?

Transforming the system of equations into an augmented matrix, we have:
$$\begin{bmatrix} 0 & (a+2) & 0 & 1 &|& 1 \\ -1 & 0 & 1 & 0 &|& (a+1) \\ (a+1) & 2 & -1 & 0 &|& 0 \\ 1 & -2 & -(a+1) & 0 &|& -2\end{bmatrix}$$
(note that the vertical lines between columns 4 and 5 seperate the sides of the equations). Row reduction (not all the way to the RREF form) yields:
$$\begin{bmatrix} 1 & 0 & -1 & 0 &|& -(a+1) \\ 0 & 1 & \frac{1}{2}a & 0 &|& -\frac{1}{2}(a-1) \\ 0 & 0 & a(a+2) & -2 &|& -a(a+1) \\ 0 & 0 & 0 & 0 &|& a(a+3) \end{bmatrix}$$
We can now see that the last row must have $0$'s on both sides of the vertical line (otherwise the system is inconsistent), which means $a(a+3)=0$ which gives $a=-3$ or $a=0$. The solution set for when $a$ equals either of those values can be easily determined by plugging-in the values for $a$ and row reducing further. 
Hopefully this helps.
