Check if the equation is exact, which happens for ODEs of the form
![M(x,y)\,\mathrm dx+N(x,y)\,\mathrm dy=0](https://img.qammunity.org/2021/formulas/mathematics/college/5vbvp8us7olhhi4q4mfvjsduntoui9h6ph.png)
if
.
We have
![M(x,y)=x^2+y^2+x\implies(\partial M)/(\partial y)=2y](https://img.qammunity.org/2021/formulas/mathematics/college/8dyo7mgxrg9jlbb16nlazp1pdoglzdmfq9.png)
![N(x,y)=xy\implies(\partial N)/(\partial x)=y](https://img.qammunity.org/2021/formulas/mathematics/college/d2tnni2p9kl4ahvv649kfbfp94kmlwfc20.png)
so the ODE is not quite exact, but we can find an integrating factor
so that
![\mu(x,y)M(x,y)\,\mathrm dx+\mu(x,y)N(x,y)\,\mathrm dy=0](https://img.qammunity.org/2021/formulas/mathematics/college/dmwtp14g7pw7aljzn63hx7m1f42owoz8c5.png)
is exact, which would require
![(\partial(\mu M))/(\partial y)=(\partial(\mu N))/(\partial x)\implies (\partial\mu)/(\partial y)M+\mu(\partial M)/(\partial y)=(\partial\mu)/(\partial x)N+\mu(\partial N)/(\partial x)](https://img.qammunity.org/2021/formulas/mathematics/college/87e0loa34m7m5x4cg4zexz6zf5vj7cwrav.png)
![\implies\mu\left((\partial N)/(\partial x)-(\partial M)/(\partial y)\right)=M(\partial\mu)/(\partial y)-N(\partial\mu)/(\partial x)](https://img.qammunity.org/2021/formulas/mathematics/college/bwgiyq6e5pdvdbfx49tfctz8nhdqyvfx7y.png)
Notice that
![(\partial N)/(\partial x)-(\partial M)/(\partial y)=y-2y=-y](https://img.qammunity.org/2021/formulas/mathematics/college/zus2q74d6c3ac7xn3cxq7h1skq09h68uva.png)
is independent of x, and dividing this by
gives an expression independent of y. If we assume
is a function of x alone, then
, and the partial differential equation above gives
![-\mu y=-xy(\mathrm d\mu)/(\mathrm dx)](https://img.qammunity.org/2021/formulas/mathematics/college/19blmlz1giezq3xj5u1bfdjqw7duqpcgud.png)
which is separable and we can solve for
easily.
![-\mu=-x(\mathrm d\mu)/(\mathrm dx)](https://img.qammunity.org/2021/formulas/mathematics/college/5izjpfm8yffim0qpx2h96jqhi3s5udcf62.png)
![\frac{\mathrm d\mu}\mu=\frac{\mathrm dx}x](https://img.qammunity.org/2021/formulas/mathematics/college/8m9xo7e0eq9euock3ytvnn3kaz4fs0rdam.png)
![\ln|\mu|=\ln|x|](https://img.qammunity.org/2021/formulas/mathematics/college/q31ou1fmm4zvpapvq20cjd50m8kzjpywwn.png)
![\implies \mu=x](https://img.qammunity.org/2021/formulas/mathematics/college/ezdqvc9z7s52mpjf55cyv6kn04m4h4q4vd.png)
So, multiply the original ODE by x on both sides:
![(x^3+xy^2+x^2)\,\mathrm dx+x^2y\,\mathrm dy=0](https://img.qammunity.org/2021/formulas/mathematics/college/8zzqdt5c9lli5z5hzc3qtw8jrjk4khk5pl.png)
Now
![(\partial(x^3+xy^2+x^2))/(\partial y)=2xy](https://img.qammunity.org/2021/formulas/mathematics/college/2g5j93cmrjrday3r8q85es8ud22gwi8tax.png)
![(\partial(x^2y))/(\partial x)=2xy](https://img.qammunity.org/2021/formulas/mathematics/college/f6mv0prb1uu50zqqapmuusie7ffv6cub2v.png)
so the modified ODE is exact.
Now we look for a solution of the form
, with differential
![\mathrm dF=(\partial F)/(\partial x)\,\mathrm dx+(\partial F)/(\partial y)\,\mathrm dy=0](https://img.qammunity.org/2021/formulas/mathematics/college/sk4obc3uymcq47gz62g03tiwouaff4fryx.png)
The solution F satisfies
![(\partial F)/(\partial x)=x^3+xy^2+x^2](https://img.qammunity.org/2021/formulas/mathematics/college/xn759l9d4m7h3ngaryf599j40avobc3ep9.png)
![(\partial F)/(\partial y)=x^2y](https://img.qammunity.org/2021/formulas/mathematics/college/ahsf2ohcn3ka83dep7kzh6qhyjopu2a9tw.png)
Integrating both sides of the first equation with respect to x gives
![F(x,y)=\frac{x^4}4+\frac{x^2y^2}2+\frac{x^3}3+f(y)](https://img.qammunity.org/2021/formulas/mathematics/college/xyh7o99y0h8k6bii4ibnnxkju1kq1ubi7v.png)
Differentiating both sides with respect to y gives
![(\partial F)/(\partial y)=x^2y+(\mathrm df)/(\mathrm dy)=x^2y](https://img.qammunity.org/2021/formulas/mathematics/college/myvhhd3atwfqucm91lthirus79ofp27trf.png)
![\implies(\mathrm df)/(\mathrm dy)=0\implies f(y)=C](https://img.qammunity.org/2021/formulas/mathematics/college/6zvpmdx2zyzg7lkc6m0dg939lo6wqg6gmd.png)
So the solution to the ODE is
![F(x,y)=C\iff \frac{x^4}4+\frac{x^2y^2}2+\frac{x^3}3+C=C](https://img.qammunity.org/2021/formulas/mathematics/college/ylv0op3zzjwc6oe6r9gyeupwy7ez51i3wg.png)
![\implies\boxed{\frac{x^4}4+\frac{x^2y^2}2+\frac{x^3}3=C}](https://img.qammunity.org/2021/formulas/mathematics/college/dhhn9w6xdz1u2ptw1q84z2f4cjmsxtbz7o.png)