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