Use
NonCommutativeMultiply to represent composition in an algebra of differential operators.
The base case, where

is a function, simply multiplies by

:
Here the operator is
D.
HoldPattern stops the derivative from acting on the double blank:
Build a function to expand non-commutative products. Distributivity with respect to
Plus: