Re-arranging the differential equation yields
d y d x = 2 x y − 4 x − 4 y + 8 = 2 ( x − 2 ) ( y − 2 ) . {\displaystyle {\begin{aligned}{\frac {\mathrm {d} y}{\mathrm {d} x}}&=2xy-4x-4y+8=2(x-2)(y-2).\end{aligned}}}
Separating,
1 y − 2 d y = ( 2 x − 4 ) d x . {\displaystyle {\begin{aligned}{\frac {1}{y-2}}\;\mathrm {d} y&=(2x-4)\;\mathrm {d} x.\end{aligned}}}
Taking the integral,
∫ 1 y − 2 d y = ∫ ( 2 x − 4 ) d x . log | y − 2 | = x 2 − 4 x + c . | y − 2 | = e x 2 − 4 x + c = C e x 2 − 4 x , {\displaystyle {\begin{aligned}\int {\frac {1}{y-2}}\;\mathrm {d} y&=\int (2x-4)\;\mathrm {d} x.\\\log |y-2|&=x^{2}-4x+c.\\|y-2|&=e^{x^{2}-4x+c}=Ce^{x^{2}-4x},\end{aligned}}} where C = e c {\displaystyle C=e^{c}} .
To get rid of the absolute value, note that if y − 2 {\displaystyle y-2} is negative, then we can replace C {\displaystyle C} with − C {\displaystyle -C} . Therefore, for some constant C {\displaystyle C} , we have
y − 2 = C e x 2 − 4 x , {\displaystyle {\begin{aligned}y-2=Ce^{x^{2}-4x},\end{aligned}}}
which simplifies to
y = 2 + C e x 2 − 4 x . {\displaystyle {\begin{aligned}y=2+Ce^{x^{2}-4x}.\end{aligned}}}