How to find coordinate vector of a linear transformation I'm trying to find the coordinate vector of the following linear transformation
$$ T \bigr(a , b \bigl) \quad=\quad \begin{pmatrix} 3a-b \\ a+3b \end{pmatrix} $$
in the following basis
$$ \beta \quad=\quad \bigr\{ \, (1,1) \, , \, (1,-1)  \, \bigl\}  $$
I thought that i should be the coefficients in the transformation matrix, i.e
$$ [T]_{\beta}  \quad=\quad \begin{pmatrix} 3 & -1 \\ 1 & 3 \end{pmatrix} $$
But the answer is
$$ \begin{pmatrix} 3 & 1 \\ -1 & 3 \end{pmatrix} $$
What did I do wrong?
 A: You have that $$T(1,1)=(2,4)=3(1,1)-(1,-1)\quad \text{and}\quad T(1,-1)=(4,-2)=(1,1)+3(1,-1).$$
Therefore $$[T]_{\beta \beta }=\begin{pmatrix}3&1\\-1&3\end{pmatrix},$$
is correct.

Notice that the matrix of $T$ that you wrote is $[T]_{\alpha \alpha }$ where $$\alpha =\{(1,0),(0,1)\}$$
is the canonical basis.
A: Your solution is correct if you were working with a basis of the form $\beta'=\{(1,0),(0,1)\}$. However,  it is not the case because we are working with $\beta=\{(1,1),(1,-1)\}$, but we always can use the definition of matrix representation for $T$ respect to the ordered base $\beta$,$$[T]_{\beta}=\begin{pmatrix}\uparrow&\uparrow\\ [T(1,1)]_{\beta}&[T(1,-1)]_{\beta}\\\downarrow&\downarrow \end{pmatrix},$$
where $[T(1,1)]_{\beta}$ and $[T(1,-1)]_{\beta}$ they are the coordinates respect to the basis $\beta$. The coordinates we can find directly by definition.
Using the rule given by $T$ we have that $T(1,1)=\begin{pmatrix}2\\4\end{pmatrix}$ then since $\begin{pmatrix}2\\4\end{pmatrix}=3\begin{pmatrix}1\\1\end{pmatrix}+(-1)\begin{pmatrix}1\\-1\end{pmatrix}$ we conclude that $[T(1,1)]_{\beta}=\begin{bmatrix}3\\-1\end{bmatrix}$. Similarly, we find the coordinate $[T(1,-1)]_{\beta}=\begin{bmatrix}1\\3\end{bmatrix}$.
Therefore
$$[T]_{\beta}=\begin{pmatrix}3&1\\-1&3\end{pmatrix}.$$
Using $\beta'$ we have $$[T]_{\beta'}=\begin{pmatrix}3&-1\\1&3\end{pmatrix}.$$
That is one of the advantages of working with canonical bases (as $\beta'$).
