Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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} $$

share|improve this question
1  
$B(A(\mathbf{v})) = B(\mathbf{A}\,\mathbf{v}) = \mathbf{B}\,(\mathbf{A}\,\mathbf{v}) = (\mathbf{B}\,\mathbf{A})\,\mathbf{v}$? –  Tavian Barnes Aug 9 at 22:44

4 Answers 4

up vote 1 down vote accepted

Indeed! The multiplication $BA$ scales each column vector of $A$. Thus the basis given in $A$ is transformed into a scaled basis in $BA$ so when carrying out the multiplication $(BA)v$ the vector $v$ will be represented in the new basis in $BA$ which has all its vectors scaled.

share|improve this 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$.

share|improve this answer

Given a linear transformation $M:\mathbb R^n \to \mathbb R^m$, we can describe $M$ concisely by writing down the matrix $\mathbf M$ whose $i$th column is $M(e_i)$, where $e_i$ is the $i$th standard basis vector. The matrix $\mathbf M$ could be called the matrix description of $M$ (with respect to the standard bases of $\mathbb R^m$ and $\mathbb R^n$).

Conversely, given an $m \times n$ matrix $\mathbf M$, there is a corresponding linear transformation $M$ which is described by $\mathbf M$.

If $v$ is an $n \times 1$ column vector, we can define the matrix-vector product $\mathbf M v$ by \begin{equation*} \mathbf M v = M(v). \end{equation*} Note that if $v = v_1 e_1 + \cdots + v_n e_n$, then \begin{align*} M(v) &= M(v_1 e_1 + \cdots + v_n e_n) \\ &= v_1 M(e_1) + \cdots + v_n M(e_n) \\ &= v_1 \mathbf M_1 + \cdots + v_n \mathbf M_n. \end{align*} So $\mathbf M v$ is a linear combination of the columns of $\mathbf M$, which is a very useful way to think about matrix-vector multiplication.

If $\mathbf B$ and $\mathbf A$ are matrices, I think it's nice to define the matrix product $\mathbf B \mathbf A$ to be the matrix such that \begin{equation*} (B \circ A)(v) = (\mathbf B \mathbf A)v \end{equation*} for all $v$.

The formula for the entries of $\mathbf B \mathbf A$ can then be discovered by choosing $v = e_i$, the $i$th standard basis vector.

The $i$th column of $\mathbf B \mathbf A$ is \begin{align} (\mathbf B \mathbf A)_i &= (B \circ A)(e_i) \\ &= B(A(e_i)) \\ &= B(\mathbf A_i) \\ &= \mathbf B \mathbf A_i \end{align} where $\mathbf A_i$ is the $i$th column of $\mathbf A$. This is the standard formula for matrix multiplication.

share|improve this answer
    
It might be worth picturing $A$ as being partitioned into columns. –  Hurkyl Aug 9 at 22:38

A different way to think about it is that coordinate representation of linear transformations and vectors, along with their arithmetic is defined precisely so that we have an equation

$$ [B(A(v))] = [B][A][v]$$

where I've used $[Q]$ to denote the coordinate representation of $Q$. If this equation were not true, we would have thrown everything away and picked a new way to represent coordinates.

This equation follows, incidentally, from the corresponding fact for just multiplying a matrix by a vector (along with associativity):

$$ [B(A(v))] = [B] [A(v)] = [B][A][v] $$

If we also use the facts $[B(A(v))] = [(B \circ A)(v)] = [B \circ A][v]$ and that if $Cw = Dw$ for all vectors $w$ then $C = D$, then we obtain $[B \circ A] = [B][A]$.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.