excellent you found the integration factor
but i will mention an important thing
[MATH]\int -x \tan(xy) \ d(xy) = x \ln|\cos(xy)|[/MATH]
here [MATH]x[/MATH] is considered as a constant, so it is ok to ignore it
then, the integration factor is
[MATH]\mu (xy) = e^{\ln|\cos(xy)|} = \cos(xy)[/MATH]
now you have
[MATH]M = \cos(xy)(-xy\tan(xy) + y + 1)[/MATH]
[MATH]N = \cos(xy)(x - x^2\tan(xy))[/MATH]
And you can define a new function [MATH]g(y)[/MATH] as
[MATH]g(y) = \int \left(N - \frac{\partial}{\partial y} \int M \ dx \right) \ dy[/MATH]
[MATH]= \int \left(\cos(xy)(x - x^2\tan(xy)) - \frac{\partial}{\partial y} \int \cos(xy)(-xy\tan(xy) + y + 1) \ dx \right) \ dy[/MATH]
[MATH]= \int \left(\cos(xy)(x - x^2\tan(xy)) - \frac{\partial}{\partial y} \ \sin(xy) + x \cos(xy) \right) \ dy[/MATH]
[MATH]= \int \left(\cos(xy)(x - x^2\tan(xy)) - (x \cos(xy) - x^2 \sin(xy))\right) \ dy [/MATH]
[MATH]= \int \left( x\cos(xy) - x^2\sin(xy) - x \cos(xy) + x^2 \sin(xy)\right) \ dy [/MATH]
[MATH]= \int 0 \ dy = 0[/MATH]
the left side of the equation is
[MATH]f(x, y) = \int M \ dx + g(y)[/MATH]
[MATH]= \int \cos(xy)(-xy\tan(xy) + y + 1) \ dx + 0[/MATH]
[MATH]= \int -xy\sin(xy) + y\cos(xy) + \cos(xy)) \ dx[/MATH]
[MATH]= \sin(xy) + x\cos(xy)[/MATH]
the right side of the equation is just a constant
then the final solution is
[MATH]\sin(xy) + x\cos(xy) = C[/MATH]