To solve the differential equation given by \( y \, dx - x \, dy = x^2 y \, dx \), we will follow these steps:
### Step 1: Rearranging the Equation
We start with the equation:
\[
y \, dx - x \, dy = x^2 y \, dx
\]
We can rearrange this by moving all terms involving \( dy \) to one side and terms involving \( dx \) to the other side:
\[
y \, dx - x^2 y \, dx = x \, dy
\]
Factoring out \( dx \) from the left side gives:
\[
(y - x^2 y) \, dx = x \, dy
\]
### Step 2: Dividing by \( dx \)
Next, we divide both sides by \( dx \):
\[
y - x^2 y = x \frac{dy}{dx}
\]
This simplifies to:
\[
y(1 - x^2) = x \frac{dy}{dx}
\]
### Step 3: Separating Variables
Now we can separate variables:
\[
\frac{dy}{y} = \frac{1 - x^2}{x} \, dx
\]
### Step 4: Integrating Both Sides
We will now integrate both sides:
\[
\int \frac{dy}{y} = \int \left( \frac{1}{x} - x \right) \, dx
\]
The left side integrates to:
\[
\log |y|
\]
The right side can be integrated as follows:
\[
\int \frac{1}{x} \, dx - \int x \, dx = \log |x| - \frac{x^2}{2} + C
\]
### Step 5: Combining Results
Putting it all together, we have:
\[
\log |y| = \log |x| - \frac{x^2}{2} + C
\]
We can express this in a more convenient form:
\[
\log |y| - \log |x| = -\frac{x^2}{2} + C
\]
This can be rewritten using properties of logarithms:
\[
\log \left| \frac{y}{x} \right| = -\frac{x^2}{2} + C
\]
### Step 6: Exponentiating Both Sides
To eliminate the logarithm, we exponentiate both sides:
\[
\frac{y}{x} = e^{-\frac{x^2}{2} + C}
\]
Let \( k = e^C \), then:
\[
y = kx e^{-\frac{x^2}{2}}
\]
### Final Solution
Thus, the solution to the differential equation is:
\[
y = kx e^{-\frac{x^2}{2}}
\]