4.5.4 \(x y'(x)=y(x)-x \cos ^2\left (\frac {y(x)}{x}\right )\)

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

[[_homogeneous, `class A`], _dAlembert]

Book solution method
Homogeneous equation

Mathematica
cpu = 0.0245053 (sec), leaf count = 17

\[\left \{\left \{y(x)\to x \tan ^{-1}\left (2 c_1-\log (x)\right )\right \}\right \}\]

Maple
cpu = 0.012 (sec), leaf count = 26

\[ \left \{ -{\it \_C1}+{1\sin \left ({\frac {y \relax (x ) }{x}} \right ) \left (\cos \left ({\frac {y \relax (x ) }{x}} \right ) \right ) ^{-1}}+\ln \relax (x ) =0 \right \} \] Mathematica raw input

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

Mathematica raw output

{{y[x] -> x*ArcTan[2*C[1] - Log[x]]}}

Maple raw input

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

Maple raw output

-_C1+1/cos(y(x)/x)*sin(y(x)/x)+ln(x) = 0