The Chain Rule Type 1 for Functions of Several Variables

# The Chain Rule Type 1 for Functions of Several Variables

Recall that the derivative of a single variable composite function $f(g(x))$ is given by the formula $\frac{d}{dx} f(g(x)) = f'(g(x)) g'(x)$ provided that $f$ and $g$ are differentiable. When dealing with a function of several variables, the chain rule is slightly different. We will start by looking at the chain rule type 1 with functions of two variables.

The second chain rule can be found on The Chain Rule Type 2 for Functions of Several Variables page.

## The Chain Rule Type 1 for Functions of Two Variables

Suppose that $z = f(x, y)$ is a two variable real-valued function, and $x = x(t)$ and $y = y(t)$, that is $x$ and $y$ can be represented by the parametric equations $x(t)$ and $y(t)$, both of which are functions in terms of the parameter $t$. Then $z = f(x(t), y(t))$ is a function of the parameter $t$ only. If we wanted to find the derivative of $z$ with respect to $t$ then:

(1)
\begin{align} \quad \frac{dz}{dt} = \lim_{h \to 0} \frac{g(t + h) - g(t)}{h} \\ \quad \frac{dz}{dt} = \lim_{h \to 0} \frac{f(x(t + h), y(t + h)) - f(x(t), y(t))}{h} \\ \quad \frac{dz}{dt} = \lim_{h \to 0} \frac{f(x(t + h), y(t + h)) - f(x(t), y(t + h)) + f(x(t), y(t+h)) - f(x(t), y(t))}{h} \\ \quad \frac{dz}{dt} = \lim_{h \to 0} \frac{f(x(t+h), y(t+h)) - f(x(t), y(t+h))}{h} + \lim_{h \to 0} \frac{f(x(t), y(t+h)) - f(x(t), y(t))}{h} \\ \end{align}

Notice that for $\frac{f(x(t+h), y(t+h)) - f(x(t), y(t+h))}{h}$, the difference of values of $f$ is only with the $x$-coordinate. By the normal chain rule, this implies that $\lim_{h \to 0} \frac{f(x(t+h), y(t+h)) - f(x(t), y(t+h))}{h} = \frac{\partial z}{\partial x} \frac{dx}{dt}$

Also notice that for $\frac{f(x(t), y(t+h)) - f(x(t), y(t))}{h}$, the difference of values of $f$ is only with the $y$-coordinate. By the normal chain rule, this implies that $\lim_{h \to 0} \frac{f(x(t), y(t+h)) - f(x(t), y(t))}{h} = \frac{\partial z}{\partial y} \frac{dy}{dt}$.

 Theorem 1 (The Chain Rule Type 1 for Two Variable Functions): If $z = f(x, y)$ is a two variable real-valued function with continuous partial derivatives $\frac{\partial z}{\partial x}$ and $\frac{\partial z}{\partial y}$, and $x = x(t)$ and $y = y(t)$ are differentiable functions of $t$ then $\frac{dz}{dt} = \frac{\partial z}{\partial x} \frac{dx}{dt} + \frac{\partial z}{\partial y} \frac{dy}{dt}$.

We should note that $\frac{dz}{dt}$ represents the rate of change of $z$ as $t$ changes. For example, if a particle is moving along a curve with parametric equations $x = x(t)$ and $y = y(t)$ and $z = f(x, y) = f(x(t), y(t))$, then $\frac{dz}{dt}$ represents how $z$ changes for said particle as $t$ varies on the curve defined by $z = f(x(t), y(t))$.

Let's now look at some examples of applying the chain rule case 1.

### Example 1

Let $z = xy^2 + 2x^2y$ where $x = \sin t$ and $y = \cos t$. Find $\frac{dz}{dt}$.

We first find the partial derivatives of $z = f(x,y)$, that is $\frac{\partial z}{\partial x} = y^2 + 4xy$ and $\frac{\partial z}{\partial y} = 2xy + 2x^2$. We then find the derivatives $\frac{dx}{dt} = \cos t$ and $\frac{dy}{dt} = -\sin t$. Therefore $\frac{dz}{dt}$ is as follows:

(2)
\begin{align} \quad \frac{dz}{dt} = \frac{\partial z}{\partial x} \frac{dx}{dt} + \frac{\partial z}{\partial y} \frac{dy}{dt} \\ \quad \frac{dz}{dt} = (y^2 + 4xy) \cos t - (2xy + 2x^2) \sin t \end{align}

Now we substitute $x = \sin t$ and $y = \cos t$ to get:

(3)
\begin{align} \quad \frac{dz}{dt} = (\cos ^2 t + 4 \sin t \cos t) \cos t - (2 \sin t \cos t + 2 \sin ^2 t) \sin t \\ \quad \frac{dz}{dt} = \cos ^3 t + 4 \sin t \cos ^2 t - 2 \sin ^2 t \cos t - 2 \sin ^3 t \end{align}

