Matrix representation of a linear map I am given a linear map $L:\mathbb{R}[X]_{\leq 2} \rightarrow \mathbb{R}[X]_{\leq 2}$ where $L(1 + 2X) = 3 + 3X + 2X^2$ , $L(1 + X) = 1 + X + X^2$ and $L(X^2) = -2 -2X - X^2$ . i want to find a matrix representation  $L_{s}^{s}$ where $s$ is a standard basis ${(1 , X,X^2)}$.
The confusing part is that $L$ takes 3 different parameters and gives 3 different images for each of them and i think i have to find a general linear map first then i can find matrix of linear transformation. Is it correct?
I have no idea how to approach this problem. Can someone explain a little bit instead of giving full solution.
Thanks
 A: Firstly you need to translate in vectors language, you know that:
$$(1,2,0)\to(3,3,2)\\
(1,1,0)\to(1,1,1)\\
(0,0,1)\to(-2,-2,-1)$$
From here it's easy to find a matrix representation.
In this simple case you can do it directly as follow.
From the third condition you already know that the third  column of the matrix is $(-2,-2,-1)$.
Subtracting the second from the first you obtain:
$$(0,1,0)\to(2,2,1)$$
thus you also know that the second column of the matrix is $(2,2,1)$.
At this point you know that:
$$(0,1,0)\to(2,2,1)\\
(1,1,0)\to(1,1,1)\\
(0,0,1)\to(-2,-2,-1)$$
Finally subtracting the new first from the second:
$(1,0,0)\to(-1,-1,0)$
that's the first column of the matrix representation.
Thus the solution is:
\begin{bmatrix}
-1 & 2 & -2 \\
-1 & 2 & -2 \\
0 & 1 & -1
\end{bmatrix}
More in general let consider a map such that:
$$L(\vec v_i)=\vec w_i$$
We are interested to find the matrix which represent this map, that is
$$A\vec v_i=\vec w_i$$
Now the question is: How to find A?
Consider for simplicity the case n=3 (but it can be extended in general).
We are looking for tha matrix A such that:
$$A\vec v_1=\vec w_1$$
$$A\vec v_2=\vec w_2$$
$$A\vec v_2=\vec w_3$$
Put vectors $\vec v_i$ as columns in the matrix M and vectors$\vec w_i$ as columns in the matrix N, the we can write:
$$AN=M$$
Now calculate $N^{-1}$
and finally find
$$A=MN^{-1}$$
A: Hint: Use a a linear combination of $1+2X,1+X,$ and $X^2$ to get your basis $1,X,$ and $X^2$, and then use linearity of $L$ to find what their values are.
A: $s=(1,x,x^2)$, $b=(1+2x,1+x,x^2)$
$M(L$, input $b$, output $s) = \begin{Bmatrix}
3 & 1 & -2 \\
3 & 1 & -2 \\
2 & 1 & -1
\end{Bmatrix}$
$M(L$, input $s$, output $s)=M(L$, input $b$, output $s)*M($Id, input $s$, output $b)$.
Now $M($Id, input $s$, output $b)=M($Id, input $b$, output $s)^{-1}$ and 
$M($Id, input $b$, output $s)=\begin{Bmatrix}
1 & 1 & 0 \\
2 & 1 & 0 \\
0 & 0 & 1
\end{Bmatrix}$
Now find the inverse and multiply.
