Answer
$\tan y=-\cos x-x \sin x+c$
Work Step by Step
Re-arrange the given equation as: $\sec x dy+x \cos^2 y dx=0$
Now,
$\int \dfrac{1}{\cos^2 y}dy=-\int \dfrac{xdx}{\sec x}$
$\implies (x) (\sin x)-\int (-\sin x) dx =\tan (y)$
This gives: $ -[x \cos x+\cos x +c]=\tan (y)$
Hence, $\tan y=-\cos x-x \sin x+c$