# Calculus/Multivariable Calculus/Chain Rule

### Rules of taking Jacobians

If f : RmRn, and h(x) : RmR are differentiable at 'p':

• $J_{\mathbf {p} }(\mathbf {f} +\mathbf {g} )=J_{\mathbf {p} }\mathbf {f} +J_{\mathbf {p} }\mathbf {g}$
• $J_{\mathbf {p} }(h\mathbf {f} )=hJ_{\mathbf {p} }\mathbf {f} +\mathbf {f} (\mathbf {p} )J_{\mathbf {p} }h$
• $J_{\mathbf {p} }(\mathbf {f} \cdot \mathbf {g} )=\mathbf {g} ^{T}J_{\mathbf {p} }\mathbf {f} +\mathbf {f} ^{T}J_{\mathbf {p} }\mathbf {g}$

Important: make sure the order is right - matrix multiplication is not commutative!

#### Chain rule

The chain rule for functions of several variables is as follows. For f : RmRn and g : RnRp, and g o f differentiable at p, then the Jacobian is given by

$\left(J_{\mathbf {f} (\mathbf {p} )}\mathbf {g} \right)\left(J_{\mathbf {p} }\mathbf {f} \right)$

Again, we have matrix multiplication, so one must preserve this exact order. Compositions in one order may be defined, but not necessarily in the other way.