$M~dx + N~dy = 0$
$(x^2 + y^2 + 1)~dx + x(x - 2y)~dy = 0$
$M = x^2 + y^2 + 1$
$N = x(x - 2y) = x^2 - 2xy$
$\dfrac{\partial M}{\partial y} = 2y$
$\dfrac{\partial N}{\partial x} = 2x - 2y$
$\dfrac{\partial M}{\partial y} - \dfrac{\partial N}{\partial x} = 2y - (2x - 2y)$
$\dfrac{\partial M}{\partial y} - \dfrac{\partial N}{\partial x} = -2x + 4y$
$\dfrac{\partial M}{\partial y} - \dfrac{\partial N}{\partial x} = -2(x - 2y)$
$\dfrac{1}{N}\left( \dfrac{\partial M}{\partial y} - \dfrac{\partial N}{\partial x} \right) = \dfrac{-2(x - 2y)}{x(x - 2y)}$
$\dfrac{1}{N}\left( \dfrac{\partial M}{\partial y} - \dfrac{\partial N}{\partial x} \right) = \dfrac{-2}{x}$ → a function of x alone
$f(x) = \dfrac{-2}{x}$
Integrating factor
$u = e^{\int f(x)~dx} = e^{\int (-2/x)~dx}$
$u = e^{-2\int (dx/x)} = e^{-2\ln x}$
$u = e^{\ln x^{-2}} = x^{-2}$
Thus,
$uM~dx + uN~dy = 0$
$x^{-2}(x^2 + y^2 + 1)~dx + (x^{-2})x(x - 2y)~dy = 0$
$(1 + x^{-2}y^2 + x^{-2})~dx + (1 - 2x^{-1}y)~dy = 0$
$(1 + x^{-2})~dx + x^{-2}y^2~dx + dy - 2x^{-1}y~dy = 0$
$(1 + x^{-2})~dx + dy + \dfrac{y^2~dx}{x^2} - \dfrac{2y~dy}{x} = 0$
$(1 + x^{-2})~dx + dy + \dfrac{y^2~dx - 2xy~dy}{x^2} = 0$
$(1 + x^{-2})~dx + dy - \dfrac{x(2y~dy) - y^2~dx}{x^2} = 0$
$(1 + x^{-2})~dx + dy - d\left( \dfrac{y^2}{x} \right) = 0$
$\displaystyle \int dx + \int x^{-2}~dx + \int dy - \int d\left( \dfrac{y^2}{x} \right) = 0$
$x + \dfrac{x^{-1}}{-1} + y - \dfrac{y^2}{x} = c$
$x - \dfrac{1}{x} + y - \dfrac{y^2}{x} = c$
$x^2 - 1 + xy - y^2 = cx$
$x^2 - y^2 + xy - 1 = cx$ answer