Find the matrix associated to linear function. Good night, i have a problem when i find the matrix associated to a linear transformation:
$T:P_{1\rightarrow}P_{2}$
$T(p(t))=t(p(t))$
Basis for $P_{1}=\left\{ t,1\right\} $
 and for $P_{2}=\left\{ t^{2},t-1,t+1\right\}$
I work in this problem and i made this:
$T(t)=t^{2}=t^{2}+0t+0=\begin{array}{c}
1\\
0\\
0
\end{array}$
$T(1)=t=0t^{2}+t+0=\begin{array}{c}
0\\
1\\
0
\end{array}$
But this matrix is in canonical basis, how i can change this for the polynomial function?

As you discovered in the comments, it is easy to solve this one by playing around with linear combinations.
But what about a general strategy?
We know that given a linear transformation $T$ from $V$ to $W$, and two bases $\alpha = (v_1, \ldots, v_n)$ and $\beta = (w_1, \ldots, w_m)$, there is always a unique matrix representing it.  The $i$th column of that matrix will be $T(v_i)$ in the $\beta$ coordinate system.
An important special case is when $V = W$ and $T$ is the identity transformation $I$.  That's a change of basis matrix.
What you have is three coordinate systems.  $P_1 = (t, 1)$.  $P_2 = (t^2, t-1, t+1)$.  And $P_3 = (t^2, t, 1)$.  You have $T$ going from $P_1$ to $P_3$:
$$\begin{pmatrix}
1 & 0 & 0\\
0 & 1 & 0\\
\end{pmatrix}$$
You can also easily find the change of basis matrix from $P_2$ to $P_3$ - just write down $P_2$ in the $P_3$ coordinate system as follows:
$$\begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 1 \\
0 & -1 & 1
\end{pmatrix}$$
What you need is the change of basis matrix from $P_3$ to $P_2$.  And the way you do that is to just invert the change of basis matrix that you have.  Which you can do with row-reduction.
$$
\left[
\begin{array}{ccc|ccc}
1 & 0 & 0 & 1 & 0 & 0\\
0 & 1 & 1 & 0 & 1 & 0\\
0 & -1 & 1 & 0 & 0 & 1
\end{array}
\right]
\to
\left[
\begin{array}{ccc|ccc}
1 & 0 & 0 & 1 & 0 & 0\\
0 & 1 & 1 & 0 & 1 & 0\\
0 & 0 & 2 & 0 & 1 & 1
\end{array}
\right]
\to
\left[
\begin{array}{ccc|ccc}
1 & 0 & 0 & 1 & 0 & 0\\
0 & 1 & 1 & 0 & 1 & 0\\
0 & 0 & 1 & 0 & \frac{1}{2} & \frac{1}{2}
\end{array}
\right]
\to
\left[
\begin{array}{ccc|ccc}
1 & 0 & 0 & 1 & 0 & 0\\
0 & 1 & 0 & 0 & \frac{1}{2} & -\frac{1}{2}\\
0 & 0 & 1 & 0 & \frac{1}{2} & \frac{1}{2}
\end{array}
\right]
$$
And now your answer is simply:
$$
\begin{pmatrix}
1 & 0 & 0\\
0 & 1 & 0
\end{pmatrix}
\quad
\begin{pmatrix}
1 & 0 & 0 \\
0 & \frac{1}{2} & -\frac{1}{2} \\
0 & \frac{1}{2} & \frac{1}{2}
\end{pmatrix}
=
\begin{pmatrix}
1 & 0 & 0 \\
0 & \frac{1}{2} & -\frac{1}{2}\\
\end{pmatrix}
$$
This strategy will always work.
