To solve the differential equation \( y \, dx - x \, dy + y^2 \sin x \, dx = 0 \), we will follow these steps:
### Step 1: Rearranging the Equation
We start with the given equation:
\[
y \, dx - x \, dy + y^2 \sin x \, dx = 0
\]
We can rearrange this to isolate the \( dy \) term:
\[
y \, dx + y^2 \sin x \, dx = x \, dy
\]
This simplifies to:
\[
(y + y^2 \sin x) \, dx = x \, dy
\]
### Step 2: Dividing by \( x \)
Next, we divide both sides by \( x \):
\[
\frac{y + y^2 \sin x}{x} \, dx = dy
\]
This can be rewritten as:
\[
dy = \frac{y}{x} \, dx + y^2 \sin x \frac{dx}{x}
\]
### Step 3: Rearranging to Linear Form
Now, we rearrange the equation to form a linear differential equation:
\[
\frac{dy}{dx} - \frac{y}{x} = y^2 \sin x \frac{1}{x}
\]
This is now in the standard form of a linear differential equation:
\[
\frac{dy}{dx} + P(x) y = Q(x)
\]
where \( P(x) = -\frac{1}{x} \) and \( Q(x) = \frac{y^2 \sin x}{x} \).
### Step 4: Substituting Variables
To solve this, we can use the substitution \( v = \frac{1}{y} \), which gives us:
\[
-\frac{1}{y^2} \frac{dy}{dx} = \frac{dv}{dx}
\]
Substituting this into our equation, we have:
\[
\frac{dv}{dx} + \frac{v}{x} = \frac{\sin x}{x}
\]
### Step 5: Finding the Integrating Factor
The integrating factor \( \mu(x) \) is given by:
\[
\mu(x) = e^{\int P(x) \, dx} = e^{\int \frac{1}{x} \, dx} = e^{\ln |x|} = |x|
\]
Thus, the integrating factor is \( x \).
### Step 6: Multiplying by the Integrating Factor
Now we multiply the entire equation by \( x \):
\[
x \frac{dv}{dx} + v = \sin x
\]
### Step 7: Integrating
Now we integrate both sides:
\[
\int (x \frac{dv}{dx} + v) \, dx = \int \sin x \, dx
\]
This leads to:
\[
x v = -\cos x + C
\]
### Step 8: Substituting Back for \( y \)
Recalling that \( v = \frac{1}{y} \), we substitute back:
\[
x \cdot \frac{1}{y} = -\cos x + C
\]
Thus,
\[
y = \frac{x}{- \cos x + C}
\]
### Final Result
The solution to the differential equation is:
\[
y \cos x = x + C
\]