Solution (source code)

= Solution

For $x\ne0$, divide by $x^2$ to obtain the <linear ordinary differential equation> $y'+3y/x=x^{-2}$. An <integrating factor> is $x^3$ on either interval not containing zero. Thus $(x^3y)'=x$ and
$$
\boxed{y(x)=\frac1{2x}+\frac{C}{x^3},\qquad x>0\ \text{or}\ x<0.}
$$
Substituting gives $x^2y'+3xy=1$ directly. No classical solution can include $x=0$, since the original equation there would assert $0=1$; constants on the two separate intervals need not agree.