4.11.12 \(x y(x) y'(x)=a x^3 \cos (x)+y(x)^2\)

ODE
\[ x y(x) y'(x)=a x^3 \cos (x)+y(x)^2 \] ODE Classification

[[_homogeneous, `class D`], _Bernoulli]

Book solution method
The Bernoulli ODE

Mathematica
cpu = 0.0227668 (sec), leaf count = 38

\[\left \{\left \{y(x)\to -x \sqrt {2 a \sin (x)+c_1}\right \},\left \{y(x)\to x \sqrt {2 a \sin (x)+c_1}\right \}\right \}\]

Maple
cpu = 0.008 (sec), leaf count = 22

\[ \left \{ -2\,\sin \relax (x ) {x}^{2}a-{x}^{2}{\it \_C1}+ \left (y \relax (x ) \right ) ^{2}=0 \right \} \] Mathematica raw input

DSolve[x*y[x]*y'[x] == a*x^3*Cos[x] + y[x]^2,y[x],x]

Mathematica raw output

{{y[x] -> -(x*Sqrt[C[1] + 2*a*Sin[x]])}, {y[x] -> x*Sqrt[C[1] + 2*a*Sin[x]]}}

Maple raw input

dsolve(x*y(x)*diff(y(x),x) = a*x^3*cos(x)+y(x)^2, y(x),'implicit')

Maple raw output

-2*sin(x)*x^2*a-x^2*_C1+y(x)^2 = 0