In this post: Deriving the Formula of Total Derivative for Multivariate Functions, it is stated that the first derivative of a trivariate function $f(x,y(x),z(x))$ with respect to $x$ is $$\large \frac{df}{dx}=\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{dy}{dx}+\frac{\partial f}{\partial z}\frac{dz}{dx}$$ I have an implicit equation $f(x,y(x),z(x))=0$
As part of a calculation for $\frac{dy}{dx}$, I differentiate both sides. Doing this I get: $\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{dy}{dx}+\frac{\partial f}{\partial z}\frac{dz}{dx}=0$
which gives:
$\large\frac{dy}{dx}=-\frac{\frac{\partial f}{\partial x}+\frac{\partial f}{\partial z}\frac{dz}{dx}}{\frac{\partial f}{\partial y}}$
To make sure I have the correct expression, I check this with a simple example:
$f(x,y,z)=x+xy+yz-z^2=0$
where:
$y=2x$ ; $z=5x$
So:
$\frac{\partial f}{\partial x}=1+y$; $\frac{\partial f}{\partial y}=x+z$; $\frac{\partial f}{\partial z}=y-2z$; $\frac{dz}{dx}=5$
It is easy to solve $f(x,y,z)=x+xy+yz-z^2=0$ giving $x=\frac{1}{13}$, $y=\frac{2}{13}$ and $z=\frac{5}{13}$
So $\frac{dy}{dx}=-\frac{(1+y)+5(y-2z)}{x+z}=4.16666$, but we know it should be $2.0$.
Problem, so let's check the original equation:
Substituting into: $\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{dy}{dx}+\frac{\partial f}{\partial z}\frac{dz}{dx}$, I get:
$(1+y)+(x+z)*2+(y-2z)*5$ which equals $-1$, ie. not the $0$ I was expecting.
What am I missing?