exact DE: [ 2x + y cos (x^2) - 2xy + 1 ] dx + [ sin (x^2) - x^2 ] dy = 0

[ 2x + y cos (x^2) - 2xy + 1 ] dx + [ sin (x^2) - x^2 ] dy = 0

$(2x + y \cos x^2 - 2xy + 1)\,dx + (\sin x^2 - x^2)\,dy = 0$

Check for exactness:
$M = 2x + y \cos x^2 - 2xy + 1$

$\dfrac{\partial M}{\partial y} = \cos x^2 - 2x$
 

$N = \sin x^2 - x^2$

$\dfrac{\partial N}{\partial x} = 2x \cos x^2 - 2x$
 

$\dfrac{\partial M}{\partial y} \ne \dfrac{\partial N}{\partial x}$

The equation is not exact as you claimed it is. Maybe you mean this equation:

$(2xy \cos x^2 - 2xy + 1)\,dx + (\sin x^2 - x^2)\,dy = 0$

which is exact. I am not sure, of course, of what you really mean. It is just my speculation.