Misunderstanding chain rule in several variables The question asks what is the wrong reasoning in this statement. If we have $w = f(x,y,z)$ and $z = g(x,y)$ then:
$\frac{\partial w}{\partial x} = \frac{\partial w}{\partial x}\frac{\partial x}{\partial x} + \frac{\partial w}{\partial y}\frac{\partial y}{\partial x} + \frac{\partial w}{\partial z}\frac{\partial z}{\partial x} = \frac{\partial w}{\partial x} + \frac{\partial w}{\partial z}\frac{\partial z}{\partial x}$ 
That implies $\frac{\partial w}{\partial z}\frac{\partial z}{\partial x} = 0$ that is in general not true. My first insight was the actually you need to replace $\frac{\partial w}{\partial x}$  with $\frac{\partial f}{\partial x}$ so you can't just cancel them out, but trying a few examples I got the same expression for both of them. I don't know if that was true just for my examples or if I'm missing something about some hypothesis of the chain rule. Thanks in advance 
 A: This is because the notation being used is awfully ambiguous, as often happens with these multivariable chain rule problems if whoever is writing about it isn't careful. The two instances of '$\frac{\partial w}{\partial x}$' refer to different things, so are not necessarily equal.


*

*The $\frac{\partial w}{\partial x}$ on the left hand side is the partial derivative of the function $w(x,y)=f(x,y,g(x,y))$ with respect to $x$. (Here, you're holding $y$ constant, but $z=g(x,y)$ will vary as $x$ does.)

*The $\frac{\partial w}{\partial x}$ on the right hand side should actually have been written $\frac{\partial f}{\partial x}$: it is the partial derivative found by holding both $y$ and $z$ constant.


Here's an approach you may find more precise and unambiguous. Note that the final function you are considering $w(x,y)$ is given as a composite $\mathbb{R}^2 \rightarrow \mathbb{R}^3 \rightarrow \mathbb{R}$. I'll use $(x_1,x_2)$ for the coordinates in $\mathbb{R}^2$ and $(y_1, y_2, y_3)$ for the coordinates in $\mathbb{R}^3$. Note that with:


*

*$y_1(x_1, x_2) = x_1$.

*$y_2(x_1, x_2) = x_2$.

*$y_3(x_1, x_2) = g(x_1,x_2)$.


we get that $w(x_1,x_2)=f(y_1,y_2,y_3)$.
We can then apply the chain rule as $\frac{\partial w}{\partial x_1} = \frac{\partial f}{\partial y_1}\frac{\partial y_1}{\partial x_1} + \frac{\partial f}{\partial y_2}\frac{\partial y_2}{\partial x_1} + \frac{\partial f}{\partial y_3}\frac{\partial y_3}{\partial x_1}$. This should be much clearer for you to work with.
