# Rewriting the matrix associated with a linear transformation in another basis

Let $$L : \mathbb{R}^3\rightarrow\mathbb{R}^3$$ be a linear transformation such that its matrix with respect to the standard basis is: $$[L] = \begin{bmatrix}1 & 0 & 1 \\ -1 & -1 & 0 \\0&1&-1\end{bmatrix}$$ Consider the two following bases of $$\mathbb{R}^3$$: $$\beta = \left(\begin{bmatrix}1 \\ 1 \\ 0\end{bmatrix},\begin{bmatrix}0 \\ 1 \\ 1\end{bmatrix},\begin{bmatrix}0 \\ 0 \\ 1\end{bmatrix}\right)$$ $$\gamma = \left(\begin{bmatrix}1 \\ 2 \\ 3\end{bmatrix},\begin{bmatrix}0 \\ 1 \\ 2\end{bmatrix},\begin{bmatrix}0 \\ 0 \\ 1\end{bmatrix}\right)$$ Find the matrix associated with the transformation with respect to $$\beta$$ in input and to $$\gamma$$ in output.

I seem to have some troubles with this kind of exercises. I have been explained a way to do it through multiplying $$3$$ matrices, but I can't seem to quite remember it every time I do an exercise. This is what I have tried:

The first thing is to rewrite the vectors in $$\beta$$ as linear combinations of those of the standard basis. Let's enumerate the vectors in $$\beta$$ and $$\gamma$$ with an index that goes from $$1$$ to $$3$$. Also, $$e_1, e_2, e_3$$ are the vectors of the standard basis of $$\mathbb{R}^3$$.

We observe that $$\beta_1 = e_1 + e_2, \beta_2 = e_2+e_3, \beta_3 = e_3$$, therefore the matrix that uses $$\beta$$ as the input basis and outputs vectors in the standard basis will be: $$[L]^{\beta}= \begin{bmatrix}1 & 1 & 1 \\ -2 & -1 & 0 \\0&0&-1\end{bmatrix}$$

Now, if my understanding is correct, I need to write the vectors that make up the columns of that matrix as linear combinations of vectors in $$\gamma$$.

Using Gauss' algorithm, we find that: $$\left[\begin{array}{ccc|ccc}1&0&0&1 & 1 & 1 \\ 2&1&0&-2 & -1 & 0 \\3&2&1&0&0&-1\end{array}\right]\rightarrow \left[\begin{array}{ccc|ccc}1 & 0 & 0 & 1 & 1 & 1 \\ 0 & 1 & 0 & -4 & -3 & -2 \\0 & 0 & 1 & 5 & 6 & 2\end{array}\right]$$

Which finally means that: $$[L]^{\beta}_{\gamma} = \left[\begin{array} & 1 & 1 & 1 \\ -4 & -3 & -2 \\5 & 6 & 2\end{array}\right]$$

Is my reasoning correct? Did I make any mistakes?

Denote $$P_\beta$$ and $$P_\gamma$$ the change of basis matrices from the standard basis to the bases $$\beta$$ and $$gamma$$ respectively. These are the matrices with columns the coordinates of the vectors in $$\beta$$ and $$gamma$$ w.r.t. the standard basis.
Also, if $$X$$ is a column vector in the standard basis, denote $$X_\beta$$ and $$X_\gamma$$ the corresponding column vector in bases $$\beta$$ and $$\gamma$$. We know we have the relations. $$X=P_\beta X_\beta=P_\gamma X_\gamma.$$
Now, in the standard basis, the linear transformation is represented by the relation $$Y=LX$$, which becomes $$P_\gamma Y_\gamma=LP_\beta X_\beta,\quad\text{whence }\quad Y_\gamma=P_\gamma^{-1} LP_\beta X_\beta,$$ so that the matrix $$L_{\beta\gamma}$$ of the linear transformation, with the input in basis $$\beta$$ and the output in basis $$\gamma$$ is simply $$L_{\beta\gamma}=P_\gamma^{-1} LP_\beta.$$