Bernoulli Equation
1. **State the problem:** Solve the differential equation $$x\,dy + (y - y^2 x \ln x)\,dx = 0.$$\n\n2. **Rewrite the equation:** We have $$x\,dy + (y - y^2 x \ln x)\,dx = 0,$$ which can be rearranged as $$x\,dy = - (y - y^2 x \ln x)\,dx.$$\n\n3. **Divide both sides by $x$ to isolate $dy$:** $$dy = - \frac{y - y^2 x \ln x}{x} dx = - \left( \frac{y}{x} - y^2 \ln x \right) dx.$$\n\n4. **Rewrite as:** $$\frac{dy}{dx} = - \frac{y}{x} + y^2 \ln x.$$\n\n5. **Recognize the equation type:** This is a Bernoulli differential equation of the form $$\frac{dy}{dx} + P(x) y = Q(x) y^n,$$ where $$P(x) = \frac{1}{x}, \quad Q(x) = \ln x, \quad n=2.$$\n\n6. **Use substitution:** Let $$v = y^{1-n} = y^{-1}.$$ Then $$\frac{dv}{dx} = - y^{-2} \frac{dy}{dx}.$$\n\n7. **Express $\frac{dy}{dx}$ in terms of $v$:** $$\frac{dy}{dx} = - y^2 \frac{dv}{dx}.$$\n\n8. **Substitute into the original equation:** $$- y^2 \frac{dv}{dx} + \frac{1}{x} y = \ln x \, y^2.$$\n\nDivide both sides by $y^2$ (assuming $y \neq 0$): $$- \frac{dv}{dx} + \frac{1}{x} \frac{1}{y} = \ln x.$$\n\nRecall $v = y^{-1}$, so $$\frac{1}{y} = v,$$ thus: $$- \frac{dv}{dx} + \frac{v}{x} = \ln x.$$\n\n9. **Rewrite:** $$\frac{dv}{dx} - \frac{v}{x} = - \ln x.$$\n\n10. **Solve the linear ODE for $v$:** The integrating factor is $$\mu(x) = e^{-\int \frac{1}{x} dx} = e^{-\ln x} = x^{-1}.$$\n\nMultiply both sides by $x^{-1}$: $$x^{-1} \frac{dv}{dx} - x^{-2} v = - x^{-1} \ln x.$$\n\nThis is equivalent to $$\frac{d}{dx} \left( x^{-1} v \right) = - x^{-1} \ln x.$$\n\n11. **Integrate both sides:** $$x^{-1} v = - \int x^{-1} \ln x \, dx + C.$$\n\n12. **Compute the integral:** Use integration by parts with $$u = \ln x, \quad dv = \frac{1}{x} dx.$$ Then $$du = \frac{1}{x} dx, \quad v = \ln x.$$\n\nActually, better to set $$u = (\ln x)^2, dv = dx$$ is incorrect. Instead, use substitution: $$I = \int \frac{\ln x}{x} dx.$$\n\nLet $$t = \ln x \Rightarrow dt = \frac{1}{x} dx,$$ so $$I = \int t dt = \frac{t^2}{2} + C = \frac{(\ln x)^2}{2} + C.$$\n\n13. **Substitute back:** $$x^{-1} v = - \frac{(\ln x)^2}{2} + C.$$\n\n14. **Solve for $v$:** $$v = x \left( C - \frac{(\ln x)^2}{2} \right).$$\n\n15. **Recall substitution:** $$v = y^{-1},$$ so $$y = \frac{1}{v} = \frac{1}{x \left( C - \frac{(\ln x)^2}{2} \right)} = \frac{1}{C x - \frac{x (\ln x)^2}{2}}.$$\n\n**Final answer:** $$\boxed{y = \frac{1}{C x - \frac{x (\ln x)^2}{2}}}.$$