Could anyone help me in solving this matrix?
$$\left[\begin{array}{ccc|c} k+2& k-1& k& 2\\ 0& k+2& 2& 0\\ 0& 0& k^2+k-2& k+2 \end{array}\right]$$
Find $k$ for which the system has:
a) exactly one solution
b) infinitely many solutions
c) no solutions
I am new in linear algebra and having trouble getting my head around this. I am particularly confused with part (b).
Let $$A = \begin{bmatrix} k+2 & k-1 & k\\ 0 & k+2 & 2\\ 0 & 0 & k^2 + k-2\end{bmatrix}$$ and $$[A \mid B] = \left[\begin{array}{ccc|c} k+2 & k-1 & k & 2\\ 0 & k+2 & 2 & 0\\ 0 & 0 & k^2 +k-2 & k+2\end{array}\right].$$
It is true that a system has a solution (not necessarily unique), iff: $$\boxed{\text{rank }A = \text{rank }[A\mid B]}\tag{1}.$$