Finding the representative matrix for a linear transformation I have f: $(x,y,z) \rightarrow (x,x,z)$, with the representative matrix $A$, but this is from the canonical base to the canonical basis $B$. 
I want to find the representative matrix of this function $A'$, but going from basis $B' = ((1,0,0),(1,1,0),(1,1,1))$ to $B'$
I know that the change of matrix basis is 
$M = \begin{pmatrix} 1 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{pmatrix}$. 
Thus, $M*[x]_{B'} = [x]_{B}$ and $M*[f(x)]_{B'} = [f(x)]_{B} \implies [f(x)]_{B'} = M^{-1}AM[x]_{B'}$. Thus, $A' = M^{-1}AM$. 
However, this seems like rather tedious work, and my professor seems to solve these really quick. Is there a faster way of doing this?
When we want the representative matrix of a transformation going from the canonical basis to an arbitrary basis, he simply finds it by finding the matrix
\begin{pmatrix} f(e_1) ... f(e_n) \\  \end{pmatrix}
where $e_1, ... , e_n$ is the basis, but the terms are in the arbitary basis. I don't understand how this works, any help is appreciated. Thanks.
 A: Let $\mathcal{B}$ and $\mathcal{B'}$ be two basis of $E$. And $Mat(\mathcal{B},u)$ the matrix of u in the basis B.
If $P_{\mathcal{B},\mathcal{B'}}$ is the change of basis matrix from $\mathcal{B}$ to $\mathcal{B'}$ then we have:
$$Mat(\mathcal{B'},u) = P_{\mathcal{B'},\mathcal{B}}Mat(\mathcal{B},u)P_{\mathcal{B},\mathcal{B'}} = P_{\mathcal{B},\mathcal{B'}}^{-1}Mat(\mathcal{B},u)P_{\mathcal{B},\mathcal{B'}}$$
An efficient way to visualize it is to draw the following scheme:
$$(E,\mathcal{B'}) \overset{Id_E: P_{\mathcal{B'},\mathcal{B}}}{\rightarrow} (E,\mathcal{B}) \overset{u:Mat(\mathcal{B},u)}{\rightarrow} (E,\mathcal{B})\overset{Id_E:P_{\mathcal{B},\mathcal{B'}}}{\rightarrow} (E,\mathcal{B'})$$
You just have to multiply these matrix in this order to obtain the one you want. Why this scheme? First you take a vector expressed in the basis $\mathcal{B'}$ that you transform to express it in $\mathcal{B}$, then you compose with $u$, and you transform the new vector back in $\mathcal{B'}$ from $\mathcal{B}$. I wrote $Id_E$ above some arrows because it means it's still the same vector, I just write it in an other basis.
Edit: it seems I have misunderstood what you asked for, sorry. I'll try to write an other answer.
