Kernel of a polynomial linear Transformation

Given are linear transformation $$T$$, $$U$$:$$R_2[x]\to R_2[x]$$, where $$T$$ and $$U$$ are:

$$(Tp)(x) = xp'(x) - p(0)$$

$$(Up)(x) = xp(1)$$

Find $$ker(U\circ T)$$ and $$ker(T\circ U)$$

Just by doing the composition of those transformations I got: $$ker(U\circ T) = (x^2+2,x+1)$$ and $$ker(T\circ U) = (x^2-1, x-1)$$, but if I try by writing out the matrices for $$U$$ and $$T$$ and multiplying them, I don't get the same result. Can someone clarify please.

Note that, if $$p(x)\in\mathbb R_2[x]$$, then\begin{align}U\bigl(T\bigl(p(x)\bigr)\bigr)&=U\bigl(xp'(x)-p(0)\bigr)\\&=x\bigl(p'(1)-p(0)\bigr).\end{align}Therefore,\begin{align}\ker(U\circ T)&=\{p(x)\in\mathbb R_2[x]\mid p(0)=p'(1)\}\\&=\{a+2b+ax+bx^2\mid a,b\in\mathbb R\}\\&=(x+1,x^2+2)\end{align}(as you got).
Now, if I try to determine $$\ker(U\circ T)$$ using matrices, then I consider the matrices $$M_T$$ and $$M_U$$ of $$T$$ and $$U$$ respectively with respect to that basis $$\{1,x,x^2\}$$; these are:$$M_T=\begin{bmatrix}-1&0&0\\0&1&0\\0&0&2\end{bmatrix}\text{ and }M_U=\begin{bmatrix}0&0&0\\1&1&1\\0&0&0\end{bmatrix}.$$But$$M_U.M_T=\begin{bmatrix}0&0&0\\-1&1&2\\0&0&0\end{bmatrix}$$and$$\begin{bmatrix}0&0&0\\-1&1&2\\0&0&0\end{bmatrix}.\begin{bmatrix}a\\b\\c\end{bmatrix}=\begin{bmatrix}0\\-a+b+2c\\0\end{bmatrix}$$and therefore the kernel consists of those polynomials $$a+bx+cx^2$$ such that $$a=b+2c$$. But that's what I had got before.
Can you do the same thing with $$T\circ U$$?
• Thanks a lot, I see where I made a mistake, insted of multiplying by a vector $\begin{bmatrix}a\\b\\c\end{bmatrix}$ a multiplied by $\begin{bmatrix}x^2\\x\\1\end{bmatrix}$. Commented Dec 24, 2019 at 19:27