Let us calculate the work performed by the forces of each field over the path from a certain point 1 (x1,y1) to another certain point 2 (x2,y2)
(i) dA=→F⋅d→r=ay→i⋅d→r=aydx or, A=a∫x2x1ydx
(ii) dA=→F⋅d→r=(ax→i+by→j)⋅d→r=axdx+bydy
Hence A=∫x2x1axdx+∫y2y1bydy
In the first case, the integral depends on the function of type y(x), i.e. on the shape of the path. Consequently, the first field of force is not potential. In the second case, both the integrals do not depend on the shape of the path. They are defined only by the coordinate of the initial and final points of the path, therefore the second field of force is potential.