Solution (source code)

= Solution

The <gradient> is
$$
\boxed{\nabla f=\bigl(y(3x^2+y^2-1),\ x(x^2+3y^2-1)\bigr)^T}.
$$