We are given a differential equation. Let us solve it step by step.
Step 1: Rewrite the equation.
The given differential equation is:
\[
\frac{dx}{dy} - \frac{x}{y} = 2y
\]
This is a first-order linear differential equation of the form:
\[
\frac{dx}{dy} + P(y)x = Q(y),
\]
where \(P(y) = -\frac{1}{y}\) and \(Q(y) = 2y\).
Step 2: Find the integrating factor (IF).
The integrating factor for a linear differential equation is given by:
\[
\text{Integrating Factor} = e^{\int P(y) \, dy}.
\]
Here, \(P(y) = -\frac{1}{y}\), so:
\[
\text{Integrating Factor} = e^{\int -\frac{1}{y} \, dy} = e^{-\ln|y|} = \frac{1}{y}.
\]
Step 3: Solve the equation.
Multiply the entire differential equation by the integrating factor \(\frac{1}{y}\):
\[
\frac{1}{y} \frac{dx}{dy} - \frac{x}{y^2} = \frac{2y}{y}.
\]
This simplifies to:
\[
\frac{d}{dy}\left(\frac{x}{y}\right) = 2.
\]
Now integrate both sides with respect to \(y\):
\[
\frac{x}{y} = \int 2 \, dy.
\]
Step 4: Integrate.
The integral of \(2 \, dy\) is:
\[
\frac{x}{y} = 2y + C,
\]
where \(C\) is the constant of integration.
Step 5: Solve for \(x\).
Multiply through by \(y\) to isolate \(x\):
\[
x = 2y^2 + Cy.
\]
Final Answer:
The solution to the given differential equation is:
\[
\boxed{x = 2y^2 + Cy.}
\]