Problem 225
Medium Trajectories

Solve the differential equation (x^2y^2+x)y' + y = 0

Solve the differential equation $(x^2y^2+x)y' + y = 0$.

Explanation of Method

Neither \(\mu(x)\) nor \(\mu(y)\) works as a simple integrating factor. Writing the equation with \(x\) as a function of \(y\) instead exposes \(d(xy)+ (xy)^2\,dy=0\); substituting \(u=xy\) turns this into the separable equation \(du/dy=-u^2\). The key substitution step is verified independently (by rewriting the original equation for \(dx/dy\) and computing \(du/dy\) directly), and the final answer is confirmed by full implicit differentiation and a numerical ODE check, since the source's own attempted verification never actually finished.

Step 1: Exactness and integrating-factor tests fail

In the form \(y\,dx+x(xy^2+1)\,dy=0\), \(M=y\), \(N=x^2y^2+x\): \(M_y=1\), \(N_x=2xy^2+1\), not exact. \texttt{sympy.simplify} confirms \((N_x-M_y)/M=2xy\) (depends on both \(x,y\)) and \((M_y-N_x)/N=-2y^2/(xy^2+1)\) (still depends on \(y\)), so no integrating factor of \(x\) alone or \(y\) alone exists — confirming the source's finding.

Step 2: Rewrite with \(x\) as the dependent variable

From the original equation, \(\dfrac{dx}{dy}=-\dfrac{x^2y^2+x}{y}\). Expanding \(y\,dx+x\,dy+x^2y^2\,dy=0\) and noting \(y\,dx+x\,dy=d(xy)\): \[ d(xy)+x^2y^2\,dy=0. \]

Step 3: Substitute \(u=xy\), verified independently

Since \(x^2y^2=(xy)^2=u^2\), the equation becomes \(du+u^2\,dy=0\), i.e. \(du/dy=-u^2\) — provided \(du/dy\) computed directly from \(u=xy\) (with \(x=x(y)\)) actually equals \(-u^2\), which is not automatic and must be checked rather than assumed. Independently: from Step 2, \(dx/dy=-(x^2y^2+x)/y\), so \[ \frac{du}{dy}=y\frac{dx}{dy}+x=y\Big(-\frac{x^2y^2+x}{y}\Big)+x=-x^2y^2-x+x=-x^2y^2=-u^2, \] confirmed symbolically with \texttt{sympy}. The substitution is valid.

Step 4: Solve the separable equation and back-substitute

\[ \frac{du}{u^2}=-dy \ \Longrightarrow\ -\frac1u=-y+C \ \Longrightarrow\ u=\frac{1}{y-C}. \] Since \(u=xy\): \(xy=\dfrac{1}{y-C}\), i.e. \(xy(y-C)=1\), or equivalently \(xy^2=1+Cxy\).

Step 5: Full independent verification (the source's own check trails off unfinished)

The source's step 7 abandons its own verification mid-computation ("this verification is getting complex, but the solution is correct" — without completing it). Redoing it properly: implicitly differentiating \(xy^2-1-Cxy=0\) with \texttt{sp.Function('y')(x)} in \texttt{sympy}, solving for \(y'\), eliminating \(C\) via the same relation, and substituting into \((x^2y^2+x)y'+y\) gives a residual that \texttt{sympy.simplify} reduces to \(0\) identically. A numerical cross-check (integrating the original ODE from \(x_0=1,\ y_0=2\) and comparing \(xy^2\) against \(1+Cxy\) along the trajectory) agrees to integrator tolerance at every sampled point. The solution is genuinely confirmed, not merely asserted.


Result

Final answer:

The \(u=xy\) substitution and the final answer are both confirmed correct by independent verification (the source's own attempted check never actually completed): \[ \boxed{\,xy^2=1+Cxy\,} \] equivalently \(xy(y-C)=1\), where \(C\) is an arbitrary constant.