A linear transformation $T: \Bbb R^2\to \Bbb R^2$ is given by
$T(i) = i+j; T(j) = 2i -j$.
With respect to the basis $\{i,j\}$, The matrix of $T = \left(\begin{array}{cc}1 & 2 \\1 & -1\end{array}\right).$
What is the matrix of $T$ if the basis $\{i,j\}$ is replaced by $e_1 = (i-j)$
and $e_2=3i+j$?
The solution is: $\left(\begin{array}{cc}-7/4 & -1/4 \\1/4 & 7/4\end{array}\right)$.
I am not able to come up with this solution. Here's my attempt:
$T(e_1) = T(i) - T(j) = i+j -(2i -j) = -i + 2j$
$T(e_2) = 3T(i) + T(j) = 3(i+j) +2i-j = 5i+2j$.
Thus, $T$ would be $\left(\begin{array}{cc}-1 & 5 \\2 & 2\end{array}\right)$.
Second Question:
If you let $T = \left(\begin{array}{cc}1 & 2 \\1 & -1\end{array}\right).$ Then what is $T$ relative to $e_1,e_2$?

If $T(i)=(1,1)$ and $T(j)=(2,-1)$ and $e_1=i-j=(1,-1)$ and $e_2=3i+j=(3,1)$, then $$T(e_1)=T(i-j)=T(i)-T(j)=(-1,2)=a_1e_1+b_1e_2 \,\text{(say)}$$ and $$T(e_2)=T(3i+j)=3(1,1)+(2,-1)=(5,2)=a_2e_1+b_2e_2\,\text{(say)}.$$ Thus the matrix of $T$ w.r.t. the new basis $\{e_1,e_2\}$ is $\begin{pmatrix} a_1 & a_2\\ b_1 & b_2 \end{pmatrix}$ and you need to find the values of $a_1,a_2,b_1$ and $b_2$. The above systems of equations reduces to $$a_1+3b_1=-1\\ -a_1+b_1=2$$ and
$$a_2+3b_2=5\\ -a_2+b_2=2.$$ Solve these equations to obtain $a_1=-\frac{7}{4},b_1=\frac{1}{4},a_2=-\frac{1}{4}$ and $b_2=\frac{7}{4}$.