I was watching this youtube video.
Now I would wonder what if special integrating factor had been a function of $x$ and $y$ other than some exponential function of $x$ and $y$. Then how should we get that?
suppose you have this differential equation $$(2xy^2 \sec y + 2x\frac{\tan y}{y}) dx + (3x^2y \sec y +3y \sec y +\frac{x^2}{y}) dy = 0$$ how would you get the integrating factor of the above differential equation?
although it is $y\cos y$
$$(2xy^2 \sec y + 2x\frac{\tan y}{y}) dx + (3x^2y \sec y +3y \sec y +\frac{x^2}{y}) dy = 0$$ The integrating factor is $y\cos(y)$ . After reducing to the common denominator, this is easy to guess. If you cannot see it at first place, try various forms of integrating factors. When trying an integrating factor of the form $f(y)$ you find the function $f(y)$ by identification.
Checking :
$$y\cos(y)(2xy^2 \sec y + 2x\frac{\tan y}{y}) dx + y\cos(y)(3x^2y \sec y +3y \sec y +\frac{x^2}{y}) dy = 0$$
$$(2xy^3 + 2x\sin(y)) dx + (3x^2y^2 +3y^2 +x^2\sin(y)) dy = 0$$ $$d\left(x^2y^3+y^3+x^2\sin(y)\right)=0$$ $$x^2y^3+y^3+x^2\sin(y)=c$$