Canonical: https://knowlpedia.com/real-analysis/chain-rule/

# Chain rule

Derivative of a composition equals the composition of derivatives.

Let \(U\subseteq\mathbb R^k\) and \(V\subseteq\mathbb R^m\) be [open sets](https://knowlpedia.com/topology/open-set/). If \(f:U\to V\) is [differentiable](https://knowlpedia.com/real-analysis/differentiable-map/) at \(a\in U\) and \(g:V\to\mathbb R^p\) is differentiable at \(f(a)\), then the [composition](https://knowlpedia.com/shared-foundations/composition/) \(g\circ f\) is differentiable at \(a\), and
\[
D(g\circ f)(a)=Dg(f(a))\circ Df(a).
\]

In terms of [Jacobian matrices](https://knowlpedia.com/real-analysis/jacobian-matrix/), this is
\[
J_{g\circ f}(a)=J_g(f(a))\,J_f(a).
\]
