Partial derivatives and constraints on variables

I think I have a problem with a basic understanding of partial derivatives when changing variables.

I do understand that if we just change variables, e.g. $$(x_1, x_2, x_3) \rightarrow (y_1,y_2,y_3)$$, the partial derivatives change as $$\frac{\partial}{\partial x_i} \rightarrow \sum\limits_{j=1}^{3}\frac{\partial y_j}{\partial x_i}\frac{\partial }{\partial y_j}$$. However, I do not understand what happens if we reduce the number of variables by introducing constraints. For example, suppose that equation $$g(x_1,x_2,x_3)=0$$ is fulfilled. Now we have 2 degrees of freedom left, so how does one calculate the partial derivatives with respect to the new variable. For concreteness, let's assume that the new variables are $$(x_1, x_2)$$ and $$x_3 = f(x_1, x_2)$$, so what are $$\frac{\partial}{\partial x_1}$$ and $$\frac{\partial}{\partial x_2}$$?

If you have a function $$h(x,y,z)$$, and you define $$z=f(x,y)$$, then the chain rule says

$$\frac{\partial}{\partial x} h(x,y,f(x,y)) = \frac{\partial h}{\partial x} + \frac{\partial h}{\partial z} \frac{\partial f}{\partial x}$$

and similarly for $$y$$. In this formula, the terms $$\frac{\partial h}{\partial x}$$ and $$\frac{\partial h}{\partial z}$$ on the right-hand side should be understood to be evaluated at $$z=f(x,y)$$.

• Thank you for your answer! But what if I define a function only on the subsurface defined by the equation $z=f(x,y)$? In this case $h$ explicitly depends only on $x_1, x_2$
– egor
Nov 8, 2020 at 23:35
• Then I don't understand the original question. If $h(x_1,x_2)$ only depends on $x_1$ and $x_2$, you would just take the partial derivatives like normal. Do you have a specific example in mind to illustrate what you mean?
– Nick
Nov 9, 2020 at 3:03
• Well, I think, I did not express my thoughts correctly in the previous comment. Suppose we have a function $f(x_1,x_2,x_3)$. Then we consider new variables $\{y_i(x_1, x_2, x_3)\}_{i=1,2,3}$, therefore the derivatives are $\frac{\partial}{\partial x_i} f(y_1(x_i),y_2(x_i),y_3(x_i)) = \frac{\partial y_j}{\partial x_i} \frac{\partial}{\partial y_j} f$. But what if we then put a constraint $y_3 = C = const$?
– egor
Nov 9, 2020 at 18:51
• I think I have solved my problem, thank you for your answer, it helped!
– egor
Nov 9, 2020 at 21:13