4.9.13 \(\left (a+\cos ^2\left (\frac {x}{2}\right )\right ) y'(x)=y(x) \tan \left (\frac {x}{2}\right ) \left (a-y(x)+\cos ^2\left (\frac {x}{2}\right )+1\right )\)

ODE
\[ \left (a+\cos ^2\left (\frac {x}{2}\right )\right ) y'(x)=y(x) \tan \left (\frac {x}{2}\right ) \left (a-y(x)+\cos ^2\left (\frac {x}{2}\right )+1\right ) \] ODE Classification

[_Bernoulli]

Book solution method
Change of Variable, Two new variables

Mathematica
cpu = 0.377655 (sec), leaf count = 63

\[\left \{\left \{y(x)\to \frac {(a+1) (2 a+\cos (x)+1)^{\frac {1}{a}}}{(a+1) c_1 \cos ^{\frac {2}{a}+2}\left (\frac {x}{2}\right )+\sin ^2\left (\frac {x}{2}\right ) (2 a+\cos (x)+1)^{\frac {1}{a}}}\right \}\right \}\]

Maple
cpu = 1.013 (sec), leaf count = 87

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

DSolve[(a + Cos[x/2]^2)*y'[x] == Tan[x/2]*(1 + a + Cos[x/2]^2 - y[x])*y[x],y[x],x]

Mathematica raw output

{{y[x] -> ((1 + a)*(1 + 2*a + Cos[x])^a^(-1))/((1 + a)*C[1]*Cos[x/2]^(2 + 2/a) +
 (1 + 2*a + Cos[x])^a^(-1)*Sin[x/2]^2)}}

Maple raw input

dsolve(diff(y(x),x)*(a+cos(1/2*x)^2) = y(x)*tan(1/2*x)*(1+a+cos(1/2*x)^2-y(x)), y(x),'implicit')

Maple raw output

1/y(x)-(Int(1/(cos(1/2*x)^(1/a))^2/cos(1/2*x)^2*(a+cos(1/2*x)^2)^(1/a)/(a+cos(1/
2*x)^2)*tan(1/2*x),x)+_C1)*(cos(1/2*x)^(1/a))^2*cos(1/2*x)^2/((a+cos(1/2*x)^2)^(
1/a)) = 0