Problem 138
Hard Exact Equations

Show that (x^2+x^2y+2xy-y^2-y^3) dx+(y^2+xy^2+2xy-x^2-x^3)…

Show that $(x^2+x^2y+2xy-y^2-y^3)\,dx+(y^2+xy^2+2xy-x^2-x^3)\,dy=0$ has an integrating factor of the form $\mu=\mu(x+y)$ or $\mu=\mu(xy)$, and solve it.

Explanation of Method

Carefully recompute $M_y$ and $N_x$ (this is where a naive derivation is prone to sign slips), test $\mu(xy)$ (fails) and $\mu(x+y)$ (succeeds cleanly once $M_y$ is correct), solve the resulting separable ODE by partial fractions, and integrate the exact equation.

Step 1: Compute $M_y-N_x$ carefully

With $M=x^2+x^2y+2xy-y^2-y^3$, $N=y^2+xy^2+2xy-x^2-x^3$:

\[M_y=x^2+2x-3y^2-2y,\qquad N_x=-3x^2-2x+y^2+2y,\]

\[M_y-N_x=4x^2+4x-4y^2-4y=4(x-y)(x+y+1).\]

(A naive product-rule expansion of the factored form $M=(1+y)(x-y)(x+y)+2xy$ can pick up a sign error here — e.g. differentiating $(x-y)(x+y)$ w.r.t.\ $y$ as $(x+y)+(x-y)$ instead of the correct $-2y$ — which is exactly the kind of slip that derails the search for $\mu$ below if not caught.)

Step 2: Test $\mu=\mu(xy)$ — fails

The required ratio is $\dfrac{M_y-N_x}{Ny-Mx}$, which must depend on $p=xy$ alone. Evaluating at $(x,y)=(1,2)$ and $(x,y)=(4,0.5)$ — both with $xy=2$ — gives two different values, so no integrating factor of the form $\mu(xy)$ exists.

Step 3: Test $\mu=\mu(x+y)$ — succeeds

The required ratio is $\dfrac{M_y-N_x}{N-M}$, which must depend on $s=x+y$ alone. Since $N-M=-(1+x)(x-y)(x+y)-(1+y)(x-y)(x+y)=-(x-y)(x+y)(x+y+2)=-(x-y)\,s(s+2)$, and $M_y-N_x=4(x-y)(x+y+1)=4(x-y)(s+1)$, the factor $(x-y)$ cancels:

\[\frac{M_y-N_x}{N-M}=\frac{4(x-y)(s+1)}{-(x-y)\,s(s+2)}=-\frac{4(s+1)}{s(s+2)},\]

a function of $s=x+y$ alone. So $\mu=\mu(x+y)$ exists.

Step 4: Solve for $\mu(s)$

$\dfrac{1}{\mu}\dfrac{d\mu}{ds}=-\dfrac{4(s+1)}{s(s+2)}$. Partial fractions: $-\dfrac{4(s+1)}{s(s+2)}=-\dfrac2s-\dfrac{2}{s+2}$. Integrating, $\ln|\mu|=-2\ln|s|-2\ln|s+2|$, so

\[\mu(s)=\frac{1}{s^2(s+2)^2}=\frac{1}{(x+y)^2(x+y+2)^2}.\]

Step 5: Multiply and verify exactness

$M_1=\mu M$, $N_1=\mu N$. A direct (symbolic) computation confirms $\partial_yM_1=\partial_xN_1$ identically, so the equation is now exact.

Step 6: Find the potential function

Integrating $F_x=M_1$ with respect to $x$ (holding $y$ fixed) gives directly

\[F(x,y)=\frac{-x(y+1)-y}{(x+y)(x+y+2)}=-\frac{xy+x+y}{(x+y)(x+y+2)},\]

and one checks $F_y=N_1$ as well with no extra function of $y$ needed — confirmed symbolically end-to-end (including eliminating the constant from the implicit solution and reproducing $dy/dx=-M/N$ exactly).


Result

Final answer:

\[\boxed{\ xy+x+y=C(x+y)(x+y+2)\ }\]

Cross-check: the equation also happens to admit the independent integrating factor $\mu=1/(x^2+y^2)^2$ (a genuine bonus, though not of the requested form), which yields the potential $xy+x+y=C'(x^2+y^2)$ — a Möbius reparametrization of the same family of solution curves, since $(x+y)(x+y+2)=(x^2+y^2)+2(xy+x+y)$. Both forms were verified symbolically: for each, multiplying $M\,dx+N\,dy$ by the claimed $\mu$ makes it exact, and substituting the implicit solution back (eliminating $C$) reproduces $dy/dx=-M/N$ identically. The source derivation's boxed answer $x^2+y^2+2xy\ln|x+y|=C$ does not satisfy the ODE and is discarded.