<s>[INST] general solution of the FODE $\frac{1}{\sin(x)} \frac{dy}{dx} = y\sec(x) -2$ What's the general solution of the first order differential equation ?
$$
\begin{align*}
\frac{1}{\sin(x)} \frac{dy}{dx} = y\sec(x)-2,  \quad 0<x< \frac{\pi}{2}
\end{align*}
$$
my solution is as follows but i think it's wrong
$$
\frac{dy}{dx} = y\tan(x) -2\sin(x) \\
\frac{dy}{dx} - y\tan(x) = -2\sin(x) \\
e^{-\int \tan(x)dx} = \cos(x)\\
y\,cos(x) = \int(-2\cos(x)\sin(x))dx\\
y =\cos(x) + \frac{C}{\cos(x)}
$$
 [/INST] It seems correct to me...
$$y'-y\tan(x)=-2\sin(x)$$
$$y'-y\frac {\sin(x)}{\cos(x)}=-2\sin(x)$$
$$\frac {y'\cos(x)-y\sin(x)}{\cos(x)}=-2\sin(x)$$
$$({y}{\cos(x)})'=-\sin(2x)$$
Integrating ..
$${y(x)}{\cos(x)}=-\int \sin(2x) dx$$
$$y(x)=\frac 1 {\cos(x)}(\frac {\cos(2x)}2+K)$$
The same answer as yours.....with $\cos(2x)=2cos^2(x)-1$
$$\boxed {y(x)=\frac C {\cos(x)}+\cos(x)}$$
</s>