Value of $h$ in a vector to make that vector a linear combination of the span of two vectors 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.
 A: 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}$$
A: The tree vectors are linearly independent if
$$
\det
\left[
\begin{array}{cccc}
1& -5&3\\
3&-8&-5\\
-1&2&h
\end{array}
\right] =0
$$
I.E.
$$
\left|
\begin{array}{cccc}
-8&-5\\
2&h
\end{array}
\right |
+5
\left|
\begin{array}{cccc}
3&-5\\
-1&h
\end{array}
\right |
+3
\left|
\begin{array}{cccc}
3&-8\\
-1&2
\end{array}
\right |
=0
$$
that give $7h=21 \Rightarrow h=3$
A: $3R_1-R_2$ (Manipulation of the 2nd row) leads to the following new 2nd row: $(0,7,-14)$ (there was a mistake in the signs). $R_1+R_3$ is done right.
A: b can be expressed as $\vec{b} = P\vec{a_1} + Q\vec{a_2}$
\begin{align}
P-5Q &= 3 \\
3P-8Q &= -5
\end{align}
solve this system of equations (using whatever method you prefer)
\begin{align}
P &= -7 \\
Q &= -2
\end{align}
so $h = -P+2Q = 3$
