The ODE is exact, since
![(\partial(y^2-2xy))/(\partial y)=2y-2x](https://img.qammunity.org/2020/formulas/mathematics/college/ubwykis8e5mfgb1yz6r9um0ko6bqacwe33.png)
![(\partial(2xy-x^2))/(\partial x)=2y-2x](https://img.qammunity.org/2020/formulas/mathematics/college/upz360gt54i8h7fb1fiex75rb8c9orwcx7.png)
so there is solution
such that
![(\partial f)/(\partial x)=y^2-2xy](https://img.qammunity.org/2020/formulas/mathematics/college/e7x1wgpb2n79gsdndimpqqnlttl2gjxcj4.png)
![(\partial f)/(\partial y)=2xy-x^2](https://img.qammunity.org/2020/formulas/mathematics/college/7qwpcrt6hwp44e3ijba9522hxwv3hi3hza.png)
Integrating both sides of the first PDE wrt
gives
![f(x,y)=xy^2-x^2y+g(y)](https://img.qammunity.org/2020/formulas/mathematics/college/dc1xmcximw6feenye49jnsug1ehhhpsfum.png)
Differentiating both sides wrt
gives
![(\partial f)/(\partial y)=2xy-x^2+(\mathrm dg)/(\mathrm dy)=2xy-x^2](https://img.qammunity.org/2020/formulas/mathematics/college/k97f45uzgpidzfest7qmiq5tgjs7f3n18g.png)
![\implies(\mathrm dg)/(\mathrm dy)=0\implies g(y)=C](https://img.qammunity.org/2020/formulas/mathematics/college/5qfdmejkr9u0aq351yo5qr13pi9ctb35cl.png)
Then the solution to the ODE is
![f(x,y)=\boxed{xy^2-x^2y=C}](https://img.qammunity.org/2020/formulas/mathematics/college/64f9yi3miak99w35oxrd9dqxkm7it80aum.png)
# # #
Alternatively, we can see that the ODE is homogeneous, since replacing
and
reduces to the same ODE:
![((ty)^2-2(tx)(ty))\,\mathrm d(tx)+(2(tx)(ty)-(tx)^2)\,\mathrm d(ty)=0](https://img.qammunity.org/2020/formulas/mathematics/college/duosdy0fzuot6lh4920znzqimtrp88jteg.png)
![t^3(y^2-2xy)\,\mathrm dx+t^3(2xy-x^2)\,\mathrm dy=0](https://img.qammunity.org/2020/formulas/mathematics/college/aj1n708dvgernh1gie7bk6s3b03kzmovy4.png)
![(y^2-2xy)\,\mathrm dx+(2xy-x^2)\,\mathrm dy=0](https://img.qammunity.org/2020/formulas/mathematics/college/2fl7oioq34rj15yjatmhukro50d3wi3ljt.png)
This tells us we can solve by substituting
, so that
, and the ODE becomes
![(x^2v^2-2x^2v)\,\mathrm dx+(2x^2v-x^2)(x\,\mathrm dv+v\,\mathrm dx)=0](https://img.qammunity.org/2020/formulas/mathematics/college/zulk0iwl03d9l1hkt6dtwnrtqn3r1agtd0.png)
![v(v-2)\,\mathrm dx+(2v-1)(x\,\mathrm dv+v\,\mathrm dx)=0](https://img.qammunity.org/2020/formulas/mathematics/college/mkbzskjj991u7w68xucxolkj6ssv4b90ms.png)
![3v(v-1)\,\mathrm dx+x(2v-1)\,\mathrm dv=0](https://img.qammunity.org/2020/formulas/mathematics/college/gfc9cn4thlqpevbshvhh3tu35x21w5aqpm.png)
which is separable as
![(1-2v)/(3v(v-1))\,\mathrm dv=\frac{\mathrm dx}x](https://img.qammunity.org/2020/formulas/mathematics/college/waci5uq6xpik28rs7mbkya3njvewjnkxrs.png)
Integrating both sides gives
![-\frac13\ln|v(1-v)|=\ln|x|+C](https://img.qammunity.org/2020/formulas/mathematics/college/go8fnhwi6lth8mpkl8wfo08qkkcf1bzcuw.png)
![v(1-v)=\frac C{x^3}](https://img.qammunity.org/2020/formulas/mathematics/college/rt1m9sqzgldvxdihom23zgxuuqnbnyze1k.png)
and solving in terms of
,
![\frac yx\left(1-\frac yx\right)=\frac C{x^3}](https://img.qammunity.org/2020/formulas/mathematics/college/2weif3ed81ribsi4vmghdx16unpb31gblq.png)
![xy(x-y)=C](https://img.qammunity.org/2020/formulas/mathematics/college/7x4zwjd7ldh2vaximgdkeyv1hqdqbjl1ee.png)
![\boxed{x^2y-xy^2=C}](https://img.qammunity.org/2020/formulas/mathematics/college/dwdugw135yitz6yd4b90d2i97s2wi406se.png)