Chain rule

Derivative of a composition equals the composition of derivatives.
Chain rule

Chain rule: Let URkU\subseteq\mathbb R^k and VRmV\subseteq\mathbb R^m be . Let f:UVf:U\to V be at aUa\in U, and let g:VRpg:V\to\mathbb R^p be differentiable at f(a)f(a). Then the gfg\circ f is differentiable at aa, and

D(gf)(a)=Dg(f(a))Df(a). D(g\circ f)(a)=Dg(f(a))\circ Df(a).

In terms of the , this becomes the matrix identity Jgf(a)=Jg(f(a))Jf(a)J_{g\circ f}(a)=J_g(f(a))\,J_f(a), which is the standard “multiply Jacobians” rule.