(a)
Since, $\cos x\ dy = y\sin x\ dx - y^{2}\ dx$
$\Rightarrow$ $\frac{1}{y^{2}}\ \ \frac{dy}{dx} - \frac{1}{y}\tan x = - \sec x$
Put , $- \frac{1}{y} = z \Rightarrow \frac{1}{y^{2}}\ \ \frac{dy}{dx} = \frac{dz}{dx}$
$\Rightarrow$ $\frac{dz}{dx} + \left( \tan x \right)z = - \sec x$
This is a linear differential equation. Therefore,
$IF = e^{\int_{}^{}{\tan x\ \ dx}} = e^{\int_{}^{}{\log{\sec x}}} = \sec x$
Hence, the solution is
$z.\left( \sec x \right) = \int_{}^{}{- \sec x}.\sec x\ dx + c_{1}$
$\Rightarrow$ $- \frac{1}{y}\ \sec x = - \tan x + c_{1}$
$\Rightarrow$ $\sec x = y(\tan x + c)$