Problem in understanding chain rule: second derivative I have the next functions
\begin{align}
&z(u,v)\\
&u=xy\\
&v=x²+y²\end{align}
and I want to get the second derivative with respect to $x$.
I calculate the first derivative:
$$z_{x} = z_{u}\cdot u_{x}+z_{v}\cdot v_{x} = z_{u} \cdot  y +z_v\cdot 2x$$
I calculate the second derivative:
\begin{align}
(z_{x})_{x} &= (z_{x})_{u}\cdot u_{x}+(z_{x})_{v}\cdot v_{x}\\
&=(z_{u}\cdot y+z_{v}\cdot 2x)_{u}\cdot u_{x}+(z_{u}\cdot y+z_{v}\cdot 2x)_{v}\cdot v_{x} \\
&=(z_{uu}\cdot y+z_{vu}\cdot 2x)\cdot y+(z_{uv}\cdot y+z_{vv}\cdot 2x)\cdot 2x\\
&=z_{uu}\cdot y^2+z_{u}\cdot 2xy+z_{v}\cdot 2xy+z_{vv}\cdot 4x^2
\end{align}
Where is the error? The teacher put $2z_{v}$ in $(z_{x})_{x} = (z_{x})_{u}\cdot u_{x}+(z_{x})_{v}\cdot v_{x} +  2z_{v}$
Why?
 A: Your work: $$\begin{align} 
(z_{x})_{x} &= (z_{x})_{u}\cdot u_{x}+(z_{x})_{v}\cdot v_{x}&&\checkmark\text{chain rule}\\
&=(z_{u}\cdot y+z_{v}\cdot 2x)_{u}\cdot u_{x}+(z_{u}\cdot y+z_{v}\cdot 2x)_{v}\cdot v_{x}&&\checkmark\text{chain rule} \\
&=(z_{uu}\cdot y+z_{vu}\cdot 2x)\cdot y+(z_{uv}\cdot y+z_{vv}\cdot 2x)\cdot 2x&&{\times\text{did not apply the product rule}\\(z_v\cdot 2x)_u=z_{vu}\cdot 2x+z_v\cdot(2x)_u}\end{align}$$
Your teacher's work:
$$\begin{align}(z_x)_x &= (z_u\cdot y+z_v\cdot 2x)_x&&\text{chain rule}\\&=(z_u)_x\cdot y+(z_v)_x\cdot 2x+z_v\cdot 2 &&\text{product rule}\\&= (z_{uu}\cdot y+z_{uv}\cdot 2x)\cdot y+(z_{vu}\cdot y+z_{vv}\cdot 2x)\cdot 2x+z_v\cdot 2&&\text{chain rule}\\&=z_{uu}\cdot y^2+z_{uv}\cdot 4xy+z_{vv}\cdot 4x^2+z_v\cdot 2
\end{align}
$$

Note: order of application is important too.
A: In the last step of your calculation, you seem to have simplified $z_{uv}$ and $z_{vu}$ into $z_v$ and $z_u$. This is incorrect.
If $z$ is sufficiently smooth (it suffices for its second partial derivatives to be continuous), then $z_{uv}=z_{vu}$ and the final result should be
$$z_{uu}\cdot y^2+z_{uv}\cdot 4xy+z_{vv}\cdot 4x^2$$
I'm not quite sure what your teacher did.
