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.233496 (sec), leaf count = 28

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

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

\[\left [y \left (x \right ) = \left (\int \frac {4 \,{\mathrm e}^{-\cos \left (x \right )} \sin \left (x \right )}{\cos \left (2 x \right )+1}d x +\textit {\_C1} \right ) {\mathrm 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))

Maple raw output

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