Answer
$y=2x$
Work Step by Step
We are given that $x \dfrac{dy}{dx}=y$
We will separate the variables to obtain:
$\dfrac{\ dy}{y}=\dfrac{\ dx}{x}$
Integrate to obtain:
$\int \dfrac{\ dy}{y}=\int \dfrac{\ dx}{x}$
This implies that $\ln |y|=\ln |x|+C$
After applying the initial conditions, $y=2$ when $x=1$, we get $C=\ln (2)$
Therefore, we have: $e^{\ln y}=e^{\ln x+\ln 2} \implies y=2x$