# Iterating the chain rule in multiple variables

$$f:\mathbb{R^3}\rightarrow\mathbb{R},\quad g:\mathbb{R^2}\rightarrow\mathbb{R},\quad h:\mathbb{R}\rightarrow\mathbb{R}$$

$f,g,h$ are differentiable along their domain. I'm asked to find the total derivative of the form:

$$H(x,y,z):=g(f(x,y,h(x)),\ g(z,y))$$

I started, but then realized something must be wrong:

$$DH(x,y,z)\ \ ="\ Dg(f(x,y,h(x)),\ g(z,y))\cdot Df(x,y,h(x))\cdot \ Dg(z,y)\cdot Dh(x)$$

These linear mappings cant be composed as I have them written.

## 1 Answer

Your expression are mostly correct, but for multivariate functions you have to carefully keep track of which differential's output is going into which one's input:

$$DH(x,y,z)[dx, dy, dz] = Dg\left(f(x,y,h(x)),g(z,y)\right)\left[\begin{array}{c}Df(x,y,h(x))\left[\begin{array}{c}dx\\ dy\\ Dh(x)[dx]\end{array}\right]\\ Dg(z,y)\left[\begin{array}{c}dz\\dy\end{array}\right]\end{array}\right],$$

and of course with enough contortions it is possible to write this expression as a linear map on $(dx,dy,dz)$.