Rewriting:
\[
\frac{dy}{dx} + \frac{2y}{x} = x.
\]
This is a linear first-order differential equation. Using the integrating factor \( IF = e^{\int \frac{2}{x} dx} = x^2 \), the solution is:
\[
y \cdot x^2 = \int x^3 dx = \frac{x^4}{4} + C.
\]
Thus, the general solution is:
\[
y = \frac{x^2}{4} + \frac{C}{x^2}.
\]