4.2.22 \(y'(x)=\sin (x) \left (2 \sec ^2(x)-y(x)\right )\)

ODE
\[ y'(x)=\sin (x) \left (2 \sec ^2(x)-y(x)\right ) \] ODE Classification

[_linear]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.064027 (sec), leaf count = 28

\[\left \{\left \{y(x)\to c_1 e^{\cos (x)}+2 e^{\cos (x)} \text {Ei}(-\cos (x))+2 \sec (x)\right \}\right \}\]

Maple
cpu = 0.271 (sec), leaf count = 29

\[ \left \{ y \left ( x \right ) = \left ( \int \!4\,{\frac {\sin \left ( x \right ) {{\rm e}^{-\cos \left ( x \right ) }}}{\cos \left ( 2\,x \right ) +1}}\,{\rm d}x+{\it \_C1} \right ) {{\rm e}^{\cos \left ( x \right ) }} \right \} \] Mathematica raw input

DSolve[y'[x] == Sin[x]*(2*Sec[x]^2 - y[x]),y[x],x]

Mathematica raw output

{{y[x] -> E^Cos[x]*C[1] + 2*E^Cos[x]*ExpIntegralEi[-Cos[x]] + 2*Sec[x]}}

Maple raw input

dsolve(diff(y(x),x) = sin(x)*(2*sec(x)^2-y(x)), y(x),'implicit')

Maple raw output

y(x) = (Int(4*sin(x)/(cos(2*x)+1)*exp(-cos(x)),x)+_C1)*exp(cos(x))