How does this version of the multivariable chain rule work?

In my calculus book, it gives these formulas and states them as versions of the multivariable chain rule. I do not see how they make sense as if I cancel out the partial x’s, I get 1 = 2. Can someone explain this and tell me how these formulas work?

$\partial f/\partial v = \partial f/\partial x \cdot dx/dv + \partial f/\partial y \cdot dy/dv$

$\partial f/\partial u = \partial f/\partial x \cdot dx/du + \partial f/\partial y \cdot dy/du$

Note: These formulas are for partial derivatives of functions of form $f(x(u,v),y(u,v))$. Also please try to explain intuitively and not too rigourously.

• What do you mean by "cancel out the partial x's"? Jan 4, 2018 at 1:53
• Like they are multiplied so can’t I cancel out the dx’s? Jan 4, 2018 at 1:56
• $\frac{df}{dx}$ is one term. You can't separate out the $dx$ Jan 4, 2018 at 1:57
• That "cancelling" operation is not well defined Jan 4, 2018 at 1:57
• You can’t “cancel’ them any more than you can for single-variable functions, however much it might look like that’s what’s going in in the single-variable chain rule.
– amd
Jan 4, 2018 at 1:59

Forget about cancelling $dx$'s, this only "works" in the single-variable case. Think of it like this: if you have something like $g(u) = f(x(u))$, then $$\frac{dg}{du} = \frac{dx}{du}\frac{df}{dx},$$right? Think of $df/dx$ being a contribuition to $dg/du$, with weight $dx/du$. In the multivariable case, each partial derivative of $f$ will give a contribuition, with a certain weight. For example: if $g(u) = f(x(u),y(u),z(u),w(u))$, then $$\frac{dg}{du} = \frac{dx}{du}\frac{\partial f}{\partial x} + \frac{dy}{du}\frac{\partial f}{\partial y}+\frac{dz}{du}\frac{\partial f}{\partial z}+ \frac{dw}{du}\frac{\partial f}{\partial w}.$$

In the situations like $g(u,v) = f(x(u,v),y(u,v),z(u,v))$ you'll use the same principle, but the weight will be "with respect to the variable you are differentiating". Meaning $$\frac{\partial g}{\partial u}=\frac{\partial x}{\partial u}\frac{\partial f}{\partial x} + \frac{\partial y}{\partial u}\frac{\partial f}{\partial y}+\frac{\partial z}{\partial u}\frac{\partial f}{\partial z}.$$Similarly for $\partial g/\partial v$, etc.

• Thanks! Just one question, what do you mean by weight and contribution? Any way to be a bit more rigorous? Jan 4, 2018 at 2:11
• I am using "weight" and "contribuition" very informally here. I want you to think of that as a sort of averaged sum. Jan 4, 2018 at 2:12
• This is all particular cases of the situation where if $h\colon \Bbb R^n \to \Bbb R^m$ and $f\colon \Bbb R^m \to \Bbb R^k$, then ${\sf D}(f\circ h)(p) = {\sf D}f(h(p)) \circ {\sf D}h(p)$. You'll learn this is some point, so the proofs of all this cases will come together. That formula can seen as a product of matrices, which is all that is happening, if you think a bit hard about it. Jan 4, 2018 at 2:15
• I avoided talking about total derivatives in my answer because I think you should learn how to do the computations in the low-dimensional cases without fear, in a mechanic way first. Once that's out of the way, you can focus on the analysis behind it safely. Jan 4, 2018 at 2:16
• Thanks for your help! Jan 4, 2018 at 13:28

If you have a multivariable function $\pmb f = (f_1,\dots,f_n) : \mathbf{R}^m \to \mathbf{R}^n$ then the derivative is the matrix

$$D\pmb f = \left( \frac{\partial f_i}{\partial x_j} \right) =\begin{pmatrix} \frac{\partial f_1}{\partial x_1} & \frac{\partial f_1}{\partial x_2} & \cdots & \frac{\partial f_1}{\partial x_m} \\ \frac{\partial f_2}{\partial x_1} & \frac{\partial f_2}{\partial x_2} & \cdots & \frac{\partial f_2}{\partial x_m} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial f_n}{\partial x_1} & \frac{\partial f_n}{\partial x_2} & \cdots & \frac{\partial f_n}{\partial x_m} \\ \end{pmatrix}$$

