Theorem 1 (chain rule of Jacobian matrices).
Let $X = \mathbb R^m$, $Y = \mathbb R^n$, and $Z = \mathbb R^k$.
Let $f: D_f \subseteq X \to Y$ be differentiable at $\mathbf p \in D_f$.
Let $D_g \subseteq Y$ contains $f(\mathbf p)$, and let $g: D_g \subseteq Y \to Z$ be differentiable at $f(\mathbf p)$.
Then, $$ \mathbf J_{g \circ f}(\mathbf p) = \mathbf J_{g}(f(\mathbf p))\; \mathbf J_{f}(\mathbf p). $$