Solution (source code)

= Solution

Use the <slope substitution for equations involving x y'-y>: put $v=y/x$ on the positive interval containing the initial point. Then $xy'-y=x^2v'$, so $x^2v'=\cot v$. Near $v(1)=\pi/4$, separating variables gives $\tan v\,dv=dx/x^2$. Integration yields $\ln|\cos v|=1/x+C$. The initial value fixes the sign and constant, giving
$$
\cos\frac yx=\frac1{\sqrt2}e^{1/x-1}.
$$
Choose the <inverse cosine> branch that agrees with $v(1)=\pi/4$. The solution is
$$
\boxed{y(x)=x\arccos\left(\frac{e^{1/x-1}}{\sqrt2}\right),\qquad x>\frac1{1+\tfrac12\ln2}.}
$$
On this interval the argument lies strictly between zero and one and the original cotangent is defined. At the finite lower endpoint, $v\to0$ and the cotangent becomes singular, so that endpoint is excluded from the maximal interval of the <initial value problem>. The slope substitution here is valid without classifying the original equation as homogeneous in the usual $y'=F(y/x)$ sense.