I'm trying to derive this partial derivative of a function $f$ with respect to $u_x$ and $u_y$ with the following form: $$ f(u_x, u_y) = \left(\frac{\partial u_x}{\partial x}\right)^2 + \left(\frac{\partial u_y}{\partial y} \right)^2 $$
where both $u_x$ and $u_y$ are functions of $x$ and $y$, i.e. $u_x=u_x(x,y), u_y = u_y(x,y)$. A more compact way to think about this is $f$ is a scalar function with a two-dimensional vector field as input, with $u_x$ and $u_y$ the components of that vector field. And I got to the point where
$$ \frac{\partial f}{\partial u_x} = 2 \frac{\partial u_x}{\partial x} \frac{\partial}{\partial u_x} \frac{\partial u_x}{\partial x} $$
(similarly for partial w.r.t. $u_y$),
Then I'm stuck on this partial derivative on the right $\frac{\partial}{\partial u_x} \frac{\partial u_x}{\partial x}$, which seems to be the partial derivative of the partial derivative of the function, but with respect to the function itself. I don't really know how to proceed from here. Can anyone help with some pointers? Really appreciate the help.