Lets say that I have the following function: $$ y = (f \circ g \circ h)(x) = f(g(h(x))) $$
$$ f:\mathbb{R}^{k} → \mathbb{R}, g : \mathbb{R}^{m} \to \mathbb{R}^k, h: \mathbb{R}^{n} \to \mathbb{R}^m $$
what is the dimension of the Jacobian matrix $D(f \circ g \circ h)(x)$?
Would the dimension be $1\times k$, since the function is only in function of one variable $x$?
By the Chain Rule you have $$D(f\circ g\circ h)=Df\cdot Dg\cdot Dh,$$ where these last derivatives have:
$Df$ a $1\times k$-matrix;
$Dg$ a $k\times m$-matrix
and
$Dh$ an $m\times n$-matrix
which can be multiplied, then $D(f\circ g\circ h)$ is a $1\times n$-matrix.
That multiplication is of matrices which have functions in their entries.
Further, the evaluated version is $$D(f\circ g\circ h)|_p=Df|_{(g\circ h)(p)}\cdot Dg|_{h(p)}\cdot Dh|_p,$$ which is a product of matrices with numbers as entries, however the same analysis of the number of rows and columns applies, as above.