If
[tex]\nabla f=(xy\cos xy+\sin xy)\,\vec\imath+x^2\cos xy\,\vec\jmath[/tex]
then we should have
[tex]\dfrac{\partial f}{\partial y}=x^2\cos xy\implies f(x,y)=x\sin xy+g(x)[/tex]
Differentiating with respect to [tex]x[/tex] gives
[tex]\dfrac{\partial f}{\partial x}=xy\cos xy+\sin xy=\sin xy+xy\cos xy+g'(x)[/tex]
[tex]\implies g'(x)=0\implies g(x)=C[/tex]
So [tex]F[/tex] is indeed conservative, and
[tex]f(x,y)=x\sin xy+C[/tex]