Applying The Chain Rule to Functions of Several Variables

# Applying The Chain Rule to Functions of Several Variables

Recall from The Chain Rule Type 1 for Functions of Several Variables page that if $z = f(x, y)$ is a two variable real-valued function with continuous first partial derivatives, and $x = x(t)$ and $y = y(t)$ are differentiable then:

(1)
\begin{align} \quad \frac{dz}{dt} = \frac{\partial z}{\partial x} \frac{dx}{dt} + \frac{\partial z}{\partial y} \frac{dy}{dt} \end{align}

Also recall from The Chain Rule Type 2 for Functions of Several Variables page that if $z = f(x, y)$ is a two variable real-valued function with continuous first partial derivatives, and $x = x(s, t)$ and $y = y(s, t)$ are functions of $s$ and $t$ then:

(2)
\begin{align} \quad \frac{\partial z}{\partial s} = \frac{\partial z}{\partial x} \frac{\partial x}{\partial s} + \frac{\partial z}{\partial y} \frac{\partial y}{\partial s} \end{align}
(3)
\begin{align} \quad \frac{\partial z}{\partial t} = \frac{\partial z}{\partial x} \frac{\partial x}{\partial t} + \frac{\partial z}{\partial y} \frac{\partial y}{\partial t} \end{align}

We are now going to look at some examples of applying the chain rule in more general cases.

## Example 1

Suppose that $f$ has continuous first partial derivatives. Find $\frac{\partial}{\partial x} f(x + 2y^2, x^3 - y)$ and $\frac{\partial}{\partial y} f(x + 2y^2, x^3 - y)$.

Let $u(x, y) = x + 2y^2$ and let $v(x, y) = x^3 - y$. Then we see that we want to find $\frac{\partial}{\partial x} f(u, v)$ and $\frac{\partial}{\partial y} f(u, v)$.

We will first compute $\frac{\partial}{\partial x} f(x + 2y^2, x^3 - y)$ by applying the Chain Rule Type 2:

(4)
\begin{align} \quad \frac{\partial}{\partial x} f(u, v) = f_1(u, v) \frac{\partial u}{\partial x} + f_2(u, v) \frac{\partial v}{\partial x} \\ \quad \frac{\partial}{\partial x} f(u, v) = f_1(u, v) (1) + f_2(u, v) (3x^2) \\ \quad \frac{\partial}{\partial x} f(x + 2y^2, x^3 - y) = f_1(x + 2y^2, x^3 - y) + 3x^2 f_2(x + 2y^2, x^3 - y) \end{align}

Similarly, we compute $\frac{\partial}{\partial y} f(x + 2y^2, x^3 - y)$ by applying the Chain Rule Type 2:

(5)
\begin{align} \quad \frac{\partial}{\partial y} f(u, v) = f_1(u, v) \frac{\partial u}{\partial y} + f_2(u, v) \frac{\partial v}{\partial y} \\ \quad \frac{\partial}{\partial y} f(u, v) = f_1(u, v) (4y) + f_2(u, v) (-1) \\ \quad \frac{\partial}{\partial y} f(u, v) = 4y f_1(x + 2y^2, x^3 - y) - f_2(x + 2y^2, x^3 - y) \end{align}

## Example 2

Suppose that $f(u, v)$ has continuous first partial derivatives and that $u = u(x, y)$ and $v = v(x, y)$. Write a formula to compute $\frac{\partial}{\partial x} f(u, v)$ and $\frac{\partial}{\partial y} f(u, v)$ using Example 1 as a reference if needed.

If $u = u(x, y)$ and $v = v(x, y)$ then $f(u, v) = f(u(x, y), v(x,y))$ then we can applying the Chain Rule Type 2 directly to get that:

(6)
\begin{align} \quad \frac{\partial}{\partial x} f(u, v) = f_1(u, v) \frac{\partial u}{\partial x} + f_2(u,v) \frac{\partial v}{\partial x} \end{align}
(7)
\begin{align} \quad \frac{\partial}{\partial y} f(u, v) = f_1(u, v) \frac{\partial u}{\partial y} + f_2(u,v) \frac{\partial v}{\partial y} \end{align}

## Example 3

Suppose that $w = f(x, y, z)$, $x = g(z)$ and $y = h(z)$ have continuous derivatives. Find $\frac{dz}{dt}$.

If $w = f(x, y, z)$, $x = g(z)$ and $y = h(z)$ then $f(x, y, z) = f(g(z), h(z), z)$. So we have that:

(8)
\begin{align} \quad \frac{dw}{dz} = \frac{\partial w}{\partial x} \frac{\partial x}{\partial z} + \frac{\partial w}{\partial y} \frac{\partial y}{\partial z} + \frac{\partial w}{\partial z} \frac{\partial z}{\partial z} \\ \quad \frac{dw}{dz} = f_1(x, y, z) g'(z) + f_2(x, y, z) h'(z) + f_3(x, y, z) \end{align}

## Example 4

Suppose that $w = f(x, y, z)$, $x = g(s)$, $y = h(s, t)$ and $z = j(t)$. Find $\frac{\partial w}{\partial t}$.

We have that $f(x, y, z) = f(g(s), h(s, t), j(t))$. So:

(9)
\begin{align} \quad \frac{\partial w}{\partial t} = \frac{\partial w}{\partial x} \frac{\partial x}{\partial t} + \frac{\partial w}{\partial y} \frac{\partial y}{\partial t} + \frac{\partial w}{\partial z} \frac{\partial z}{\partial t} \\ \quad \frac{\partial w}{\partial t} = f_1(x, y, z) \frac{\partial g(s)}{\partial t} + f_2(x, y, z) h_2(s, t) + f_3(x, y, z) \frac{\partial j(t)}{\partial t} \\ \quad \frac{\partial w}{\partial t} = f_1(x, y, z) \cdot 0 + f_2(x, y, z) h_2(s, t) + f_3(x, y, z) j'(t) \\ \quad \frac{\partial w}{\partial t} = f_2(x, y, z) h_2 (s, t) + f_3(x, y, z) j'(t) \end{align}