<s>[INST] Linear Algebra: Change of Basis Let $A[a,b,c]$ and $B[d,e,f]$ be two non-standard bases. I have to find the $3\times3$ matrix that will convert a vector defined in terms of $A$ to $B$.
My solution is:
Let's assume a standard basis $O[e_1,e_2,e_3]$.
Now, the rotation matrix $R(A\to O)$ to change basis from $A$ to $O$ is:
$
\begin{bmatrix}
ax & bx & cx \\
ay & by & cy \\
az & bz & cz 
\end{bmatrix}
$
and $R(O\to B)$ is
$
\begin{bmatrix}
ax & ay & az \\
bx & by & bz \\
cx & cy & cz
\end{bmatrix}.
$
So, $R(A \to B)=R(A \to O)\cdot R(O\to B)$.
Is this the correct solution?
Thanks a lot.
 [/INST] Let $\alpha=\{a,b,c\}$ and $\beta=\{d,e,f\}$ be bases for $\mathbb{R}^3$ (thinking of elements of $\mathbb{R}^3$ as column vectors). Then the matrix $A=[a|b|c]$ transitions from $\alpha$-coordinates to standard-coordinates. Likewise the basis $B=[d|e|f]$ transitions from $\beta$-coordinates to the standard-coordinates. So $B^{-1}$ goes from standard-coordinates to $\beta$-coordinates. Thus $B^{-1}A$ goes from $\alpha$-coordinates (to standard and then standard) to $\beta$-coordinates and is the matrix you're looking for.
Example: Let $\alpha=\left\{\begin{bmatrix} 1\\0\\0 \end{bmatrix},\begin{bmatrix} 1\\1\\0 \end{bmatrix},\begin{bmatrix} 1\\1\\1 \end{bmatrix}\right\}$ and $\beta=\left\{\begin{bmatrix} 1\\-1\\0 \end{bmatrix},\begin{bmatrix} 0\\1\\-1 \end{bmatrix},\begin{bmatrix} 1\\0\\1 \end{bmatrix}\right\}$. 
Then ${\bf v}=\begin{bmatrix} 1\\2\\3 \end{bmatrix} = (-1)\begin{bmatrix} 1\\0\\0 \end{bmatrix}+(-1)\begin{bmatrix} 1\\1\\0 \end{bmatrix}+3\begin{bmatrix} 1\\1\\1 \end{bmatrix}$. So ${\bf v}$ in $\alpha$ coordinates is $[{\bf v}]_\alpha = \begin{bmatrix} -1\\-1\\3\end{bmatrix}$. 
Let $A=\begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix}$. Notice that $A[{\bf v}]_\alpha = \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix}\begin{bmatrix} -1\\-1\\3\end{bmatrix} = \begin{bmatrix} 1\\2\\3\end{bmatrix}$.
Let $B=\begin{bmatrix} 1 & 0 & 1 \\ -1 & 1 & 0 \\ 0 & -1 & 1\end{bmatrix}$. Then $B^{-1} = \frac{1}{2}\begin{bmatrix} 1 & -1 & -1 \\ 1 & 1 & -1 \\ 1 & 1 & 1 \end{bmatrix}$ and so $B^{-1}A = \begin{bmatrix} \frac{1}{2} & 0 & -\frac{1}{2} \\ \frac{1}{2} & 1 & \frac{1}{2} \\ \frac{1}{2} & 1 & \frac{3}{2} \end{bmatrix}$ goes from $\alpha$ to $\beta$-coordinates.
An alternate way to compute this change of basis matrix is to create the augmented matrix: $[B|A] = [d|e|f|a|b|c]$ and row-reduce. This will compute $[I|(B^{-1}A)]$ where $B^{-1}A$ is the desired matrix.
</s>