I've been trying to solve an exercise about finding an endomorphism ($f:\mathbb{R}^2\rightarrow\mathbb{R}^2$) so that $f(2,5)=(1,3)$ and $f(1,3)=(1,-1)$. So my steps have been the following:
- First, we have two bases: the canonic base of $\mathbb{R}^2$ and another base which which we shall call $\bar{B}=\{(2,5),(1,3)\}$.
- Then, we know that for an equation $Y=CX$, $C$ would be the matrix associated with $f$ with bases $\bar{B}$ and $B$.
Then I didn't know how to proceed, so I looked it up in my textbook and it uses this figure:
And it says that, in order to find the matrix $A$ (which would be the matrix associated with our endomorphism using the canonical base only), one has to know that $A=CP^{-1}$. My book uses similar diagrams sometimes and I think I don't understand them, because I don't understand how they arrived at that formula. Why $A=CP^{-1}$ and not $A=P^{-1}C$? There's not constrain when it comes to the dimensions of the matrices because they're all square matrices, so the order of the factors must come from somewhere.
Thanks everyone in advance!

This all seems very complicated.
Conversely, there is a map that sends the standard basis to $(2,5),(1,3)$. The matrix form of this is $$P:=\begin{pmatrix}2&1\\5&3 \end{pmatrix}$$ Then, $P^{-1}$ will send these back to the standard basis. You want to find a matrix $A$ that sends $(1,0),(0,1)$ to $(1,3),(1,-1)$. Then the composition, will first send us back to standard basis, and we know how to write a matri that sends everything to the correct vectors. So, first put the matrix back into standard basis with $P^{-1}$, and then send standdard vectors to the vectors in question.
In other words, $A:=\begin{pmatrix}1&1\\3&-1 \end{pmatrix}P^{-1}$