Let $D_1,D_2$ be two linear differential operators with matrix valued constant (i.e. translation invariant) coefficients on $\mathbb{R}^n$. Assume $D_2\circ D_1=0$, in other words $$Im(D_1)\subset Ker(D_2).$$
Let us assume that $Im(D_1)=Ker(D_2)$ for the class of polynomial (matrix valued) functions.
Under what conditions one may conclude that the same equality holds for $C^\infty$-smooth functions in a ball?
Basic examples of such situations (when the answer is known however) include:
$D_1$ and $D_2$ are the Rham differentials $d$ on differential forms of appropriate degree.
$D_1$ and $D_2$ are the Dolbeault differentials $\bar \partial$.
$D_1=dd^c$ on real valued functions on $\mathbb{C}^n$, $D_2=d$ on real $(1,1)$-forms.