Answer
$$ y= x^2\ln x+Cx^2$$
Work Step by Step
Given $$x y^{\prime}-2 y=x^{2}, \quad x>0$$
Rewrite the equation
$$ y'- \frac{2}{x} y= x $$
Since the equation is linear and $p(x)= \dfrac{-2}{x} $ and $q(x)=x$, then
\begin{align*}
\mu &=e^{\int p(x)}dx\\
&= e^{\int (-2/x)dx}\\
&=e^{-2\ln x}\\
&= x^{-2}
\end{align*}
Hence the general solution given by
\begin{align*}
\mu(x)y&=\int \mu(x)q(x)dx\\
x^{-2} y&= \int x^{-2} xdx\ \ \ \\
&= \ln x+C
\end{align*}
Then
$$ y= x^2\ln x+Cx^2$$