# 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)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)Now we substitute $x = \sin t$ and $y = \cos t$ to get:

(3)### 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)Alternatively, notice that since $z = x^3 y^2 - xy$, $x = t^2$, and $y = 3t$ then:

(5)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)Alternatively, we could directly substitute $x = 2t$, $y = t^2$, and $z = -4t$ into $w$, simplify, and then differentiate:

(7)