This is a example of an exact differential equation

$M(x,y) ~dx + N(x,y)~ dy = 0$

$M(x,y)=\Phi_x(x,y)$

$N(x,y)=\Phi_y(x,y)$

where $\Phi(x,y)$ is to be determined.

$M_x(x,y)=2xy+x^2+x^4$

$\Phi(x,y)=x^2y+\dfrac {x^3}{3}+\dfrac{x^5}{5}+f(y)$

$\Phi_y(x,y)=x^2 + \dfrac{df}{dy}(y) = N(x,y)=1+x^2$

$\dfrac{df}{dy}(y)=1$

$f(y)=y+C$

$\Phi(x,y)=x^2y+\dfrac {x^3}{3}+\dfrac{x^5}{5}+y+C=(1+x^2)y+\dfrac {x^3}{3}+\dfrac{x^5}{5}+C$