In[28]:=
Clear[pot,v,x,y,f]
v[x_,y_]:={2 x y, x^2-y^2}
In[29]:=
curl2[v][x,y]
Out[29]=
0
In[30]:=
test=Integrate[v[t,y][[1]],{t,0,x}]+f[y]
Out[30]=
2 x y + f[y]
In[31]:=
D[test,y]
Out[31]=
2 x + f'[y]
In[32]:=
Solve[D[test,y]==v[x,y][[2]],f'[y]];
dfy=Evaluate[f'[y]/.Flatten[%]]/.y->t
Out[32]=
2
-t
In[33]:=
Integrate[dfy,{t,0,y}]
Out[33]=
3
-y
---
3
So . . .
the potential function is x^2 y - 1/3 y^3 + C.
In[34]:=
pot[x_,y_]:=x^2 y-1/3 y^3