Creating a basis for U Consider the subspace
$$
U=\text{span} \lbrace \left[\begin{array}{c}
1\cr
5\cr
0\cr
4
\end{array}\right], \left[\begin{array}{c}
5\cr
1\cr
7\cr
-1
\end{array}\right], \left[\begin{array}{c}
3\cr
7\cr
0\cr
12
\end{array}\right] \rbrace
$$
of $\mathbb{R}^4$. Create a basis 
$$
\lbrace \left[\begin{array}{c}
-1\cr
3\cr
-2\cr
2
\end{array}\right],\left[\begin{array}{c}
2\cr
2\cr
2\cr
2
\end{array}\right],x \rbrace
$$
for U.
$$
x =
\left[\Rule{0pt}{4.8em}{0pt}\right.
?
\left]\Rule{0pt}{4.8em}{0pt}\right.
$$
I have no clue where to start for this linear algebra problem. I know that the bases for U must be linear independent, however I do not know how to create the last basis of U to be this way. I think it has something to do with the third row since it has 0 zeroes in the spanning set. 
 A: We started from $$U=\operatorname{Span}\{u_1,u_2,u_3\}$$
and we want to find $x$ in $\{v_1, v_2, x\}$ such that it is a basis. Note that we can pick $x$ such that $v_1^Tx=0$ and $v_2^Tx=0.$
Since the rank of $U$ is $3$, there exists a non-zero vector $y$ such that $\forall u \in U, u^Ty=0.$
Hence from $v_1^Tx=0, v_2^Tx=0$ and $y^Tx=0$, we should be able to solve for a non-zero $x$.
A: Consider the matrix
$$
A=\begin{bmatrix}
-1 & 2 & 1 & 5 & 3 \\
3 & 2 & 5 & 1 & 7 \\
-2 & 2 & 0 & 7 & 0 \\
2 & 2 & 4 & -1 & 12
\end{bmatrix}
$$
Perform Gaussian elimination and consider the columns of $A$ corresponding to the pivot columns in the reduced form.
\begin{align}
\begin{bmatrix}
-1 & 2 & 1 & 5 & 3 \\
3 & 2 & 5 & 1 & 7 \\
-2 & 2 & 0 & 7 & 0 \\
2 & 2 & 4 & -1 & 12
\end{bmatrix}
&\to
\begin{bmatrix}
1 & -2 & -1 & -5 & -3 \\
0 & 8 & 8 & 16 & 16 \\
0 & -2 & -2 & -3 & 6 \\
0 & 6 & 6 & 9 & 18
\end{bmatrix}
&&\begin{aligned}
R_1&\gets -R_1\\
R_2&\gets R_2-3R_1\\
R_3&\gets R_3+2R_1\\
R_4&\gets R_4-2R_1
\end{aligned}
\\[6px]
&\to
\begin{bmatrix}
1 & -2 & -1 & -5 & -3 \\
0 & 1 & 1 & 2 & 2 \\
0 & 0 & 0 & 1 & 2 \\
0 & 0 & 0 & -3 & -6
\end{bmatrix}
&&\begin{aligned}
R_2&\gets \tfrac{1}{8}R_2\\
R_3&\gets R_3+2R_2\\
R_4&\gets R_4-6R_2
\end{aligned}
\\[6px]
&\to
\begin{bmatrix}
1 & -2 & -1 & -5 & -3 \\
0 & 1 & 1 & 2 & 2 \\
0 & 0 & 0 & 1 & 2 \\
0 & 0 & 0 & 0 & 0
\end{bmatrix}
&&R_4\gets R_4+3R_3
\end{align}
This shows


*

*The rank of the matrix is $3$, so indeed the two new vectors you're given belong to $U$

*The first, second and fourth columns of $A$ are linearly independent.


Thus you can choose
$$
x=\begin{bmatrix} 5 \\ 1 \\ 7 \\ -1 \end{bmatrix}
$$
