Answer
$y=\frac{2 \cos x}{\cos ^2x+C}$
Work Step by Step
We are given:
$$y'+y(\tan x+y \sin x)=0$$
Dividing both sides by $y^2$
$$\frac{1}{y^2}\frac{dy}{dx}+\frac{1}{y}\tan x=\sin x $$
Assume that:
$$u=\frac{dy}{dx} \rightarrow \frac{du}{dx}=-y^{-2}\frac{dy}{dx}$$
The equation becomes:
$$-\frac{du}{dx}+u \tan x=\sin x$$
$$\frac{du}{dx}-u \tan x=-\sin x$$
Integrating factor:
$$I=e^{-\int tan xdx}=e^{-\int - \ln(\cos x)dx}=\cos x$$
The equation becomes:
$$\frac{d}{dx}(u\cos x)=-\sin x \cos x$$
Integrating both sides:
$$u\cos x=\frac{1}{2}\cos^2x+C$$
$$u=\frac{1}{2}\cos x+\frac{C}{\cos x}$$
$$\frac{dy}{dx}=\frac{1}{2}\cos x+\frac{C}{\cos x}$$
Hence general solution is $y=\frac{2 \cos x}{\cos ^2x+C}$