# Multivariable Chain Rule - A solution I can't understand.

I am having great trouble trying to understand this chain rule question. As you can see, there are three equalities. $$f(x,y) = f(w,w) = f(uv, u^2 + v^2)$$ This makes absolutely no sense to me! When trying to calculate the partial derivative of f with respect to $$x$$, what use do we have of "$$w$$"?

Thanks a bunch if you can take to time to explain a little!

Question:

Let $$z = f(x,y)$$ be a differentiable function such that $$\begin{array}{ccc} f(3,3) = 1, & f_x(3,3) = -2, & f_y(3,3) = 11, \\ f(2,5) = 1, & f_x(2,5) = 7, & f_y(2,5) = -3. \end{array}$$ Suppose $$w$$ is a differentiable function of $$u$$ and $$v$$ satisfying the equation $$f(w,w) = f(u,v, u^2+v^2)$$ for all $$(u,v)$$. Find $$\displaystyle \frac{\partial w}{\partial u}$$ at $$(u,v,w) = (1,2,3)$$.

Proposed Solution:

Differentiating the identity $$f(w,w) = f(uv,u^2+v^2)$$ with respect to $$u$$ gives $$f_x(w,w)\frac{\partial w}{\partial u} + f_y(w,w) \frac{\partial w}{\partial u} = f_x(uv, u^2+v^2) \frac{\partial (uv)}{\partial u} + f_y(uv, u^2+v^2) \frac{\partial (u^2+v^2)}{\partial u}$$ by the Chain Rule. Hence $$\left(f_x(w,w) + f_y(w,w)\right) \frac{\partial w}{\partial u} = f_x(uv, u^2+v^2)v + f_y(uv, u^2+v^2) 2u$$ which leads to $$\left(f_x(3,3) + f_y(3,3)\right) \frac{\partial w}{\partial u} = 2f_x(2,5) + 2f_y(2,5)$$ after substituting $$(u,v,w) = (1,2,3)$$. Now using $$f_x(3,3) = -2$$, $$f_y(3,3) = 11$$, $$f_x(2,5) = 7$$, and $$f_y(2,5) = -3$$, we conclude that $$\frac{\partial w}{\partial u} = \frac{8}{9} \quad \text{at} \quad (u,v,w) = (1,2,3).$$

• We compute the partial derivative of $f$ at $(x ,y)= (w,w)$ where $w$ is a differentiable function of $u$ and $v$ Commented May 19, 2019 at 17:18

Here is a simpler example:

$$f(x,y) = (x+y)^2.$$

If we plug in $$w$$ for both $$x$$ and $$y$$ we get

$$f(w,w) = (2w)^2 = f(x,y) \iff w = \frac{x+y}{2}$$

(assuming $$x, y \geq 0$$).

So, for the right choice of $$w = w(x,y)$$ (i.e. as a function of $$x$$ and $$y$$), we do indeed have $$f(x,y) = f(w,w)$$. Your example is made complicated by the fact that you also have $$u$$s and $$v$$s, so you need to select the right $$u$$, $$v$$ and $$w$$ to make all the equalities match. (But you don't need to worry about what $$w$$ "looks like" precisely for the question, just assume that there is one.)

As for the chain rule, you have to differentiate the composition. If you have $$f(g(t,s), h(t,s))$$, then, differentiating with respect to $$t$$ gives:

$$\frac{\partial f}{\partial t}(\underbrace{g(t,s)}_{x=g(t,s)},\underbrace{h(t,s)}_{y=h(t,s)}) = \frac{\partial f}{\partial x}\frac{\partial g}{\partial t} + \frac{\partial f}{\partial y}\frac{\partial h}{\partial t}$$.

The $$x$$ and $$y$$ in the $$f$$ derivatives indicate that we differentiate with respect to the argument in the $$x$$-position of $$f(x,y)$$ (so $$g$$) and the $$y$$-position of $$f(x,y)$$ (which is $$h$$).

• What I am confused with is that in the equality 𝑓(𝑤,𝑤)=𝑓(𝑢𝑣,𝑢^2+𝑣^2), we only have u, v, w. Why do we have to take the derivative with respect to x?
– Skkk
Commented May 19, 2019 at 18:19
• It's not "with respect to $x$", it's "with respect to the first argument to the function". Commented May 19, 2019 at 18:20
• So by "first argument to the function", you mean the first term inside the brackets, right? That makes some sense now.
– Skkk
Commented May 19, 2019 at 18:22
• I hope the edit makes it clearer :) Commented May 19, 2019 at 18:26

It's easy to get lost in a thicket of variables. Perhaps it would help to go back to the definition of derivative and derive the general formula.

Let $$g:\mathbb R^2\to \mathbb R^2$$ be defined by $$(x,y)\mapsto (xy, x^2 + y^2)$$. Then, $$F:\mathbb R^2\to \mathbb R$$ is a composition $$F(x,y)=(f\circ g)(x,y).$$

Now, apply the chain rule for derivatives to $$F$$:

$$F'(x,y)=f'(g(x,y))\circ g'(x,y).$$

Now, $$f'(g(x,y))$$ and $$g'(x,y)$$ are linear transformations, which can be expressed as $$1\times 2$$ and $$2\times 2$$ matrices, respectively:

$$f'(g(x,y))=\begin{pmatrix} \frac{\partial f}{\partial x}(g(x,y))) &\frac{\partial f}{\partial y}(g(x,y)) \end{pmatrix}=\begin{pmatrix} \frac{\partial f}{\partial x}((xy, x^2 + y^2)) &\frac{\partial f}{\partial y}((xy, x^2 + y^2)) \end{pmatrix}$$

$$g'(x,y)=\begin{pmatrix} \frac{\partial g_1}{\partial x}(x,y) & \frac{\partial g_2}{\partial x}(x,y)\\ \frac{\partial g_1}{\partial y}(x,y) & \frac{\partial g_2}{\partial y}(x,y) \end{pmatrix}=\begin{pmatrix} y & 2x\\ x & 2y \end{pmatrix}$$.

Therefore,

$$\begin{pmatrix} \frac{\partial F}{\partial x}(x,y)&\ \frac{\partial F}{\partial y}(x,y) \end{pmatrix}=\begin{pmatrix} \frac{\partial f}{\partial x}((xy, x^2 + y^2)) &\frac{\partial f}{\partial y}((xy, x^2 + y^2)) \end{pmatrix}\cdot \begin{pmatrix} y & 2x\\ x & 2y \end{pmatrix}=\begin{pmatrix} y\frac{\partial f}{\partial x}((xy, x^2 + y^2)) +x\frac{\partial f}{\partial y}((xy, x^2 + y^2))&\ 2x\frac{\partial f}{\partial x}((xy, x^2 + y^2)) +2y\frac{\partial f}{\partial y}((xy, x^2 + y^2)) \end{pmatrix}$$.

All that remains now is to substitute the values into these last expressions.