<s>[INST] How to solve this ODE: $x^3dx+(y+2)^2dy=0$? I am trying to solve $$ x^3dx+(y+2)^2dy=0 \quad( 1)$$

Dividing by $dx$, we can reduce the ODE to seperate variable form, i.e
$$  (1) \to (y+2)^2y'=-x^3 $$
Hence,
$$ \int (y(x)+2)^2y'(x) dy = \int -x^3dx = - \frac{x^4}{4} + c_1$$
This LHE seems to be easy to solve using integration by parts:
$$ \int (y(x)+2)^2y'(x) dy = y(x)(y(x)+2)^2 - \int y^3dy- \int 4y^2dy + \int4ydy \iff$$
$$ \iff - \frac{y^4}{4} + -\frac13 y^3 + 4y^2 + 8y + c_2$$
But then solving the ODE for $y(x)$ is a struggle:
$$ \iff - \frac{y^4}{4} + -\frac13 y^3 + 4y^2 + 8y = - \frac{3}{4}x + C$$

Any ideas on how I can solve this?
 [/INST] The coefficient of ${\rm d}x$ depends only on $x$ and the coefficient of $y$ depends only on ${\rm d}y$. So $$0 = x^3\,{\rm d}x + (y+2)^2\,{\rm d}y = {\rm d}\left(\frac{x^4}{4} + \frac{(y+2)^3}{3}\right),$$which says that your solutions are described by $$\frac{x^4}{4} + \frac{(y+2)^3}{3} = c,$$for some $c \in \Bbb R$. Thus $$y = -2+\left(\frac{c-3x^4}{4}\right)^{1/3},$$after letting $c$ absorb some constants.
</s>