Answer
$f(x,y)=y^2 \sin x+x\cos y+C$
Work Step by Step
When the vector field $F(x,y)=Pi+Qj$ is a conservative field, then throughout the domain $D$, we have
$\dfrac{\partial P}{\partial y}=\dfrac{\partial Q}{\partial x}$
$P$ and $Q$ are the first-order partial derivatives on the domain $D$.
Here, we have $\dfrac{\partial P}{\partial y}=\dfrac{\partial Q}{\partial x}=2y\cos x-\sin y$
This implies that the vector field $F$ is conservative.
Now, $f(x,y)=y^2 \sin x+x\cos y+g(y)$ [g(y) : A function of y]
$f_y(x,y)=2y \sin x-x\sin y+g'(y)$
Here, $g(y)=C$; where $C$ is a constant.
Hence, we get $f(x,y)=y^2 \sin x+x\cos y+C$