Solving $2xy'(x-y^2)+y^3=0$

Solve$$2xy'(x-y^2)+y^3=0$$

I don't know which method should I use to solve the equation. It is not in the form of homogeneous ODEs. I can write it as $y^3\;dx+(2x^2-2xy^2)\;dy=0$. But it is not an exact ODE and can't see a way to express every term by differentiation and integrate both sides.


Solution 1:

As I noted in my above hint in the comments, it would be helpful to instead try solving this as if it was a differential equation in $x = x(y)$ not $y = y(x)$. To that end, suppose the function is smooth and we can write \begin{align} y^3 x' + 2x(x-y^2) & = 0 \\ y^3 u' + 2y^2 u & = 2, \text{ via substitution } x = u^{-1} \\ u' + 2y^{-1} u & = 2 y^{-3} & \\ (y^2 u)' & = 2y^{-1} \\ y^2 u & = 2 \ln y + C \\ y^2 & = 2 x \ln y + C x. \end{align} You can check that this is indeed a solution of the original differential equation.

Solution 2:

Well, we are trying to solve:

$$\text{n}x\text{y}'\left(x\right)\left(x-\text{y}\left(x\right)^2\right)+\text{y}\left(x\right)^3=0\tag1$$

Solving for $\text{y}'\left(x\right)$, gives:

$$\text{y}'\left(x\right)=-\frac{\text{y}\left(x\right)^3}{\text{n}x\left(x-\text{y}\left(x\right)^2\right)}\tag2$$

Now, we can write the DE in terms of $x$, since $\frac{\text{dy}}{\text{d}x}\frac{\text{d}x}{\text{dy}}=1$, $\frac{\text{d}\text{y}\left(x\right)}{\text{d}x}=\frac{1}{\frac{\text{dx}\left(y\right)}{\text{d}y}}$. So we get:

$$\frac{1}{\frac{\text{dx}\left(y\right)}{\text{d}y}}=-\frac{y^3}{\text{nx}\left(y\right)\left(\text{x}\left(y\right)-y^2\right)}\tag3$$

Raise both sides to the power $-1$, expand, subtract $\frac{\text{nx}\left(y\right)}{y}$ from both sides and divide both sides by $-\text{x}\left(y\right)^2$:

$$\frac{\text{n}}{y\text{x}\left(y\right)}-\frac{\frac{\text{dx}\left(y\right)}{\text{d}y}}{\text{x}\left(y\right)^2}=\frac{\text{n}}{y^3}\tag4$$

Let $\mu\left(y\right):=\frac{1}{\text{x}\left(y\right)}$. This gives $\frac{\text{d}\mu\left(y\right)}{\text{d}y}=-\frac{\frac{\text{dx}\left(y\right)}{\text{d}y}}{\text{x}\left(y\right)^2}$, so:

$$\frac{\text{d}\mu\left(y\right)}{\text{d}y}+\frac{\text{n}\mu\left(y\right)}{y}=\frac{\text{n}}{y^3}\tag5$$

Let:

$$\xi\left(y\right):=\exp\left\{\int\frac{\text{n}}{y}\space\text{d}y\right\}=y^\text{n}\tag6$$

Multiply both sides by $\xi\left(y\right)$, subsitute $\text{n}y^{\text{n}-1}=\frac{\text{d}}{\text{d}y}\left(y^\text{n}\right)$ and apply the reserve product rule. This leads to:

$$\frac{\text{d}}{\text{d}y}\left(y^\text{n}\mu\left(y\right)\right)=\text{n}y^{\text{n}-3}\tag7$$

Integrate both sides with respect to $y$ and divide both sides by $\xi\left(y\right)$:

$$\mu\left(y\right)=\frac{\text{n}}{y^2\left(\text{n}-2\right)}+\frac{\text{C}}{y^\text{n}}\tag8$$

Sovling for $\text{x}\left(y\right)$, gives:

$$\frac{1}{\text{x}\left(y\right)}=\frac{\text{n}}{y^2\left(\text{n}-2\right)}+\frac{\text{C}}{y^\text{n}}\tag9$$

So:

$$\frac{1}{x}=\frac{\text{n}}{\text{y}\left(x\right)^2\left(\text{n}-2\right)}+\frac{\text{C}}{\text{y}\left(x\right)^\text{n}}\tag{10}$$