How to change the order of the three vectors that are dot product Two vectors: $u$ (a unit vector) and $x$ (a regular non-unit vector), the angle between them is $\theta$
I want to know the derivation process of changing $(x\cdot u)u$ to ***x (intuitively, I want to move $x$ to the far right side, and the ***is any proper form that makes it work). 
One of the appealing reasons to do that is that I can use *** as an operation on vector x.
But here, does anyone could help me out for how to derive it from  $(x\cdot u)u$u to ***x ?
Note that $u(u\cdot x)$ is not what we want, there should be no parenthesis.
 A: This is impossible.  $(x \cdot u)u$ is a scalar multiple of $u$, and you can't write it as a multiple of $x$ unless $x$ is a multiple of $u$.
For instance, let $u=i$ and $x=i+j$.  Then $(x \cdot u)u = i$, and you can't write $i$ as a multiple of $i+j$.  
Also, scalar multiplication by a vector is not a one-to-one operation, so “canceling” a dot product or multiplying by an inverse to a vector is undefined.
A: If we define $ (x \cdot u) = x^T u $, then $ (x \cdot u) u = (x^T u) u = k u$. However, note that $ k = x^T u $ is a scalar. Equivalently, $ k = u^T x $. 
$$ 
(x \cdot u) u = k u 
$$. 
Since $k$ is an scalar we can exchange the positions of $k$ and $u$. Then, 
$$ (x \cdot u) u = u k = u (u^T x) $$
Finally
$$
(x \cdot u) u = P x
$$
where $ P = u u^T $ is a matrix.
A: Using Einstein notation:
\begin{align}
((x \cdot u)u)_i
&=x_ju_ju_i\\
&=u_iu_jx_j\\
&=P_{ij}x_j\\
&=(Px)_i
\end{align}
So we have that
$$(x \cdot u)u = Px$$
If we define the $P$ matrix as $P_{ij}=u_iu_j$. Note that because $u$ is an unit vector, $P$ will be the projection matrix to $u$.
