Answer
$C=x^2y+y$
Work Step by Step
In this case,we have $M =2xy$ and $N =(x^2+1)$
so that $M_y=2x$
whereas $N_x =2x$.
Since $M_y=N_x$, the differential equation is exact.
$\frac{\partial \phi}{\partial x}=2xy$
$\frac{\partial \phi}{\partial y}=(x^2+1)$
Integrating $M =2xy$ equation with respect to $x$, holding $y$ fixed, yields
$$\phi (x,y)=x^2y+h(y)$$ but $$\frac{\partial \phi}{\partial y}=x^2+1=x^2+\frac{dh}{dy}$$$$\rightarrow \frac{dh}{dy}=1$$Integrating the preceding equation yields $$\rightarrow h(y) =y+C$$
The general solution is :
$$C=x^2y+y$$