Let $\vec{F}=(xy,x^2+y^2)$ be a vector field. Is there exist a function $f(x,y)$ such that $\vec{\nabla}f=\vec{F}$?
My attempt: if $f_x=xy$ and $f_y=x^2+y^2$, then $f(x,y)=\frac{x^2y}{2}+g(y)$. Therefore $f_y=\frac{x^2}{2}+g'(y)$. Hence $\frac{x^2}{2}+g'(y)=x^2+y^2$, so $g'(y)=\frac{x^2}{2}+y^2$. But $g(y)$ is a function of $y$, a contradiction.
On the other hand, if you take any circle $C(t)=(R\cos t,R\sin t)$, $t\in[0,2\pi]$ then $$ \oint_{C}f\cdot d\vec{l}=\int_{0}^{2\pi}(R^2\cos t\sin t,R^2)\cdot(-R\sin t,R\cos t)\,dt=R^3\int_{0}^{2\pi}\cos^3t\,dt=0 $$ Why this does not contradict the first claim? Thanks