How to construct change of basis matrix How do I construct a change of basis matrix?
For example in $\mathbb R^3$, how to construct matrix changing basis from $A$ to $B$?
$A=\begin{pmatrix} 1  \\ 0 \\5 \end{pmatrix}\begin{pmatrix} 4  \\ 5 \\5 \end{pmatrix}\begin{pmatrix} 1  \\ 1 \\4 \end{pmatrix}$
$B=\begin{pmatrix} 1  \\ 3 \\2 \end{pmatrix}\begin{pmatrix} -2  \\ -1 \\1 \end{pmatrix}\begin{pmatrix} 1  \\ 2 \\3 \end{pmatrix}$
 A: Step 1: Find a change of basis matrix from $A$ to the standard basis
Step 2: Do the same for $B$
Step 3: Apply the first, then the inverse of the second. 
For the first, if have the coordinates $(p, q, r)$ in the $A$ basis, then in the standard basis, you have $\begin{pmatrix}{1\\0\\5}\end{pmatrix}p + \begin{pmatrix}{4\\5\\5}\end{pmatrix}q + \begin{pmatrix}{1\\1\\4}\end{pmatrix}r $. That means that the change of basis matrix (from the $A$-basis to the standard basis) is exactly what you've called $A$. Similarly for part 2. So the thing you want is $B^{-1} A$. You'll need to invert the matrix $B$, but I'm assuming you can do that. 
High level lesson: reduce to a simpler problem when possible. 
A: Let $M_{u,v}$ be the base change matrix from base $u$ to base $v$. Then the following identity holds for bases $u$,$v$, and $w$: $$ M_{u,v}=M_{w,v}M_{u,w}$$ In this case $A$ can be the role of $u$ and $B$ is $v$. Use the standard basis $e$ as the intermediate basis $w$. Then the expression is: $$M_{A,B}=M_{e,B}M_{A,e} = M_{B,e}^{-1}M_{A,e}$$ The basis change matrix from any basis to the standard basis is easy, just write the vectors as the columns of the matrix. So here have to calculate $$\left( \begin{array}{ccc}
1 & -2 & 1 \\
3 & -1 & 2 \\
2 & 1 & 3 \end{array} \right)^{-1}\left( \begin{array}{ccc}
1 & 4 & 1 \\
0 & 5 & 1 \\
5 & 5 & 4 \end{array} \right)$$
