Choosing two variables which determine whether a Ax= b has infinite, unique or no solutions. I've been given a problem regarding the solution set of a matrix:
    Let A = 1  2 -5         1
           -1  3  0 ,   b = 0
            1 -2  k         h

Find the value(s) of k and h such that the matrix equation Ax = b has
(a) a unique solution
(b) infinitely many solutions
(c) no solutions.
I've made some attempts at this however I find myself stumped. One of my attempts went as follows:
(1)             1  2 -5  |1  R1<= R1+ R2
               -1  3  0  |0
                1 -2  k  |h
(2)             0  5 -5  |1
               -1  3  0  |0
                1 -2  k  |h R3<= R3 + R2
(3)             0  5 -5  |1  R1<=>R2
               -1  3  0  |0
                0  1  k  |h
(4)            -1  3  0  |0
                0  5 -5  |1 R2<=>R3
                0  1  k  |h
(5)            -1  3  0  |0
                0  1  k  |h
                0  5 -5  |1 R3<= R3 - 5*R2
(6)            -1  3  0        |0
                0  1  k        |h
                0  0 -5-(5*k)  |1 -5*h
And so thus far I've been trying to find a unique solution using multiples of 5( I'm trying to find the unkown "x1" or rather "z") but It's just headache inducing at the moment. 
I can easily pick -1 for k to make x1(or z) 0 and just any arbitary number for h in order to make the matrix have no solution, but determining a value for k and h to find infinitely many solutions and a unique solution escapes me.
Any help would be much appreciated.
 A: Hints: Here is one approach, but you should try this with Gaussian Elimination on the $3x3$.
Notice that the second row gives $x = 3y$, so we can eliminate this row, rewrite the system as a $2x2$ by substituting that into rows $1$ and $3$ of the original system as: 
$$5y - 5z = 1 \\ 1 y + k  z = h$$
Some observations:


*

*The determinant of the $2x2$ is $5(1+k)$. What is the determinant not supposed to be for solutions to exist?

*What happens to this system if you make $k = -1, h = t \ne \dfrac{1}{5}$? In other words, $h = t$ is almost a free variable and can be anything. Just look at the rows of the $2x2$. (No solutions)

*What happens if $k = -1, h = \dfrac{1}{5}$? (Infinite solutions)

*Can you continue with this system and find a unique solution from the two previous statements? If not, try it with Cramer's Rule, Gaussian Elimination or whatever methods you have learned.

A: Let's start by forming the augmented matrix $[A|b]$ and doing elementary row operations to get the $A$ part into row echelon form. 
$$\left[\begin{array}{ccc|c}1&2&-5&1\\-1&3&0&0\\1&-2&k&h\end{array}\right] \Rightarrow_{1} \left[\begin{array}{ccc|c}1&2&-5&1\\0&5&-5&1\\0&-4&k+5&h-1\end{array}\right] \Rightarrow_{2} \left[\begin{array}{ccc|c}1&2&-5&1\\0&5&-5&1\\0&0&k+1&h-\frac{1}{5}\end{array}\right]$$
where step 1 is:
$$\mathrm{R}_2 \leftarrow \mathrm{R}_2 + \mathrm{R}_1 \\ \mathrm{R}_3 \leftarrow \mathrm{R}_3 - \mathrm{R}_1$$
and step 2 is:
$$\mathrm{R}_3 \leftarrow \mathrm{R}_3 + \frac{4}{5}\mathrm{R}_2 $$
The last row on the right is the key the whole problem. Notice that when we do back substitution, the last row represents the equation...
$$(k+1)x_3 = h- \frac{1}{5}$$
Now, if $k \ne -1$, then, the the matrix $A$ has full rank and the system $Ax = b$ has a unique solution for any value of $h$. Things get interesting when $(k +1) = 0$. If $k = -1$, then the equation in the last row becomes: $$0\cdot x_3 = h- \frac{1}{5}$$ and in this case, if $h$ is such that we get $0 \ne0$ (ie, $h \ne \frac{1}{5}$), the system is inconsistent - there is no solution. If however, $h = \frac{1}{5}$ then we're left with $0 = 0$ in that last row and the system has infinitely many solutions. 
