The hessian matrix of a function $f:\mathbb R^n \to \mathbb R$ is often written as $D^2f=D(Df)$. However, as far as I know, $D$ is an operator that takes a function, and returns a matrix of functions (see here). Therefore, if the inner $D$ in $D(Df)$ maps the function $f$ to a matrix of functions, the outer $D$ can not take that result as an argument, since it is not a function.
So is $D^2f$ for the hessian matrix an abuse of notation? Or am I missing something? (I'd like to see how this is correct from an exact definition of $D$, but I can't find one).
Let $L(V,W)$ denote the vector space of linear maps from (vector space) $V$ to (vector space) $W$. Note that $Df\colon\Bbb R^n\to L(\Bbb R^n,\Bbb R)$ is likewise a function (which assigns to $x$ the linear map $Df(x)$), and you're differentiating this. Thus, $D(Df)(x)$ is a linear map from $\Bbb R^n$ to $L(\Bbb R^n,\Bbb R)$, which is, in turn, a bilinear map from $\Bbb R^n\times\Bbb R^n$ to $\Bbb R$. This is what the usual hessian matrix representation is.