The differential equation is provided as: \[ \frac{dy}{dx} = \frac{y}{x}. \] This is a separable differential equation. It can be rewritten as: \[ \frac{dy}{y} = \frac{dx}{x}. \] Integrating both sides yields: \[ \int \frac{1}{y} dy = \int \frac{1}{x} dx, \] which simplifies to \[ \ln |y| = \ln |x| + C. \] Exponentiating both sides gives: \[ |y| = e^{\ln |x| + C} = |x| e^C. \] Therefore, \( y = Cx \). Applying the initial condition \( y(1) = 2 \): \[ 2 = C(1) \quad \Rightarrow \quad C = 2. \] The resulting solution is \( y = 2x \).