Partial derivatives where implicit equations are involved I have a function:
$$f\bigl(P,R\bigr)=h\bigl(P,R,N(P,R)\bigr)$$
where $P$ and $R$ are independent variables and $N$ is the solution of the equation:
$$P-g(R,N)=0$$
I am trying to find $\frac{\partial f}{\partial P}$ and $\frac{\partial f}{\partial R}$.
 A: To obtain $\frac{\partial f}{\partial P}$, we compute $$\frac{\partial f}{\partial P}(P,R) = \frac{\partial h}{\partial P}(P,R,N(P,R)) + \frac{\partial h}{\partial N}(P,R,N(P,R))\cdot \frac{\partial N}{\partial P}(P,R).\tag{1}$$ Now, to compute $\frac{\partial N}{\partial P}$ we use the chain rule and the equation $P-g(R,N)=0$.  Differentiating with respect to $P$: $$1  - \frac{\partial g}{\partial N}(R,N)\cdot \frac{\partial N}{\partial P}(P,R) = 0.$$  This gives us $$1 = \frac{\partial g}{\partial N}(R,N)\cdot \frac{\partial N}{\partial P}(P,R) \implies \frac{\partial N}{\partial P}(P,R) = \frac{1}{\frac{\partial g}{\partial N}(R,N)}.$$  In all, then, by $(1)$ we get $$\boxed{\frac{\partial f}{\partial P}(P,R) = \frac{\partial h}{\partial P}(P,R,N(P,R)) + \frac{\frac{\partial h}{\partial N}(P,R,N(P,R))}{\frac{\partial g}{\partial N}(R,N)}.}$$
For the second part, $\frac{\partial f}{\partial R}$, we compute $$\frac{\partial f}{\partial R}(P,R) = \frac{\partial h}{\partial R}(P,R,N(P,R)) + \frac{\partial h}{\partial N}(P,R,N(P,R))\cdot \frac{\partial N}{\partial R}(P,R).\tag{2}$$  Now, as before, we differentiate $P-g(R,N)=0$ with respect to $R$ to obtain $\frac{\partial N}{\partial R}$: $$-\frac{\partial g}{\partial R}(R,N) - \frac{\partial g}{\partial N}(R,N)\cdot \frac{\partial N}{\partial R}(P,R) = 0 \implies \frac{\partial N}{\partial R}(P,R) = -\frac{\frac{\partial g}{\partial R}(R,N)}{\frac{\partial g}{\partial N}(R,N)}.$$  In all, then, by $(2)$ we get $$\boxed{\frac{\partial f}{\partial R}(P,R) = \frac{\partial h}{\partial R}(P,R,N(P,R)) - \frac{\partial h}{\partial N}(P,R,N(P,R))\cdot \frac{\frac{\partial g}{\partial R}(R,N)}{\frac{\partial g}{\partial N}(R,N)}.}$$
A: $N(P,R)$ is not an independent variable, rather a function (of $P$ and $R$).  Hence partial derivatives of $f$ with respect to $P$ and $R$ exist.
The solution is to obtain $\frac{\partial g}{\partial R}$ and $\frac{\partial g}{\partial N}$ from the solution of $P-g(R,N)=0$.
At the solution, P = g, and hence:
$$\frac{\partial N}{\partial P}=\frac{1}{\frac{\partial g}{\partial N}}$$
$$\frac{\partial N}{\partial R}=-\frac{\frac{\partial g}{\partial R}}{\frac{\partial g}{\partial N}}$$
Use these derivatives with the chain rule in the evaluation of
$$\frac{\partial}{\partial P}f\bigl(P,R\bigr)$$and
$$\frac{\partial}{\partial R}f\bigl(P,R\bigr)$$
