To solve the differential equation \( y \, dx + (x + x^2 y) \, dy = 0 \), we can follow these steps:
### Step 1: Rearranging the Equation
We start with the given differential equation:
\[
y \, dx + (x + x^2 y) \, dy = 0
\]
We can rearrange it to isolate the terms involving \( dx \) and \( dy \):
\[
y \, dx + x \, dy + x^2 y \, dy = 0
\]
### Step 2: Dividing by \( x^2 y^2 \)
Next, we divide the entire equation by \( x^2 y^2 \):
\[
\frac{y}{x^2 y^2} \, dx + \frac{x}{x^2 y^2} \, dy + \frac{x^2 y}{x^2 y^2} \, dy = 0
\]
This simplifies to:
\[
\frac{1}{x^2 y} \, dx + \frac{1}{x y^2} \, dy + \frac{1}{y} \, dy = 0
\]
### Step 3: Grouping Terms
We can group the terms involving \( dy \):
\[
\frac{1}{x^2 y} \, dx + \left( \frac{1}{x y^2} + \frac{1}{y} \right) dy = 0
\]
This can be rewritten as:
\[
\frac{1}{x^2 y} \, dx + \left( \frac{1 + x}{x y^2} \right) dy = 0
\]
### Step 4: Identifying the Form
Now, we can identify that this is in the form:
\[
\frac{dx}{dy} = -\frac{(1 + x)}{x^2}
\]
### Step 5: Separating Variables
We separate the variables:
\[
\frac{dx}{1 + x} = -\frac{dy}{y^2}
\]
### Step 6: Integrating Both Sides
Now we integrate both sides:
\[
\int \frac{dx}{1 + x} = -\int \frac{dy}{y^2}
\]
The left side integrates to:
\[
\log |1 + x| + C_1
\]
The right side integrates to:
\[
\frac{1}{y} + C_2
\]
### Step 7: Combining Results
Combining the results, we get:
\[
\log |1 + x| = -\frac{1}{y} + C
\]
where \( C = C_2 - C_1 \).
### Step 8: Exponentiating
Exponentiating both sides gives us:
\[
1 + x = e^{-\frac{1}{y} + C} = e^C e^{-\frac{1}{y}}
\]
Letting \( K = e^C \), we can write:
\[
1 + x = \frac{K}{y}
\]
### Step 9: Final Rearrangement
Rearranging gives us the solution:
\[
xy + x = K
\]
or
\[
xy + x = C
\]
### Final Solution
The solution of the differential equation is:
\[
xy + x = C
\]