The Multivariable Chain Rule

Suppose that $z=f(x,y)$, where $x$ and $y$ themselves depend on one or more variables. Multivariable Chain Rules allow us to differentiate $z$ with respect to any of the variables involved:

 Let $x=x(t)$ and $y=y(t)$ be differentiable at $t$ and suppose that $z=f(x,y)$ is differentiable at the point $(x(t),y(t))$. Then $z=f(x(t),y(t))$ is differentiable at $t$ and $$\frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt}.$$

Proof

Although the formal proof is not trivial, the variable-dependence diagram shown here provides a simple way to remember this Chain Rule. Simply add up the two paths starting at $z$ and ending at $t$, multiplying derivatives along each path.

#### Example

Let $z=x^2y-y^2$ where $x$ and $y$ are parametrized as $x=t^2$ and $y=2t$.

Then \begin{eqnarray*} \frac{dz}{dt} & = & \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt}\\ & = & (2xy)(2t) + (x^2-2y)(2) \\ & = & (2t^2\cdot 2t)(2t) + \left( (t^2)^2-2(2t) \right) (2)\\ & = & 8t^4 + 2t^4 -8t \\ & = & 10t^4-8t. \end{eqnarray*}

Alternate Solution

We now suppose that $x$ and $y$ are both multivariable functions.

 Let $x=x(u,v)$ and $y=y(u,v)$ have first-order partial derivatives at the point $(u,v)$ and suppose that $z=f(x,y)$ is differentiable at the point $(x(u,v),y(u,v))$. Then $f(x(u,v),y(u,v))$ has first-order partial derivatives at $(u,v)$ given by \begin{eqnarray*} \frac{\partial z}{\partial u} & = & \frac{\partial z}{\partial x}\frac{\partial x}{\partial u} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial u} \\ \frac{\partial z}{\partial v} & = & \frac{\partial z}{\partial x}\frac{\partial x}{\partial v} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial v} . \end{eqnarray*}
Proof

Again, the variable-dependence diagram shown here indicates this Chain Rule by summing paths for $z$ either to $u$ or to $v$.

#### Example

Let $z=e^{x^{2}y}$, where $x(u,v)=\sqrt{uv}$ and $y(u,v) = 1/v$. Then \begin{eqnarray*} \frac{\partial z}{\partial u} & = & \frac{\partial z}{\partial x}\frac{\partial x}{\partial u} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial u} \\ & = & \left( 2xye^{x^{2}y} \right) \left(\frac{\sqrt{v}}{2\sqrt{u}}\right) + \left(x^{2}e^{x^{2}y}\right)(0) \\ & = & 2\sqrt{uv} \cdot \frac{1}{v} e^{(\sqrt{uv})^{2} \cdot \frac{1}{v}} \cdot \frac{\sqrt{v}}{2\sqrt{u}} + (\sqrt{uv})^{2} \cdot e^{(\sqrt{uv})^{2} \cdot \frac{1}{v}} \cdot (0) \\ & = & e^{u} + 0 \\ & = & e^{u} \\ \frac{\partial z}{\partial v} & = & \frac{\partial z}{\partial x}\frac{\partial x}{\partial v} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial v} \\ & = & \left( 2xye^{x^{2}y} \right) \left(\frac{\sqrt{u}}{2\sqrt{v}} \right) + \left(x^{2}e^{x^{2}y}\right) \left( -\frac{1}{v^{2}} \right) \\ & = & 2\sqrt{uv}\cdot\frac{1}{v} e^{(\sqrt{uv})^{2}\cdot\frac{1}{v}} \cdot \frac{\sqrt{u}}{2\sqrt{v}} + (\sqrt{uv})^{2}e^{(\sqrt{uv})^{2} \cdot \frac{1}{v}} \cdot \left( -\frac{1}{v^{2}}\right) \\ & = & \frac{u}{v}e^{u} - \frac{u}{v}e^{u} \\ & = & 0. \end{eqnarray*}

Alternate Solution

These Chain Rules generalize to functions of three or more variables in a straight forward manner.

### Key Concepts

• Let $x=x(t)$ and $y=y(t)$ be differentiable at $t$ and suppose that $z=f(x,y)$ is differentiable at the point $(x(t),y(t))$. Then $z=f(x(t),y(t))$ is differentiable at $t$ and $$\frac{dz}{dt} = \frac{\partial z}{\partial x}\frac{dx}{dt} + \frac{\partial z}{\partial y}\frac{dy}{dt}.$$

• Let $x=x(u,v)$ and $y=y(u,v)$ have first-order partial derivatives at the point $(u,v)$ and suppose that $z=f(x,y)$ is differentiable at the point $(x(u,v),y(u,v))$. Then $f(x(u,v),y(u,v))$ has first-order partial derivatives at $(u,v)$ given by \begin{eqnarray*} \frac{\partial z}{\partial u} & = & \frac{\partial z}{\partial x}\frac{\partial x}{\partial u} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial u} \\ \frac{\partial z}{\partial v} & = & \frac{\partial z}{\partial x}\frac{\partial x}{\partial v} + \frac{\partial z}{\partial y}\frac{\partial y}{\partial v} . \end{eqnarray*}