# Chain rule for multivariable functions confusion

Suppose $f=f(x,y(x))$.

Then applying the chain rule we get $\frac{\partial f}{\partial x}=\frac{\partial f}{\partial x}\frac{\partial x}{\partial x}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial x}=\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial x}$.

From this it seems that it always holds that $\frac{\partial f}{\partial y}\frac{\partial y}{\partial x}=0$.

Where's the mistake?

-
You seem to be misapplying it, and your confusion is exacerbated by your choice of variables. If you have some two-argument function $f(u,v)$, then $$\frac{\partial}{\partial x}f(x,y(x))=f_u(x,y(x))+f_v(x,y(x))y^\prime(x)$$ where $f_u$ and $f_v$ are the appropriate partial derivatives. –  Ｊ. Ｍ. Aug 8 '12 at 8:40
You might profit from this answer. –  joriki Aug 8 '12 at 8:42
@J.M. If I understand correctly, you're basically saying that on the left side I used partial derivative instead of total? (meaning that it should have been ($\frac{df}{dx}$ rather than $\frac{\partial f}{\partial x}$) –  Michael Litvin Aug 8 '12 at 9:00
It doesn't matter here, since you only have one variable. Your error is in applying the chain rule to the outermost function of two variables. –  Ｊ. Ｍ. Aug 8 '12 at 9:02

As usual when there's confusion about partial derivatives, everything is readily cleared up if we remedy the deficiency in our notation for them by marking which variables are being held fixed:

$$\def\part#1#2#3{\left.\frac{\partial #1}{\partial #2}\right|_{#3}} \part fxz=\part fxy\part xxz+\part fyx\part yxz=\part fxz=\part fxy+\part fyx\part yxz\;,$$

so there's no such implication, since

$$\part fxz\ne\part fxy\;,$$

unless of course you choose $z=y$, in which case indeed

$$\part yxz=\part yxy=0\;.$$

-
What is variable $z$? –  Michael Litvin Aug 8 '12 at 8:56
@Michael: You tell me! :-) When you write $\partial f/\partial x$, that implies that there's some variable other than $x$ that you're keeping constant. You got around making it explicit by using incomplete notation, but I had to give it a name, so I called it $z$. But I didn't introduce it, it's implicit in what you wrote. –  joriki Aug 8 '12 at 9:00
I think I got the answer to the original question, but still can't tell what is $z$.. For example $f(x,y)=x+y=x+x^2$, where's $z$? –  Michael Litvin Aug 8 '12 at 9:11
@Michael: Again, if you don't know what $z$ is, then it made no sense to write $\partial f/\partial x$ in the first place. You must have had something in mind that you wanted to keep fixed while changing $x$; $z$ is just my name for whatever you intended to keep fixed. If you weren't intending to keep any particular quantity fixed, then you had no business writing $\partial f/\partial x$. –  joriki Aug 8 '12 at 9:18
@Michael: Since you insist on not knowing $z$, I'm wondering whether you did actually mean $\mathrm df/\mathrm dx$. In that case, note that the correct relation would then be $$\def\pa{\mathrm d} \frac{\pa f}{\pa x}=\frac{\partial f}{\partial x}\frac{\pa x}{\pa x}+\frac{\partial f}{\partial y}\frac{\pa y}{\pa x}=\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{\pa y}{\pa x}\;,$$ with the total derivatives cascading just like the partial derivatives with fixed $z$ did in the other case. –  joriki Aug 8 '12 at 9:21