# Implicit differentiation of a trivariate function

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?

You shouldn't derive equation $$f=0$$. It's only the equation of point(s) which you need the derivative at it(them). You should drive $$f$$ to get $$\frac{df}{dx}$$ expression (as you did correctly). Beside it solve equation $$f=0$$ to get solution(s) $$x=x_i$$. Then compute $$\frac{df}{dx}(x_i)$$ to reach final answer(s).
Equation $$f=0$$ has only one solution that is the point $$(\frac{1}{13},\frac{2}{13},\frac{5}{13})$$. So it is fixed at that point and no function or variable change. Therefore there is nothing to drive! Since single point domain function doesn't support derivative!!
• Implicit differentiation of a multivariable function requires differentiation of the equation $f=0$ – dacfer Nov 3 '19 at 11:14
• No unfortunately it doesn't- I am using the equation $\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{dy}{dx}+\frac{\partial f}{\partial z}\frac{dz}{dx}=0$ to evaluate $\frac{dy}{dx}$. All I am trying to do is check the resulting expression I get for $\frac{dy}{dx}$ on a simple example function for which I know the result. – dacfer Nov 3 '19 at 12:14
• @dacfer Essentially, your "implicit" trivariate function is a function of two variables as you have set $f=0$. Of these two variables, you have defined one of them to be a function of the other, leaving only one variable. However, this means that you would be setting that one variable to zero so that the solution you get is unique. In other words, there is only one point on the real plane, at which differentiation cannot occur. – TheSimpliFire Nov 3 '19 at 14:27
• ok I need to remove the $y=2x$ specification to ensure we have an equation $f(x,y)=0$ to calculate $\frac{dy}{dx}$ – dacfer Nov 3 '19 at 14:30