If the linear map $ \ T:R^2 \to R^2 \ $ has the matrix of transformation $$ A=\begin{pmatrix} -3 & 1 \\ 3 & -1 \end{pmatrix} $$
with respect to the basis $ \ B=\{(1,-1), \ (-1,5) \} \ $ , then find the matrix $ \ A' \ $ with respect to the basis $ \ B'=\{(-2,1), \ (-1,1) \} \ $ ?
Answer:
Let $ \ A' \ $ be the matrix corresponding the basis $ \ B'=\{(-2,1), \ (-1,1) \} \ $.
Then,
$ A'=PAP^{-1} \ $ , where $ \ P=\begin{pmatrix} -2 & -1 \\ 1 & 1 \end{pmatrix} $
Thus,
$ A'=\begin{pmatrix} -2 & -1 \\ 1 & 1 \end{pmatrix} \begin{pmatrix} -3 & 1 \\ 3 & -1 \end{pmatrix} \begin{pmatrix} -1 & -1 \\ 1 & 2 \end{pmatrix}=\begin{pmatrix} 3 & -1 \\ 0 & 0 \end{pmatrix} $
Am I right ?
Let's look at this a little more generally general. Suppose we have $\mathcal B=\left\{b_1,b_2,\ldots,b_n\right\}$ and $\mathcal B'=\left\{b_1',b_2',\ldots,b_n'\right\}$ bases for a vector space $V$ a subspace of $\mathbb{R}^m$ and $T:V \to V $ linear with matrix with respect to $\mathcal{B}$ of $$ A= [T]_\mathcal{B}$$
You want a change of basis matrix $P$ such that $$PAP^{-1}=[T]_\mathcal{B'}$$
Notationally if you take $[v]_\mathcal{B}$ to mean vector $v$ written in the coordinates of basis $\mathcal{B}$ that is it can be written uniquely as $$ \textbf{v}=x_1\textbf{b}_1+x_2\textbf{b}_2+ \cdots +x_n\textbf{b}_n $$ then $[\textbf{v}]_\mathcal{B}=\begin{bmatrix}x_1 \\ x_2 \\ \vdots \\ x_n\end{bmatrix}$
So matrix $P$ must have the property that $P[v]_\mathcal{B}=[v]_{\mathcal{B}'}$ for all vectors $v$ and it will follow that $P^{-1}[v]_{\mathcal{B}'}=[v]_{\mathcal{B}}$ . So in particular this is true for the vectors $b_1,b_2,\ldots,b_n$ that is
$$\begin{split} p_1=Pe_1=&P[b_1]_\mathcal{B}=[b_1]_{\mathcal{B}'}\\ p_2=Pe_2=&P[b_1]_\mathcal{B}=[b_2]_{\mathcal{B}'}\\ &\vdots \\ p_n=Pe_n=&P[b_1]_\mathcal{B}=[b_n]_{\mathcal{B}'}\\ \end{split} $$
Where $p_1, \ldots, p_n$ are the column vectors of $P=[p_1,\ldots,p_n]$ Note in the proof we are going through the standard basis but we don't need it anymore we have a direct method of finding the columns of $P$ namely $p_k=[b_k]_{\mathcal{B}'}$
So for each $\textbf{b}_k$ we can write
$$ \textbf{b}_k=x_1\textbf{b}_1'+x_2\textbf{b}_2'+ \cdots +x_n\textbf{b}_n' $$
Which can be rewritten as the matrix equation $$ \textbf{b}_k=B'\textbf{x} $$ where $B'=[\textbf{b}_1',\textbf{b}_2', \ldots \textbf{b}_n']$ and $\textbf{x}=\textbf{p}_k$
Now you need to solve for $x$ for all $k=1,\ldots,n$
$$ \begin{split} \textbf{b}_1&=B'\textbf{p}_1\\ \textbf{b}_2&=B'\textbf{p}_2\\ &\vdots& \\ \textbf{b}_n&=B'\textbf{p}_n\\ \end{split} $$
You can convert this into a matrix equation $B=B'P$ where $B=[\textbf{b}_1,\textbf{b}_2, \ldots \textbf{b}_n]$. You could just find $B'^{-1}$ and multiply by both sides to find $P=B'^{-1}B$ that's gimusi's soltion. however you can instead consider the following augmented matrix $$ [B' | B] $$
when you row reduce it to rref you get $$[I|B'^{-1}B]=[I|P]$$
In your case the matrix you need to reduce is
$$ \left[\begin{array}{rr|rr} -2 & -1 & 1 & -1\\ 1 & 1 & -1 & 5 \end{array}\right] $$