How to solve $xy'y^2=x^2+y^3$? $$xy'y^2=x^2+y^3$$
In my problems book it is covered as "linear non-homogeneous" equation, but I was not able to bring it to canonical form like
$$y'+yp(x) = q(x)$$
is there any trap about it?
 A: Since you seem to know how to solve those in the 'canonical form' you mentioned, I thought it would be useful to provide an answer showing that your ODE can be put into that form. Consider an ODE in the following form:
$$y'+P(x)y=Q(x)y^n$$
Where $n\in \mathbb{R}\setminus\{0,1\}$. Such an ODE is called a Bernoulli Differential Equation. In general, such can be reduced to the form you mentioned using the substitution $z=y^{1-n}$. Your ODE can be written in that form:
$$y'-\frac{1}{x}y=xy^{-2}$$

Hence, in your case, we clearly see that $n=-2$, thus the change of variable $z=y^3$ seems reasonable. Hence $z'=3y^2y'$ by the chain rule and let's now apply this substitution to your original ODE:
$$xy^2y'=x^2+y^3 \implies x\cdot \frac{z'}{3}=x^2+z$$
Which is in the form you mention, after dividing both sides by $\dfrac{x}{3}$ and rearranging:
$$z'-\frac{3}{x}\cdot z=3x$$
And this, you know how to solve.
A: Hint:
$$y'y^2=\frac{(y^3)'}3.$$

Now the homogenous equation is
$$\frac{x(y^3)'}3=(y^3),$$ which is separable.

The homogenous solution is $y^3=Cx^3$, or $y=Cx$.

You can try the complete solution by variation of the constant.
A: Another trick, which is perhaps the shortest method, is to use the change of variable $y=vx$, giving $y'=xv'+v$ by the product rule. This gives:
$$\begin{align}xy'y^2=x^2+y^3 &\implies y'=\frac{x^2+y^3}{xy^2}=\frac{x}{y^2}+\frac{y}{x}\\&\implies xv'+v=\frac{1}{xv^2}+v \\&\implies v'=\frac{1}{x^2v^2} \end{align}$$
This ODE is separable, meaning that all you need to do is to compute the following integrals.
$$\int v^2~dv=\int \frac{1}{x^2}~dx$$
