I came across the following "mathematical difficulty" while I was studying physics and non-inertial reference frames. Therefore, I'm interested in the case $n=3$, but I think I can formulate the problem in a slight more general context.
Suppose you have a particle (or point) with position vector $\textbf{x}(t)=\sum_{i=1}^n x_i(t) \textbf{e}_i$ with respect to a reference frame (here $\textbf{e}_i$ is supposed to be the $i$th coordinate vector of an orthonormal basis) which can move only in one direction and that cannot change is versus (this means that the particle moves along a straight line with unit vector $\textbf{x}/\lvert \textbf{x}\rvert$). At time $t$, its velocity vector is $\frac{d}{dt}\textbf{x}(t)$. It seems there are two basic possibilities to express this quantity:
(1) The first one is (the vectors of the orthonormal basis being independent of $t$) $$\frac{d}{dt}\textbf{x}(t)=\sum_{i=1}^n \frac{d}{dt}x_i(t) \textbf{e}_i;$$
(2) the second one amounts to decompose (e.g. polar coordinates) the position vector $\textbf{x}(t)=\lvert\textbf{x}(t)\rvert \hat{\textbf{x}}$ and apply the usual rules for differentiation (for simplicity, I denote by $\hat{\textbf{x}}=\frac{\textbf{x}(t)}{\lvert\textbf{x}(t)\rvert}$ the normalized vector, which does not depend on $t$): $$\frac{d}{dt}\textbf{x}(t) =\frac{\sum_{i=1}^n x_i(t)\frac{d}{dt}x_i(t)}{\lvert\textbf{x}(t)\rvert}\hat{\textbf{x}} =\frac{\sum_{i=1}^n x_i(t)\frac{d}{dt}x_i(t)}{\lvert\textbf{x}(t)\rvert}\frac{\sum_{i=1}^n x_i(t)\textbf{e}_i}{\lvert{\textbf{x}(t)\rvert}} =\sum_{i=1}^n\Biggl[\frac{\sum_{k=1}^n x_k(t)\frac{d}{dt}x_k(t)}{\lvert\textbf{x}(t)\rvert^2} x_i(t)\Biggr]\textbf{e}_i.$$
Clearly, the components of the two expressions must be equal, but it doesn't seems so evident to me. Can you help me to understand what is going on? (I hope there are no mistakes in my computations). Finally, please, tell me if I need to elaborate further my question.
(If the tags do not match the question properly, feel free to correct them.)