Problem 224
Medium Trajectories

Solve the differential equation (2xy^3+y)y' + 2y^2 - 4 = 0

Solve the differential equation $(2xy^3+y)y' + 2y^2 - 4 = 0$.

Explanation of Method

Written as \((4-2y^2)\,dx-(2xy^3+y)\,dy=0\), the equation is not exact, but \((N_x-M_y)/M\) reduces to \(y\), a function of \(y\) alone, giving an integrating factor \(\mu(y)=e^{y^2/2}\). The potential function is then found by integration and the final relation confirmed by implicit differentiation.

Step 1: Exactness test and integrating factor

With \(M=4-2y^2\), \(N=-(2xy^3+y)\): \(M_y=-4y\), \(N_x=-2y^3\), not exact. \texttt{sympy.simplify} confirms \[ \frac{N_x-M_y}{M}=\frac{-2y^3+4y}{4-2y^2}=\frac{2y(2-y^2)}{2(2-y^2)}=y, \] a function of \(y\) alone, so \(\mu(y)=e^{y^2/2}\).

Step 2: Multiply through and confirm exactness

\(\tilde M=(4-2y^2)e^{y^2/2}\), \(\tilde N=-(2xy^3+y)e^{y^2/2}\). \texttt{sympy} confirms \(\tilde M_y=\tilde N_x=-2y^3e^{y^2/2}\), so the equation is now exact.

Step 3: Integrate \(\tilde M\) with respect to \(x\)

\[ F(x,y)=\int(4-2y^2)e^{y^2/2}\,dx=x(4-2y^2)e^{y^2/2}+g(y). \]

Step 4: Determine \(g(y)\)

\texttt{sympy} computes \(\partial_y\big[x(4-2y^2)e^{y^2/2}\big]=-2xy^3e^{y^2/2}\), so requiring \(F_y=\tilde N\) gives \(g'(y)=-ye^{y^2/2}\). Substituting \(u=y^2/2\), \texttt{sympy.integrate} confirms \[ g(y)=-\int ye^{y^2/2}\,dy=-e^{y^2/2}. \]

Step 5: Assemble and simplify the solution

\[ F(x,y)=e^{y^2/2}\big[x(4-2y^2)-1\big]=C_1. \] Dividing by \(e^{y^2/2}\): \[ 4x-2xy^2-1=Ce^{-y^2/2}. \]

Step 6: Independent verification

Implicitly differentiating \(4x-2xy^2-1-Ce^{-y^2/2}=0\) with \texttt{sympy}, solving for \(y'\), eliminating \(C\) using the same relation, and substituting into \((2xy^3+y)y'+2y^2-4\) gives a residual that \texttt{sympy.simplify} reduces to \(0\) identically.


Result

Final answer:

The source's derivation and final relation are confirmed correct by independent \texttt{sympy} verification: \[ \boxed{\,4x-2xy^2-1=Ce^{-y^2/2}\,} \] where \(C\) is an arbitrary constant (equivalently \((4x-2xy^2-1)e^{y^2/2}=C\)).