##### 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 Classiﬁcation

[_Bernoulli]

Book solution method
Change of Variable, Two new variables

Mathematica
cpu = 1.16391 (sec), leaf count = 69

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

Maple
cpu = 1.915 (sec), leaf count = 125

$\left [y \left (x \right ) = \frac {\left (2 a +\cos \left (x \right )+1\right )^{\frac {1}{a}} \left (1+\cos \left (x \right )\right )^{-\frac {1}{a}}}{\cos \left (x \right ) \left (\int \frac {2 \left (1+\cos \left (x \right )\right )^{-\frac {1}{a}} \left (2 a +\cos \left (x \right )+1\right )^{\frac {1}{a}} \tan \left (\frac {x}{2}\right )}{\left (1+\cos \left (x \right )\right ) \left (2 a +\cos \left (x \right )+1\right )}d x \right )+\textit {\_C1} \cos \left (x \right )+\int \frac {2 \left (1+\cos \left (x \right )\right )^{-\frac {1}{a}} \left (2 a +\cos \left (x \right )+1\right )^{\frac {1}{a}} \tan \left (\frac {x}{2}\right )}{\left (1+\cos \left (x \right )\right ) \left (2 a +\cos \left (x \right )+1\right )}d x +\textit {\_C1}}\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)*(a + Cos[x/2]^2)^a^(-1))/((1 + a)*C[1]*Cos[x/2]^(2 + 2/a) + (
a + Cos[x/2]^2)^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))

Maple raw output

[y(x) = (2*a+cos(x)+1)^(1/a)/((1+cos(x))^(1/a))/(cos(x)*Int(2/((1+cos(x))^(1/a))
/(1+cos(x))*(2*a+cos(x)+1)^(1/a)*tan(1/2*x)/(2*a+cos(x)+1),x)+_C1*cos(x)+Int(2/(
(1+cos(x))^(1/a))/(1+cos(x))*(2*a+cos(x)+1)^(1/a)*tan(1/2*x)/(2*a+cos(x)+1),x)+_
C1)]