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.291113 (sec), leaf count = 17

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

Maple
cpu = 0.022 (sec), leaf count = 12

\[[y \left (x \right ) = -\arctan \left (\ln \left (x \right )+\textit {\_C1} \right ) x]\] 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))

Maple raw output

[y(x) = -arctan(ln(x)+_C1)*x]