Answer
$$\frac{{{y^2}}}{2} = - \sec x + C$$
Work Step by Step
$$\eqalign{
& y{\cos ^2}xdy + \sin xdx = 0 \cr
& {\text{Subtract }}\sin xdx \cr
& y{\cos ^2}xdy = - \sin xdx \cr
& {\text{Separating variables gives}} \cr
& ydy = - \frac{{\sin x}}{{{{\cos }^2}x}}dx \cr
& ydy = {\left( {\cos x} \right)^{ - 2}}\left( { - \sin x} \right)dx \cr
& {\text{Integrating gives}} \cr
& \int y dy = \int {{{\left( {\cos x} \right)}^{ - 2}}\left( { - \sin x} \right)} dx \cr
& \frac{{{y^2}}}{2} = \frac{{{{\left( {\cos x} \right)}^{ - 1}}}}{{ - 1}} + C \cr
& {\text{Simplifying gives}} \cr
& \frac{{{y^2}}}{2} = - \sec x + C \cr} $$