4.2.21 \(y'(x)=y(x) (a+b y(x) \cos (k x))\)

ODE
\[ y'(x)=y(x) (a+b y(x) \cos (k x)) \] ODE Classification

[_Bernoulli]

Book solution method
The Bernoulli ODE

Mathematica
cpu = 0.0492755 (sec), leaf count = 57

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

Maple
cpu = 0.016 (sec), leaf count = 54

\[ \left \{ \left ( y \left ( x \right ) \right ) ^{-1}+{\frac {b{{\rm e}^{ax}} \left ( \cos \left ( kx \right ) a+k\sin \left ( kx \right ) \right ) -{\it \_C1}\, \left ( {a}^{2}+{k}^{2} \right ) }{ \left ( {a}^{2}+{k}^{2} \right ) {{\rm e}^{ax}}}}=0 \right \} \] Mathematica raw input

DSolve[y'[x] == y[x]*(a + b*Cos[k*x]*y[x]),y[x],x]

Mathematica raw output

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

Maple raw input

dsolve(diff(y(x),x) = (a+b*y(x)*cos(k*x))*y(x), y(x),'implicit')

Maple raw output

1/y(x)+(b*exp(a*x)*(cos(k*x)*a+k*sin(k*x))-_C1*(a^2+k^2))/(a^2+k^2)/exp(a*x) = 0