Planes and Augmented Matrices I seem to be having trouble with solving the following system of equations so that an infinite number of solutions would arise. The question is "Find the values of $p$ and $q$ for which the following system of equations has an infinite number of solutions and clearly explain my reasoning:"
$$2x+y+z=5, x-y+z=3, -2x+py+2z=q$$
What I've managed to do is convert it as an augmented matrix and tried to solve from there:
$$\left[\begin{array}{rrr|r} 2 & 1 & 1 & 5\\ 1 & -1 & 1 & 3 \\ -2 & p & 2 & q\end{array}\right]$$
However, when I tried to solve the augmented matrix, I ended up with a solution that has $p$ on both sides in the third row. The answer in my textbook says that: "$t(p+10)=q+2$ has infinitely many solutions for $t$ when $p+10=0$ and $q+2=0, {\therefore}{p=-10, q=-2}$."
I can't seem to find that solution, no matter what I tried, so any help with the matrix to reach that solution would be greatly appreciated!!

Begin with the augmented matrix 
$$
\left(
\begin{array}{ccc|c} 2 & 1 & 1 & 5\\ 1 & -1 & 1 & 3 \\ -2 & p & 2 & q\end{array}
\right)
$$
and row reduce this by 


*

*multiplying the first row by $-1/2$ and adding it to the second row, and 

*adding the first row to the last row 


to get:
$$
\left(
\begin{array}{ccc|c} 2 & 1 & 1 & 5\\ 0 & -\frac{3}{2} & \frac{1}{2} & \frac{1}{2} \\ 0 & p+1 & 3 & 5+q\end{array}
\right). 
$$
Then multiply the second row by $-2/3$ to get: 
$$
\left(
\begin{array}{ccc|c} 2 & 1 & 1 & 5\\ 0 & 1 & -\frac{1}{3} & -\frac{1}{3} \\ 0 & p+1 & 3 & 5+q\end{array}
\right). 
$$
Next, 


*

*multiply the second row by $-1$ and add it to get first row, and 

*multiply the second row by $-(p+1)$ and add it to the third row: 


$$
\left(
\begin{array}{ccc|c} 2 & 0 & \frac{4}{3} & \frac{16}{3}\\ 0 & 1 & -\frac{1}{3} & -\frac{1}{3} \\ 0 & 0 & 3+\frac{p+1}{3} & 5+q+\frac{p+1}{3} \end{array}
\right). 
$$
The equation corresponding to the last row in the augmented matrix is 
$$\left(3+\frac{p+1}{3}\right)z= 5+q+\frac{p+1}{3}.$$ 
Multiply both sides by three to obtain: 
$$
(p+10)z = 15+3q+p+1,  
$$
which is 
$$
(p+10)z = p+3q+16. 
$$
So what we want to do is find $p$ and $q$ so that $p+10=0$ and $p+3q+16=0$. This would mean that the system of equations will have an infinite number of solutions. 
So $p=-10$ and $q=-2$.
