TITLE: Methodical way to form a basis
QUESTION [5 upvotes]: If I have a basis $(3,1,0,0,0),(0,0,7,1,0),(0,0,0,0,1)$ for a subspace of $\mathbb{R}^{5}$ and want to extend this collection of vectors to a basis for $\mathbb{R}^{5}$ is there any methodical, or algorithmic way to do this besides logically picking two linearly independent vectors to extend the set to a basis?

REPLY [4 votes]: The standard way is to form a matrix with these vectors as columns, which has column space equal to $\mathbb{R}^{5}$:
$$\begin{bmatrix} 
3&0&0&1&0&0&0&0 \\
1&0&0&0&1&0&0&0 \\
0&7&0&0&0&1&0&0 \\
0&1&0&0&0&0&1&0 \\
0&0&1&0&0&0&0&1
\end{bmatrix}$$
Now you want to follow the method to get a basis for the column space: Figure out which are the pivot columns, and use those as a basis for $\mathbb{R}^{5}$ (note that with this setup, since your original three vectors were linearly independent, they will be pivot columns and so used as the first three vectors of the basis).