Extension of basis over PID Let $k[x] = R$ be ring and $L$ be free $k[x]$-module; let $v \in L$ be vector in $L$. Then how one can extend it to an $R$-basis for $L$?
 A: This is not always possible.  Consider $L=k[X] \oplus k[X]$ with $v= X \oplus X$. 

Given a PID $R$ and a vector $v = \sum_{i=1} ^n v_ie_i \in \bigoplus_{1\leq i \leq n } R$ a necessary condition for it to be extendable to a basis is $ \exists r_i \in R$ such that $$ \sum_{i=1} ^n r_iv_i =1.$$

Now assume $v$ satisfies this condition. 
Look at the short exact sequence 
$$ 0 \rightarrow K\rightarrow  \bigoplus_{i=1} ^n R \rightarrow  R \rightarrow 0$$ 
where $K$ is the kernel of the right map $$ l :\bigoplus _{i=1} ^n R \rightarrow R$$
$$ \sum _{i=1} ^n a_ie_i \mapsto \sum_{i=1} ^n a_i r_i $$
Consider $$k: R \rightarrow \bigoplus _{i=1} ^n R$$
$$ 1 \mapsto v$$
Then $k$ gives a right splitting of the exact sequence and hence we have $$\bigoplus _{i=1} ^n R= \operatorname{Im}k \bigoplus K.$$
$K$ is free of rank $n-1$ and $\operatorname{Im}k = \operatorname{Span} v$.
Thus $v$ can be extended to a basis.
If you have 
$$\left<v_1,v_2,...,v_n\right>=\left<d\right>$$ then $\exists r_i \in R$ such that $\sum _i r_iv_i=d$.  Thus you get $$ \sum_{i=1}^n r_i \frac{v_i}{d} = 1$$
So $v/d$ can be extended to a basis.
