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.
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
Thus you can choose $$ x=\begin{bmatrix} 5 \\ 1 \\ 7 \\ -1 \end{bmatrix} $$