Chain rule multivariable calculus. I have problem understanding the chain rule. For example consider a function $w = f(x,y)$ and $y=x^2$. By the chain rule:
\begin{equation}
\frac{\partial w}{\partial x} = \frac{\partial w}{\partial x}\frac{\partial x}{\partial x}+\frac{\partial w}{\partial y}\frac{\partial y}{\partial x} = \frac{\partial w}{\partial x}+2x\frac{\partial w}{\partial y}
\end{equation}
so $\frac{\partial w}{\partial y} = 0$. What is wrong with this reasoning? Can you give some example to show that this is not true?
 A: You are using the same symbol for two different things!

*

*The symbol $\frac{\partial w}{\partial x} $ on the left-hand side is
$\frac{\partial }{\partial x}((f(x,y))_{y=x^2})$ that is you first put $y=x^2$ into $f(x,y)$ and then you take the derivative with respect to $x$ of the result .


*The symbol $\frac{\partial w}{\partial x} $ on the right-hand side is
$\left(\frac{\partial }{\partial x}(f(x,y))\right)_{y=x^2}$ that is you first take the derivative of $f(x,y)$ with respect to $x$ and then you put $y=x^2$ into the result.
These two computations are not the same for a generic $f$, so you can't simplify and obtain $\frac{\partial w}{\partial y} = 0$.
Consider for example $f(x,y)=xy$. Then
$$\begin{align}\frac{\partial }{\partial x}((f(x,y))_{y=x^2})&=\frac{\partial }{\partial x}(x^3)=3x^2\\
\left(\frac{\partial }{\partial x}(f(x,y))\right)_{y=x^2}&=\left(\frac{\partial }{\partial x}(xy)\right)_{y=x^2}=\left(y\right)_{y=x^2}=x^2\end{align}$$
which are different.
Infact, the chain rule here says that
$$\begin{align}3x^2=\frac{\partial }{\partial x}((f(x,y))_{y=x^2})&=\left(\frac{\partial }{\partial x}(xy)\right)_{y=x^2}+2x\cdot\left(\frac{\partial }{\partial y}(f(x,y))\right)_{y=x^2}\\
&=x^2+2x\cdot \left(x\right)_{y=x^2}=x^2+2x^2=3x^2.\end{align}$$
Note that $\frac{\partial w}{\partial y} = x\not=0$.
A: $\frac{\partial w}{\partial x}$ in first term has contained the calculation of your second term $\frac{\partial w}{\partial y}\frac{\partial y}{\partial x}$. That's why you got $\frac{\partial w}{\partial y}=0$.