This matrix represents a linear transformation $\mathbf{R}^m \to \mathbf{R}^n$ . If you have a composition of functions $\mathbf{R}^m \xrightarrow{\pmb f} \mathbf{R}^n \xrightarrow{\pmb g} \mathbf R^p$ then the chain rule says that the derivative of the composition $\pmb g \circ \pmb f$ is the composition of these linear functions which is given by matrix multiplication:

$$D(\pmb g \circ \pmb f) = D\pmb g \circ D \pmb f = \left( \frac{\partial g_i}{\partial u_j} \right) \left( \frac{\partial f_j}{\partial x_k} \right).$$

The formula comes from computing this matrix product. That is

$$D(\pmb g \circ \pmb f) = \left( \frac{\partial (\pmb g \circ \pmb f)_i}{\partial u_k} \right)$$

where

$$\frac{\partial (\pmb g \circ \pmb f)_i}{\partial x_k} = \sum_{j = 1}^n \frac{\partial g_i}{\partial u_j} \frac{\partial f_j}{\partial x_k}.$$

Since we are interpreting $f_j$ as the input $u_j$, it is common to abuse notation and write this as

$$\frac{\partial (\pmb g \circ \pmb f)_i}{\partial x_k} = \sum_{j = 1}^n \frac{\partial g_i}{\partial u_j} \frac{\partial u_j}{\partial x_k}.$$

For example, let $\pmb f : \mathbf{R} \to \mathbf{R}^2$ be given by $\pmb f(x) = (p(x), q(x))$ and let $\pmb g : \mathbf{R}^2 \to \mathbf{R}$ be given by $g(a,b) = ab$. Then $g(f(x)) = g(p(x),q(x)) = p(x)q(x)$. By our formula,

$$\frac{\partial(g\circ f)}{\partial x} = \frac{\partial g}{\partial a} \frac{\partial p}{\partial x} + \frac{\partial g}{\partial b} \frac{\partial q}{\partial x} = bp'(x) + aq'(x) = q(x)p'(x) + p(x)q'(x).$$

because $b = q(x)$ and $a = p(x)$. This is the familiar product rule.

• Just one question, why does the chain rule say that it is a matrix multiplication? What is the proof for this? Jan 4, 2018 at 2:40
• @JohnA It's a different version of the chain rule. You can prove it in much the same way as the single variable case: if $f(x + a) \approx f(x) + f'(x)a$ and $g(y + b) \approx g(y) + g'(y)b$ then $$g(f(x + a)) \approx g(f(x) + f'(x)a) \approx g(f(x)) + g'(f(x))f'(x)a.$$ Nothing about this is special to a single variable. The product $g'(f(x))f'(x)$ is therefore the derivative of $g \circ f$. Now just change the notation a bit and write $g'(f(x)) = Dg$ and $f'(x) = Df$. Jan 4, 2018 at 2:46
• Thank you, I understand! Jan 4, 2018 at 13:26

They don’t cancel out you must threat them as product of derivatives, for instance

$$\frac{\partial f}{\partial v} = \frac{\partial f}{\partial x} \cdot \frac{\partial x}{\partial v} + \frac{\partial f}{\partial y} \cdot \frac{\partial y}{\partial v}$$

$$\frac{\partial f}{\partial u} = \frac{\partial f}{\partial x} \cdot \frac{\partial x}{\partial u} + \frac{\partial f}{\partial y} \cdot \frac{\partial y}{\partial u}$$

To better understand the concept you should consider that chain rule is just obtained by matrix product of gradient and/or jacobians.

In the example given:

$$\nabla f(u,v)= \begin{bmatrix}f_u\\f_v\end{bmatrix}= \begin{bmatrix}x_u&y_u\\x_v&y_v\end{bmatrix}\cdot \begin{bmatrix}f_x\\f_y\end{bmatrix}$$