Smooth Orthonormal system Let $(e_i(x))$ be an orthonormal basis in a finite dimensional space $\mathbb R^n$ such that all maps
$$(-2\varepsilon,2\varepsilon) \ni x \mapsto e_i(x)$$
are $C^{\infty}$. I would like to know whether there does necessarily exist an extension of the map 
$$(-\varepsilon,\varepsilon) \ni x \mapsto e_i(x)$$ to all of $\mathbb R$ such that $x \mapsto e_i(x)$ is smooth and $(e_i(x))$ for an orthonormal basis?
See for a previous question of mine that is related to this one:
Extend orthonormal system
Please let me know if you have any questions.
 A: Let's use the smooth step function
$$g(x)=0,\quad x\leq0$$
$$g(x)=\frac{1}{1+\exp\left(\frac1x-\frac1{1-x}\right)},\quad0<x<1$$
$$g(x)=1,\quad1\leq x$$
and some $\kappa>\varepsilon$ to construct a set of vector functions (not necessarily independent)
$$f_i(x)=e_i(x),\quad0\leq x\leq\varepsilon$$
$$f_i(x)=g(\tfrac{\kappa-x}{\kappa-\varepsilon})e_i(x)+g(\tfrac{x-\varepsilon}{\kappa-\varepsilon})e_i(\kappa),\quad\varepsilon<x<\kappa$$
$$f_i(x)=e_i(\kappa),\quad\kappa\leq x.$$
The step function has all derivatives $g^{(n)}(0)=g^{(n)}(1)=0$ at the endpoints, so the $f_i$ are smooth.
Since $f_i(\varepsilon)=e_i(\varepsilon)$ are independent (which can be rephrased as $\det[f_i(\varepsilon)]\neq0$, or as $f_1(\varepsilon)\wedge f_2(\varepsilon)\wedge\cdots\wedge f_n(\varepsilon)\neq0$), and the $f_i$ are also continuous functions of $\kappa$, there must exist some $\kappa$ such that $f_i(x)$ are independent on the interval $\varepsilon<x<\kappa$. (I'm not quite sure about this part.)
Now we can apply the Gram-Schmidt process:
$$\overline f_1(x)=f_1(x)$$
$$\overline f_2(x)=f_2(x)-\frac{f_2(x)\cdot f_1(x)}{f_1(x)\cdot f_1(x)}f_1(x)$$
$$\overline f_3(x)=f_3(x)-\frac{f_3(x)\cdot f_1(x)}{f_1(x)\cdot f_1(x)}f_1(x)-\frac{f_3(x)\cdot f_2(x)}{f_2(x)\cdot f_2(x)}f_2(x)$$
$$\vdots$$
$$\hat f_i(x)=\frac{\overline f_i(x)}{\sqrt{\overline f_i(x)\cdot\overline f_i(x)}}$$
The dot product is a smooth function, and division and square roots are smooth at non-zero inputs, so $\hat f_i$ are smooth and orthonormal.
Apply a similar construction for negative $x$.
