# 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)}$$

• It seems correct to me – Isham Feb 21 '18 at 8:19

$$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)}$$
• The easier way to arrive at OP's answer is to note that $$-\int 2\sin x\cos x \ dx = \int \cos x \ d(\cos x) = \frac{\cos^2 x}{2} + C$$ – Dylan Feb 21 '18 at 20:43