\[ y'(x)+y(x) \tan (x)-\sin (2 x)=0 \] ✓ Mathematica : cpu = 0.0259315 (sec), leaf count = 15
\[\left \{\left \{y(x)\to \cos (x) \left (c_1-2 \cos (x)\right )\right \}\right \}\]
✓ Maple : cpu = 0.056 (sec), leaf count = 13
\[ \left \{ y \left ( x \right ) =\cos \left ( x \right ) \left ( -2\,\cos \left ( x \right ) +{\it \_C1} \right ) \right \} \]
\begin {equation} \frac {dy}{dx}+y\left ( x\right ) \tan \left ( x\right ) =\sin \left ( 2x\right ) \tag {1} \end {equation}
Integrating factor \(\mu =e^{\int \tan dx}=e^{-\ln \left ( \cos \left ( x\right ) \right ) }=\frac {1}{\cos \left ( x\right ) }\). Hence (1) becomes
\[ \frac {d}{dx}\left ( y\left ( x\right ) \frac {1}{\cos \left ( x\right ) }\right ) =\frac {1}{\cos \left ( x\right ) }\sin \left ( 2x\right ) \]
Integrating both sides
\begin {align*} y\left ( x\right ) \frac {1}{\cos \left ( x\right ) } & =\int \frac {1}{\cos \left ( x\right ) }\sin \left ( 2x\right ) dx+C\\ y\left ( x\right ) & =\cos \left ( x\right ) \int \frac {\sin \left ( 2x\right ) }{\cos \left ( x\right ) }dx+C\cos \left ( x\right ) \end {align*}
But \(\sin \left ( 2x\right ) =2\sin \left ( x\right ) \cos \left ( x\right ) \) hence
\begin {align*} y\left ( x\right ) & =\cos \left ( x\right ) \int \frac {2\sin \left ( x\right ) \cos \left ( x\right ) }{\cos \left ( x\right ) }dx+C\cos \left ( x\right ) \\ & =2\cos \left ( x\right ) \int \sin \left ( x\right ) dx+C\cos \left ( x\right ) \\ & =-2\cos ^{2}\left ( x\right ) +C\cos \left ( x\right ) \end {align*}