Solution (source code)

= Solution

For the given polynomial <vector field>, direct differentiation gives
$$
(\nabla\times\mathbf G)_x=x^2-x^2=0,\quad (\nabla\times\mathbf G)_y=(2xy-1)-(2xy-1)=0,\quad (\nabla\times\mathbf G)_z=(3+2xz)-(3+2xz)=0.
$$
An <exact differential> is a differential one-form equal to $d\phi=\phi_xdx+\phi_ydy+\phi_zdz$ for a single-valued scalar function. This field is smooth on the simply connected domain $\mathbb R^3$, so its vanishing <curl> is sufficient for exactness. More concretely,
$$
\boxed{\mathbf G\cdot d\mathbf r=d(3xy+x^2yz-xz).}
$$
The explicit potential proves exactness globally, rather than relying on curl-free behavior without checking the domain.