Problem 265
Medium Further Methods

Show that the equation y(2x-y+2) dx+2(x-y) dy=0 has an…

Show that the equation \[ y(2x-y+2)\,dx+2(x-y)\,dy=0 \] has an integrating factor of the form \(\mu=\mu(x)\), and find its general integral.

Explanation of Method

The source's own derivation (step 8) already checks its final answer against the original equation and is plausible; here every stage is independently re-derived and checked with Sympy rather than trusted: the non-exactness of \(M,N\); the ratio \((M_y-N_x)/N\) that must depend on \(x\) alone for \(\mu(x)\) to exist; the resulting \(\mu(x)=e^x\); the potential \(F(x,y)=e^x(2xy-y^2)\); and, finally, implicit differentiation of \(F(x,y)=C\) to confirm it reproduces the exact original (non-multiplied) equation.

1. Confirm non-exactness and the integrating-factor test

With \(M=y(2x-y+2)=2xy-y^2+2y\) and \(N=2(x-y)=2x-2y\), Sympy computes \(M_y=2x-2y+2\), \(N_x=2\), so \(M_y-N_x=2x-2y\ne0\): not exact. The ratio \[ \frac{M_y-N_x}{N}=\frac{2x-2y}{2(x-y)}=1 \] is a (trivially constant, hence \(x\)-only) function of \(x\), so an integrating factor \(\mu(x)\) exists, and Sympy confirms this ratio simplifies to exactly \(1\), matching the source.

2. Solve for \(\mu(x)\) and verify exactness after multiplying

\(\mu'/\mu=1\Rightarrow\mu(x)=e^x\) (taking the integration constant to \(0\), as is standard for an integrating factor, which is only ever unique up to a constant multiple). Sympy then expands \(\tilde M=e^xy(2x-y+2)\), \(\tilde N=2e^x(x-y)\) and confirms \(\partial_y\tilde M-\partial_x\tilde N\) simplifies to exactly \(0\): the multiplied equation is exact.

3. Recover the potential \(F(x,y)\) and verify it in both partials

Sympy confirms directly (not just by the source's forward integration-then-differentiation argument) that for \(F(x,y)=e^x(2xy-y^2)\), \[ F_x-\tilde M = 0 \qquad\text{and}\qquad F_y-\tilde N = 0 \] identically — both partials match simultaneously, which is the actual defining property of a potential function (stronger than checking just one partial and inferring the other).

4. Implicit-differentiate \(F=C\) and recover the ORIGINAL (un-multiplied) equation

Treating \(y\) as a function of \(x\) in \(F(x,y(x))=C\), Sympy computes \(dF/dx\) symbolically and divides out the common factor \(e^x\); the remaining expression is linear in \(y'\) and, after full expansion, reduces exactly to \(y(2x-y+2)+2(x-y)y'=0\) — precisely the original differential equation \(M\,dx+N\,dy=0\) in its un-multiplied form (as it must, since multiplying by \(\mu(x)\ne0\) does not change the solution curves). This closes the loop the source's own step 8 already substantially completed by hand; here it is confirmed symbolically.


Result

Final answer:

All parts of the source's derivation are confirmed correct by independent Sympy computation.

Integrating factor: \[ \boxed{\ \mu(x) = e^x\ } \] General integral (confirmed by Sympy to reproduce the original ODE under implicit differentiation): \[ \boxed{\ e^x\big(2xy-y^2\big) = C\ }\qquad\text{equivalently}\qquad \boxed{\ y(2x-y) = Ce^{-x}\ } \] where \(C\) is an arbitrary constant.