4.2.24 $$y'(x)=y(x) \sec (x)+(\sin (x)-1)^2$$

ODE
$y'(x)=y(x) \sec (x)+(\sin (x)-1)^2$ ODE Classiﬁcation

[_linear]

Book solution method
The Bernoulli ODE

Mathematica
cpu = 0.581444 (sec), leaf count = 50

$\left \{\left \{y(x)\to -\frac {1}{4} e^{2 \tanh ^{-1}\left (\tan \left (\frac {x}{2}\right )\right )} \left (\cos (2 x)-4 \left (-3 \sin (x)+8 \log \left (\sin \left (\frac {x}{2}\right )+\cos \left (\frac {x}{2}\right )\right )+c_1\right )\right )\right \}\right \}$

Maple
cpu = 0.208 (sec), leaf count = 35

$\left [y \left (x \right ) = \left (-\frac {\left (\cos ^{2}\left (x \right )\right )}{2}-3 \sin \left (x \right )+4 \ln \left (\cos \left (x \right )\right )+4 \ln \left (\sec \left (x \right )+\tan \left (x \right )\right )+\textit {\_C1} \right ) \left (\sec \left (x \right )+\tan \left (x \right )\right )\right ]$ Mathematica raw input

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

Mathematica raw output

{{y[x] -> -1/4*(E^(2*ArcTanh[Tan[x/2]])*(Cos[2*x] - 4*(C[1] + 8*Log[Cos[x/2] + S
in[x/2]] - 3*Sin[x])))}}

Maple raw input

dsolve(diff(y(x),x) = y(x)*sec(x)+(sin(x)-1)^2, y(x))

Maple raw output

[y(x) = (-1/2*cos(x)^2-3*sin(x)+4*ln(cos(x))+4*ln(sec(x)+tan(x))+_C1)*(sec(x)+ta
n(x))]