I was thinking about this:
Let's say $g(x,y,z)$ is some function of $x,y,z$, but $z$ is a function of $x,y$. How would you compute $\frac{\partial g}{\partial x}$?
Here's my thoughts intuitively but it doesn't seem to make sense mathematically.
I would think that this would be true:
$$\frac{\partial g}{\partial x} = \frac{\partial g}{\partial x} + \frac{\partial g}{\partial z} \frac{\partial z}{\partial x}$$
This is what I think because $g$ will be changed by $x$ directly and $z$ will change because of $x$ also, which results in an additional change to $g$.
But this would imply:
$$0 = \frac{\partial g}{\partial z} \frac{\partial z}{\partial x}$$
So then one of these terms has to be zero. I don't believe this could be correct but I can't figure out the flaw in my reasoning.
Partial derivative notation is terrible; this example is one of the reasons why. In the equation
$$\frac{\partial g}{\partial x} = \frac{\partial g}{\partial x} + \frac{\partial g}{\partial z} \frac{\partial z}{\partial x}$$
the appearance of $\frac{\partial g}{\partial x}$ on the left hand side means something completely different from the appearance of $\frac{\partial g}{\partial x}$ on the right hand side.
When working with functions (in my example, $f$ is a univariate function), I find the best practice is:
Then, the correct formula is
$$ \frac{\partial g(x, y, z(x,y))}{\partial x} = g_1(x, y, z(x,y)) + g_3(x, y, z(x,y)) z_1(x, y) $$
That said, I prefer to compute with differentials than with partial derivatives when possible. I will also make the following change, since it's probably what you actually want:
Then, the differential is given by
$$ \mathrm{d}g(x,y,z) = g_1(x,y,z) \mathrm{d}x + g_2(x,y,z) \mathrm{d}y + g_3(x,y,z) \mathrm{d}z $$
(note that this equation is true even if $z$ is independent from $x$ and $y$)
Furthermore, we have
$$ \mathrm{d}z = h_1(x,y) \mathrm{d}x + h_2(x,y) \mathrm{d}y$$
which we can substitute into the above.
The premise asks for the derivative under the restriction that $y$ is held constant — that is, $\mathrm{d}y = 0$. Under that restriction we have
$$ \mathrm{d}g(x,y,z) = \left( g_1(x,y,z) + g_3(x,y,z) h_1(x,y) \right) \mathrm{d}x $$