Let $D \in \mathcal{L}(\mathcal{P}(\mathbb{R}))$ be the differentiation operator, and let $U$ be an invariant subspace of $D$. Suppose there exists a $p \in U$ with deg $p = k$.
a) Show that $\mathcal{P}_k(\mathbb{R}) \subseteq U$.
b) Evidently $\{0\}$, $\mathcal{P}(\mathbb{R})$, and $\mathcal{P}_k(\mathbb{R})$ are invariant subspaces of $D$ if $k$ is a nonnegative integer. Show that there are no others.
For a) I was thinking of showing that all elements of $\mathcal{P}_k(\mathbb{R})$ can be written as a basis of $U$, but I'm not sure how to show this generally. For b) I was thinking of trying to do a proof by contradiction, but I'm not sure where to get started (also I don't know if this is the best approach).
Hint. As $U$ is invariant under $D$, $Dp = p'$ belongs to $U$ and $\deg p' = k-1$.