Proposition (chain rule)
Let $f: U\to V$ and $g: V\to \R^d$ where $U\subseteq \R^n$ and $V\subseteq \R^m$ are open.
If $f$ is differentiable at $x_0\in U$ and $g$ is differentiable at $f(x_0)\in V$, then $g\circ f$ is differentiable at $x_0 \in U$ with $$ \begin{align*} D(g\circ f)(x_0) = Dg(f(x_0)) \circ Df(x_0). \end{align*} $$