[Math] Value of $h$ in a vector to make that vector a linear combination of the span of two vectors

linear algebramatrices

I have a question that gives two vectors and a third vector with a variable and it asks what the variable must be so that the vector is a linear combination of the span of the other two vectors. e.g.:

Let $\ a_1=\left[ \begin{array}{}
\ \ \ 1 \\
\ \ \ 3 \\
-1 \end{array} \right]
$, $a_2 = \left[ \begin{array}{}
-5 \\
-8 \\\ \ 2\end{array} \right]$
and $b = \left[ \begin{array}{}
\ \ \ 3 \\
-5 \\\ \ h\end{array} \right]$

From my understanding of what we've done so far, to say $b$ is a linear combination of $a_1$ and $a_2$ means that the augmented matrix $\left[ \begin{array}{}
\ \ \ 1 & -5 & \ \ \ 3\\
\ \ \ 3 & -8 & -5\\
-1 & \ \ \ 2 & \ \ \ h\end{array} \right]$ has a solution.

So I started doing row operations to put it in Echelon form:

$3R_1-R_2$ followed by $R_1 + R_3$ produces:

$\left[ \begin{array}{}
\ \ \ 1 & -5 & \ \ \ \ \ 3\\
\ \ \ 0 & -7 &\ \ \ 14\\
\ \ \ 0 & -3 & (3 + h)\end{array} \right]$

So I thought that to make sure this matrix has to have a solution, the last row has to equal $3+h$ so I said $-3 = 3+h$ meaning $h = -6$ but the answer in my book says $h = 3$. Can anyone tell me what I'm doing wrong?

Also as a bonus, can anyone look at my LaTex code and see if there is an easier way to make matrix columns line up? I'm just using escaped spaces which is tedious. Is there a command? Thanks.

Best Answer

As you put it you should have made column operations. I propose to change the matrix and still make row operations:

$$\begin{pmatrix}1&3&\!\!-1\\ \!\!-5&\!\!-8&2\\3&\!\!-5&h\end{pmatrix}\rightarrow\begin{pmatrix}1&3&\!\!-1\\ 0&7&\!\!-3\\0&\!\!-14&h+3\end{pmatrix}\stackrel{R_3+2R_2}\rightarrow\begin{pmatrix}1&3&\!\!-1\\ 0&7&\!\!-3\\0&0&h-3\end{pmatrix}$$