I am very confused about a use of the partial differential multivariable chain rule. The textbook first describes the formula:
$\frac{\partial f}{\partial s} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial s} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial s} + \frac{\partial f}{\partial z}\frac{\partial z}{\partial s}$
But then, as shown in the image provided, they set $s = x$ and call x to be a function of x, y to be a function of y, z to be a function of x and y, and make:
$f = x^2 + y^2 + z^2 = 4$.
But then on one side they claim:
$ \frac{\partial f}{\partial x} = 0$ *
And on the other side they have:
$\frac{\partial f}{\partial x}\frac{\partial x}{\partial x} + \frac{\partial f}{\partial y}\frac{\partial y}{\partial x} + \frac{\partial f}{\partial x}\frac{\partial z}{\partial x} = (2x)(0) + (\frac{\partial f}{\partial y})(0) + (2z)(\frac{\partial z}{\partial x})$ (1)
So then $ \frac{\partial f}{\partial x} = 2x$, but this is in direct contradiction with (*) above. This leads to large issues in equation (1), since the $ \frac{\partial f}{\partial x}$ should cancel from both sides, but it does not for some reason.
Can someone please explain what is going on?
In my opinion, it's very bad notation to use $\partial f/\partial x$ and $f_x$ for two different things, as they do. And in general it often leads to confusion when one uses the same name for the quantity that depends on some other quantities as for the function which describes this dependence.
If you want to clean it up, write $z=Z(y,z)$ instead of $z=z(x,y)$ (so that the function's name is $Z$, different from the variable name $z$), and write $$ F(x,y) = f(x,y,Z(x,y)) = x^2 + y^2 + Z(x,y)^2 $$ for the composite function, which is actually the constant function $F(x,y)=4$ since that's how $Z(x,y)$ is defined. This function $F$ is a function of two variables, so it's clearly not the same as the three-variable function $f$, so it should have a different name.
Then what they denote by $\partial f/\partial x$ is really $\partial F/\partial x$, and it's zero on the one hand (since $F$ is constant), and given by the chain rule on the other hand (since $F$ is a composite function): $$ \begin{split} 0 = F_x(x,y) & = f_x(x,y,Z(x,y)) + f_z(x,y,Z(x,y)) \, Z_x(x,y) \\ & = 2x + 2 Z(x,y) \, Z_x(x,y) . \end{split} $$ This shows that $$ Z_x(x,y) = - \frac{f_x(x,y,Z(x,y))}{f_z(x,y,Z(x,y))} = - \frac{x}{Z(x,y)} . $$