Solve the differential equation 2x^2yy' + y^2 - 2x^3 - x^2 = 0
Solve the differential equation $2x^2yy' + y^2 - 2x^3 - x^2 = 0$.
Explanation of Method
Written in differential form \((2x^3+x^2-y^2)\,dx-2x^2y\,dy=0\), the equation is not exact, but admits an integrating factor \(\mu(x)=e^{-1/x}/x^2\) depending on \(x\) alone. Multiplying through by \(\mu\) makes the equation exact, and the potential function \(F(x,y)\) is recovered by integration (\texttt{sympy.integrate}, cross-checked by hand) and then confirmed by implicit differentiation, reproducing the original equation exactly.
Step 1: Differential form and exactness test
Rearranging: \((2x^3+x^2-y^2)\,dx-2x^2y\,dy=0\), so \(M=2x^3+x^2-y^2\), \(N=-2x^2y\). Then \(M_y=-2y\) and \(N_x=-4xy\), which are unequal, so the equation is not exact.
Step 2: Find the integrating factor \(\mu(x)\)
\texttt{sympy.simplify} confirms \[ \frac{M_y-N_x}{N}=\frac{-2y+4xy}{-2x^2y}=\frac{1-2x}{x^2}, \] a function of \(x\) alone, so \(\mu(x)\) exists with \(\mu'/\mu=(1-2x)/x^2=1/x^2-2/x\). Integrating, \(\ln|\mu|=-1/x-2\ln|x|\), so \[ \mu(x)=\frac{e^{-1/x}}{x^2}. \]
Step 3: Multiply through and confirm exactness
Multiplying \(M,N\) by \(\mu\) gives \[ \tilde M=\mu M=e^{-1/x}\Big(2x+1-\frac{y^2}{x^2}\Big),\qquad \tilde N=\mu N=-2ye^{-1/x}. \] \texttt{sympy} confirms \(\tilde M_y-\tilde N_x=0\) identically, so the equation is now exact.
Step 4: Find the potential function \(F(x,y)\)
Integrating \(\tilde N\) with respect to \(y\) (holding \(x\) fixed) is the easier route: \[ F(x,y)=\int \tilde N\,dy = -y^2e^{-1/x}+h(x). \] Requiring \(F_x=\tilde M\) gives \[ -y^2\cdot\frac{e^{-1/x}}{x^2}+h'(x)=e^{-1/x}(2x+1)-\frac{y^2e^{-1/x}}{x^2} \ \Longrightarrow\ h'(x)=(2x+1)e^{-1/x}. \] \texttt{sympy.integrate((2*x+1)*sp.exp(-1/x), x)} returns \(h(x)=x^2e^{-1/x}\) (independently checked by hand: \(\frac{d}{dx}[x^2e^{-1/x}]=2xe^{-1/x}+x^2\cdot \frac{1}{x^2}e^{-1/x}=(2x+1)e^{-1/x}\), matching \(h'(x)\) exactly). Hence \[ F(x,y)=-y^2e^{-1/x}+x^2e^{-1/x}=(x^2-y^2)e^{-1/x}. \]
Step 5: General solution and independent verification
The implicit solution is \((x^2-y^2)e^{-1/x}=C\). Differentiating implicitly: \[ (2x-2yy')e^{-1/x}+(x^2-y^2)e^{-1/x}\cdot\frac{1}{x^2}=0. \] Dividing by \(e^{-1/x}\) and multiplying by \(x^2\): \[ 2x^3-2x^2yy'+x^2-y^2=0\ \Longrightarrow\ 2x^2yy'+y^2-2x^3-x^2=0, \] exactly the original equation. \texttt{sympy} (implicit differentiation via \texttt{sp.Function('y')(x)}, eliminating \(C\)) confirms the residual is identically \(0\), and a numerical ODE integration cross-check agrees to within integrator tolerance. This is a genuine, verified closed-form solution.
Result
Final answer:
The source's own derivation of the integrating factor \(\mu=e^{-1/x}/x^2\) (its Step 3) was correct, but it then abandoned that path and cycled through three unverified, mutually contradictory guesses before giving up. Carrying the exact-equation method through to completion gives the genuine closed-form solution, confirmed by implicit differentiation to reproduce the original equation exactly: \[ \boxed{\,(x^2-y^2)e^{-1/x}=C\,} \] equivalently \(x^2-y^2=Ce^{1/x}\), where \(C\) is an arbitrary constant.