If $x$ is a [[scalar]], and $A$ and $B$ are compatible under [[matrix multiplication]] then
$
A(x B)=x(A B)=(xA)B
$
because, by the properties of the [[dot product]]
$
\mathbf a_{i\star}\cdot(x \mathbf b_{\star k})=x(\mathbf a_{i\star}\cdot\mathbf b_{\star k})=(x\mathbf a_{i\star})\cdot \mathbf b_{\star k}
$