Chain rule and Multivariable Chain rule

Multivariable Chain rule

Multivariable Chain rule (with a single input variable)

Suppose we have functions \(x = f_1(t)\) and \(y = f_2(t)\), i.e. each are functions of the variable \(t\).

Suppose we have another function \(z = f_3(x,y)\), i.e. \(z\) is a function of the variables \(x\) and \(y\).

We restrict ourselves to the case where \(x\) and \(y\) are differentiable at the chosen (but general) point \(t \in \mathbb{R}\), and \(z\) is differentiable at the corresponding point \((x, y) \in (\mathbb{R}, \mathbb{R})\).

By the multivariable chain rule, we have:

\[\frac{\partial z}{\partial t} = \frac{\partial z}{\partial x} \cdot \frac{\partial x}{\partial t} + \frac{\partial z}{\partial y} \cdot \frac{\partial y}{\partial t}\]
Multivariable chain rule

Multivariable chain rule

One way to remember this rule:

Starting at the final variable (\(z\)), you go along each path to the input variable (\(t\)), and multiply every partial derivative along the path. Each multiplicative term “cancels out” to the term you require (i.e \(\frac{\partial z}{\partial x} \cdot \frac{\partial x}{\partial t}\) “cancels out” to give \(\frac{\partial z}{\partial t}\), which is what we want to calculate. \(\frac{\partial z}{\partial y} \cdot \frac{\partial y}{\partial t}\) does the same). Finally, you add together all the chains of multiplications, which gives us the result above.

In short: take the sum of multiplications which simplify to \(\frac{\partial z}{\partial t}\), along all possible paths from \(z\) to \(t\).

Multivariable Chain rule (with multiple unrelated input variables)

Taking a more general case, suppose we have \(x = f_1(a,b)\) and \(y = f_2(a,b)\). Once again, \(z = f_3(x, y)\)

Since the base variables \(a\) and \(b\) have no dependencies between each other, this case is exactly the same as the case for a single variable:

\[\frac{\partial z}{\partial a} = \frac{\partial z}{\partial x} \cdot \frac{\partial x}{\partial a} + \frac{\partial z}{\partial y} \cdot \frac{\partial y}{\partial a}\]

and:

\[\frac{\partial z}{\partial b} = \frac{\partial z}{\partial x} \cdot \frac{\partial x}{\partial b} + \frac{\partial z}{\partial y} \cdot \frac{\partial y}{\partial b}\]