### Example 2

Let $z = x^3 y^2 - xy$ where $x = t^2$ and $y = 3t$. Find $\frac{dz}{dt}$.

We first find the partial derivatives of $z = f(x, y)$, that is $\frac{\partial z}{\partial x} = 3x^2 y^2 - y$ and $\frac{\partial z}{\partial y} = 2x^3y - x$. We then find the derivatives $\frac{dx}{dt} = 2t$ and $\frac{dy}{dt} = 3$. Therefore $\frac{dz}{dt}$ is as follows:

(4)
\begin{align} \quad \frac{dz}{dt} = \frac{\partial z}{\partial x} \frac{dx}{dt} + \frac{\partial z}{\partial y} \frac{dy}{dt} \\ \quad \frac{dz}{dt} = (3x^2 y^2 - y)(2t) + (2x^3y - x)(3) \\ \quad \frac{dz}{dt} = [3(t^2)^2 (3t)^2 - (3t)][2t] + [2(t^2)^3 (3t) - (t^2)][3] \\ \quad \frac{dz}{dt} = [27t^6 - 3t][2t] + [6t^7 - t^2][3] \\ \quad \frac{dz}{dt} = 54t^7 - 6t^2 + 18t^7 - 3t^2 \\ \quad \frac{dz}{dt} = 72t^7 - 9t^2 \end{align}

Alternatively, notice that since $z = x^3 y^2 - xy$, $x = t^2$, and $y = 3t$ then:

(5)
\begin{align} z = (t^2)^3(3t)^2 - (t^2)(3t) \\ z = 9t^8 - 3t^3 \\ \frac{dz}{dt} = 72t^7 - 9t^2 \end{align}

If we can substitute $x = x(t)$ and $y = y(t)$ into $z = f(x, y)$ relatively easily and the derivative is relatively easy to calculate, then this method is much nicer to deal with.

## The Chain Rule Type 1 for Functions of Several Variables

For functions of the $n$ variables $x_1, x_2, ..., x_n$ such as $z = f(x_1, x_2, ..., x_n)$ whose partial derivatives are continuous and for which $x_1 = x_1(t)$, $x_2 = x_2(t)$, …, $x_n = x_n(t)$, then we can compute $\frac{dz}{dt}$ in a similar manner.

 Theorem 2 (The Chain Rule Type 1 for Several Variable Functions): If $z = f(x_1, x_2, ..., x_n)$ is an $n$ variable real-valued function with continuous partial derivatives $\frac{\partial z}{\partial x_1}$, $\frac{\partial z}{\partial x_2}$, …, $\frac{\partial z}{\partial x_n}$, and $x_1 = x_1(t)$, $x_2 = x_2(t)$, …, $x_n = x_n(t)$ are differentiable functions of $t$ then $\frac{dz}{dt} = \frac{\partial z}{\partial x_1} \frac{d x_1}{dt} + \frac{\partial z}{\partial x_2} \frac{d x_2}{dt} + ... + \frac{\partial z}{\partial x_n} \frac{d x_n}{dt}$.

### Example 3

Let $w = x^2y^3z^4$ where $x = 2t$, $y = t^2$, and $z = -4t$. Find $\frac{dw}{dt}$.

The partial derivatives of $w$ are $\frac{\partial w}{\partial x} = 2xy^3z^4$, $\frac{\partial w}{\partial y} = 3x^2y^2z^4$, and $\frac{\partial w}{\partial z} = 4x^2y^3z^3$.

Also $\frac{dx}{dt} = 2$, $\frac{dy}{dt} = 2t$, and $\frac{dz}{dt} = -4$. Therefore, $\frac{dw}{dt}$ is as follows:

(6)
\begin{align} \quad \frac{dw}{dt} = \frac{\partial w}{\partial x} \frac{dx}{dt} + \frac{\partial w}{\partial y} \frac{dy}{dt} + \frac{\partial w}{\partial z} \frac{dz}{dt}\\ \quad \frac{dw}{dt} = [2xy^3z^2z^4][2] + [3x^2y^2z^4][2t] + [4x^2y^3z^3][-4] \\ \quad \frac{dw}{dt} = [1024t^{11}][2] + [3072t^{10}][2t] + [-1024t^{11}][-4] \\ \quad \frac{dw}{dt} = 2048t^{11} + 6144t^{11} + 4096t^{11} \\ \quad \frac{dw}{dt} = 12288t^{11} \end{align}

Alternatively, we could directly substitute $x = 2t$, $y = t^2$, and $z = -4t$ into $w$, simplify, and then differentiate:

(7)
\begin{align} w = x^2 y^3 z^4 \\ w = (2t)^2 (t^2)^3 (-4t)^4 \\ w = 1024t^{12} \\ \frac{dw}{dt} = 12288t^{11} \end{align}