This equation can be solved rigorously by treating it as a Bernoulli equation with x as the dependent variable and y as the independent variable, rather than jumping straight to the stated result.
Step 1: Rewrite in terms of dx/dy.
Starting from \( y\,dx + (x + x^2 y)\,dy = 0 \), divide through by \( dy \) to get \( y \dfrac{dx}{dy} + x + x^2 y = 0 \), and dividing by \( y \) gives \( \dfrac{dx}{dy} + \dfrac{x}{y} = -x^2 \), a Bernoulli equation in \( x \) with degree \( n = 2 \).
Step 2: Apply the Bernoulli substitution.
Let \( v = x^{1-n} = x^{-1} \), so \( \dfrac{dv}{dy} = -x^{-2}\dfrac{dx}{dy} \). Dividing the equation from Step 1 by \( x^2 \) gives \( x^{-2}\dfrac{dx}{dy} + \dfrac{1}{xy} = -1 \), which in terms of \( v \) becomes \( -\dfrac{dv}{dy} + \dfrac{v}{y} = -1 \), i.e. \( \dfrac{dv}{dy} - \dfrac{v}{y} = 1 \).
Step 3: Solve the resulting linear equation.
This is linear in \( v \) with integrating factor \( I(y) = e^{-\int \frac{1}{y}\,dy} = e^{-\ln y} = \dfrac{1}{y} \). Multiplying through and integrating, \( \dfrac{d}{dy}\left(\dfrac{v}{y}\right) = \dfrac{1}{y} \), so \( \dfrac{v}{y} = \ln y + C \), giving \( v = y\ln y + Cy \).
Step 4: Substitute back for x.
Since \( v = \dfrac{1}{x} \), this gives \( \dfrac{1}{x} = y\ln y + Cy \), which rearranges to \( \dfrac{1}{xy} - \ln y = C \), or equivalently \( -\dfrac{1}{xy} + \ln y = c \) after absorbing the sign into the arbitrary constant.
This confirms the solution independently of the shortcut in the main solution.
Therefore, the correct answer is \( -\dfrac{1}{xy} + \ln y = c \).