Let $\textbf{P}_{2}(\textbf{R})$ be the real vector space of polynomials of degree less than or equal to $2$.
Let $f:\textbf{P}_{2}(\textbf{R})\rightarrow \textbf{P}_{2}(\textbf{R})$ be the linear map given by differentiation, i.e., $f(p(x)) = p'(x)$.
Compute the matrix of $f$ with respect to the basis $\{1, x + 1, x^2 + x\}$.
MY ATTEMPT
So far I've done $f(1) = 0$, $f(x+1) = 1$ and $f(x^2 + x) = 2x + 1$.
Let's consider the first equation: $$ f(1) = 0 $$ Now, we can decompose the input and the output on the polynomial basis you suggested: $$ f(1\times(1) + 0(x+1) + 0(x^2+1))= 0\times(1) + 0(x+1) + 0(x^2+1) $$ Reading out the coefficients both on the input and the output, we deduce that the sought matrix, call it $f_{mat}$, must be such that $$ f_{mat}(1,0,0)^T = (0,0,0)^T $$ This equation is equivalent to state that the first column of $f_{mat}$ is $(0,0,0)^T$. We can proceed similarly for the other two equations: $$ f_{mat}(0,1,0)^T = (1,0,0)^T \\ \text{i.e. } f(0\times(1) + 1(x+1) + 0(x^2+1))=1\times(1) + 0(x+1) + 0(x^2+1) \\ f_{mat}(0,0,1)^T = (-1,2,0)^T \\ \text{i.e. } f(0\times(1) + 0(x+1) + 1(x^2+1))=-1\times(1) + 2(x+1) + 0(x^2+1) $$ Thus obtaining $$ f_{mat}= \begin{pmatrix} 0 & 1 & -1 \\ 0 & 0 & 2 \\ 0 & 0 & 0 \\ \end{pmatrix} $$