I am getting ready to write a notebook for the chain rule in Multivariable Calculus for my students. I do know:
Clear[x, y, z, t];
x = 2 t^2;
y = 3 - t^3;
z = x^2 + y^2;
D[z, t]
Or:
Clear[x, y, z, u, v];
x[u_, v_] = u^2 + v^2;
y[u_, v_] = u^2 - v^2;
z[x_, y_] = x^2 + y^2;
D[z[x[u, v], y[u, v]], v]
But do folks have other suggestions and/or examples?
For example, might someone show that if $f(x)=x^2+y^2$ and $x=u^2-uv+v^2$ and $y=u^2+2uv-3v^2$, then the answer for $\partial f/\partial u$ is held to $(2x)(2u-v)+(2y)(2u+2v)$, which would help students with their intermediate steps.
And I think there are some that like to use Dt to do the chain rule?
Update
Just getting ready to teach the chain rule and although the Alexei Boulbitch example in the answer works:
Clear[x, y, u, v, f];
x = u^2 - u*v + v^2;
y = u^2 + 2 u*v - 3 v^2;
f = x^2 + y^2;
D[f, u] /. {x -> X, y -> Y}
(* 2 (2 u - v) X + 2 (2 u + 2 v) Y *)
But this does not:
Clear[x, y, f, t]
x = 2 t;
y = t^2;
f = x^2 y + x y^2;
D[f, t] /. {x -> X, y -> Y}
(* 16 t^3 + 10 t^4 *)
Wondering what is the difference between this and the Alexei Boulbitch answer, which works.