4.3.15 \(x \left (\sin (2 y(x))-x^2 \cos ^2(y(x))\right )+y'(x)=0\)

ODE
\[ x \left (\sin (2 y(x))-x^2 \cos ^2(y(x))\right )+y'(x)=0 \] ODE Classification

[`y=_G(x,y')`]

Book solution method
Change of Variable, new dependent variable

Mathematica
cpu = 0.477031 (sec), leaf count = 55

\[\left \{\left \{y(x)\to \tan ^{-1}\left (\frac {1}{2} \left (x^2-8 c_1 e^{-x^2}-1\right )\right )\right \},\left \{y(x)\to -\tan ^{-1}\left (-\frac {x^2}{2}+4 c_1 e^{-x^2}+\frac {1}{2}\right )\right \}\right \}\]

Maple
cpu = 1.285 (sec), leaf count = 21

\[\left [y \left (x \right ) = \arctan \left (\frac {{\mathrm e}^{-x^{2}} \textit {\_C1}}{2}+\frac {x^{2}}{2}-\frac {1}{2}\right )\right ]\] Mathematica raw input

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

Mathematica raw output

{{y[x] -> ArcTan[(-1 + x^2 - (8*C[1])/E^x^2)/2]}, {y[x] -> -ArcTan[1/2 - x^2/2 +
 (4*C[1])/E^x^2]}}

Maple raw input

dsolve(diff(y(x),x)+x*(sin(2*y(x))-x^2*cos(y(x))^2) = 0, y(x))

Maple raw output

[y(x) = arctan(1/2/exp(x^2)*_C1+1/2*x^2-1/2)]