For any vectors $u, v, w$ in $\mathbf{R}^{n}$ and any scalar $k$ in $\mathbf{R}$ :
(i) $(u+v) \cdot w=u \cdot w+v \cdot w$,
(ii) $(k u) \cdot v=k(u \cdot v)$,
(iii) $u \cdot v=v \cdot u$,
(iv) $u \cdot u \geq 0$, and $u \cdot u=0$ iff $u=0$.
Note that (ii) says that we can "take $k$ out" from the first position in an inner product. By (iii) and (ii),
$$
u \cdot(k v)=(k v) \cdot u=k(v \cdot u)=k(u \cdot v)
$$