4.5.6 \(x y'(x)=y(x)-\cot ^2(y(x))\)

ODE
\[ x y'(x)=y(x)-\cot ^2(y(x)) \] ODE Classification

[_separable]

Book solution method
Homogeneous equation

Mathematica
cpu = 2.10224 (sec), leaf count = 49

\[\left \{\left \{y(x)\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {\cos (2 K[1])-1}{K[1] \cos (2 K[1])+\cos (2 K[1])-K[1]+1}dK[1]\& \right ][\log (x)+c_1]\right \}\right \}\]

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

\[\left [\ln \left (x \right )+\textit {\_C1} -\left (\int _{}^{y \left (x \right )}-\frac {1}{\cot ^{2}\left (\textit {\_a} \right )-\textit {\_a}}d \textit {\_a} \right ) = 0\right ]\] Mathematica raw input

DSolve[x*y'[x] == -Cot[y[x]]^2 + y[x],y[x],x]

Mathematica raw output

{{y[x] -> InverseFunction[Inactive[Integrate][(-1 + Cos[2*K[1]])/(1 + Cos[2*K[1]
] - K[1] + Cos[2*K[1]]*K[1]), {K[1], 1, #1}] & ][C[1] + Log[x]]}}

Maple raw input

dsolve(x*diff(y(x),x) = y(x)-cot(y(x))^2, y(x))

Maple raw output

[ln(x)+_C1-Intat(-1/(cot(_a)^2-_a),_a = y(x)) = 0]