[Math] Order of matrix multiplication intuition

linear algebramatrices

Let $A$, $B$ be linear transformations $\mathbb{R}^2 \to \mathbb{R}^2$,
for example let $A$ be a rotation and $B$ a scale.

Let $\mathbf{v}$ be a 2 component column vector that I want to transform by the composition of these transformations, e.g. first rotate, then scale, $B(A(\mathbf{v}))$.

If I represent these transformations by matrices $\mathbf{A}$ and $\mathbf{B}$ I am never sure in what order to multiply them to get the composition $B(A)$ and not $A(B)$. I either have to look it up or derive it.

I understand what happens when a square matrix is multiplied by a column vector, the vector just gets transformed to the coordinate system defined by the columns of the matrix. Is there a way of thinking about matrix multiplication that would make it obvious that

$$
B(A(\mathbf{v})) = (\mathbf{BA})\mathbf{v}
$$

Best Answer

If you think about multiplying by a matrix on the left as applying a transformation, then the transformation $B(A(v))$ would be represented in multiplication notation as $BAv$. $v$ gets multiplied by $A$ first and then $B$, which is what you want. By associativity of multiplication, you could also multiply $BA$ first and then multiply this matrix with $v$.