how to extend a basis This is a very elementary question but I can't find the answer in my book at the moment.
If I have, for example, two vectors $v_1$ and $v_2$ in $\mathbb R^5$ and knowing that they are linear independent , how can I extend this two vectors to a basis of $\mathbb R^5$. I  know that I just have to add $v_i$ for $3\leq i \leq 5$ such that they are linear independent but how can I do that? Is there an easy algorithm? 
 A: I usually do this in an ad hoc way depending on what vectors I already have. However, if you want an algorithm, you can exploit algorithms to reduce a spanning set to a basis (hopefully you know some of these).
In your example, expand your set of vectors to $v_1,v_2,e_1,e_2,e_3,e_4,e_5$, where $e_1,\dotsc,e_5$ are the standard basis vectors in $\mathbb{R}^5$. Then you can apply the sifting algorithm to this set to get a basis; because $v_1$ and $v_2$ are linearly independent and occur first in the list, they won't be removed in the sifting process, so you'll end up with some basis containing them. Essentially the same trick works for set of linearly independent vectors in a finite dimensional vector space.
A: Put your independent vectors in a list, which you then complete with a generating set for the whole space, as described in the answer by Matt Pressland (the standard basis is the most obvious choice for a generating set for $\Bbb R^n$). Now for each vector in the list in turn, see if the set of vectors in the list up to and including it is linearly dependent. If it is, keep the vector, if it isn't (then this vector must be a linear combination of the previous ones so) throw it out. In either case proceed to the next vector in the list. The test ensures that whenever one advances, the vectors retained so far are linearly independent. Also the vectors thrown out are ensured not to affect the span of the whole list, and since that span was the whole space at the beginning, it still is at the end. By linear dependence, one has found a basis. Since the vectors given initially were independent and at the beginning of the list, none of them can have been thrown out, so they survive in the basis.
A: A good general strategy for expanding a basis is to build a matrix $A$ out of the vectors you have and the standard basis vectors. Then, put $A$ into reduced row echelon form. If you toss out the dependent/free vectors, the remaining vectors are linearly independent and span. Therefore, they form a basis of your vector space.
A: An easy solution, if you are familiar with this, is the following:
Put the two vectors as rows in a $2 \times 5$ matrix $A$. Find a basis for the null space $\operatorname{Null}(A)$. Then, the three vectors in the basis complete your basis. 
A: Consider a finite dimensional vector space V. Let A be a finite subset of V that contains linearly independent vectors. If $span(A) \neq V$ then there exists a vector v $\in V$ so that all the elements in A and v are linearly independent. Since V is finite dimensional, you can repeat this process until you obtain a basis for the space V.
