<s>[INST] Differential equation, tricky How would I solve the following:
$(x^2-y^2)dy+(y^2+x^2y^2)dx=0$?
Here is what I did:
$\frac{dy}{dx}(x^2-y^2)=-(y^2+x^2y^2)$
Dividing through, to leave differential on one side:
$\frac{dy}{dx}=\frac{-(y^2+x^2y^2)}{x^2-y^2}$
I then proved this is a homogeneous differential equation.
This is how I Proved it:
Let $A(x,y)=-y^2-x^2y^2$. $A(tx,ty)=-t^2y^2-t^2x^2t^2y^2$ When you factorize, you get:
$t^2A(x,y)$
Do the same for the denominator, and make the conclusion that these are homogeneous.
Is this right?
I let $y=vx$ so that $\frac{dy}{dx}=x\frac{dv}{dx}+v$
However I get stuck from here, as the equation seems to not make sense for.
Anyone to please guide me
 [/INST] $$
\left(x^2 - y^2\right)dy = \left(y^2 + x^2y^2\right)dx
$$
This becomes
$$
\left(\frac{x^2}{y^2} - 1\right)dy = (1+x^2)dx
$$
$$
\frac{dx}{dy} = \frac{\frac{x^2}{y^2} - 1}{1+x^2}
$$
If we assume that $y = xt^a$ we have
$$
\frac{d}{dy} = \frac{dt}{dy}\frac{d}{dt} = \frac{1}{at^{a-1}x}\frac{d}{dt}
$$
Subbing into the original ode.
$$
\frac{1}{at^{a-1}x}\frac{dx}{dt} = \frac{t^{-2a} -1}{1+x^2}
$$
This becomes separable
$$
\frac{1+x^2}{x}dx = at^{a-1}(t^{-2a} - 1)dt
$$
$$
\ln x + \frac{x^2}{2} = \int at^{-a - 1} -at^{a-1}dt
$$
setting $a = 1$
$$
\int t^{-2} -1dt = -t^{-1} - t + C
$$
Thus we have
$$
\ln x + \frac{x^2}{2} = - \frac{t^2 + 1}{t} + C
$$
converting back we have $y = xt$
$$
\ln x + \frac{x^2}{2} = -\frac{\frac{y^2}{x^2} + 1}{y/x} + C
$$
Shorter approach
$y = xt$
We then have
$$
(x^2 - x^2t^2)dy = (x^2t^2 + x^2x^2t^2)dx\\
x^2(1- t^2)dy = x^2t^2(1 + x^2)dx
$$
We then have
$$
\frac{1-t^2}{t^2}dy = (1+x^2)dx
$$
$$dy = \frac{dy}{dt}dt = xdt$$
Then we have
$$
\frac{1-t^2}{t^2}xdt = (1+x^2)dx \implies \frac{1-t^2}{t^2}dt  = \frac{1+x^2}{x}dx
$$
</s>