<s>[INST] Given the differential equation, how to solve the y function with x as the independent variable? $y\frac{dy}{dx} = x(y^4 + 2y^2 + 1)$
$y = 1$ when $x = 4$
I tired to integrate by substitution, but it doesn't seem to work out.
 [/INST] To solve this, you can use separation of variables:
$$ y \frac{dy}{dx} = x(y^4+2y^2+1)$$
$$ \frac{y}{y^4+2y^2+1}dy = x\ dx$$
$$ \frac{y}{(y^2+1)^2}= x \ dx$$
Using the substitution $u = y^2+1$, $\frac{du}{dy}= 2y $
$$ \frac{1}{2}\int u^{-2} du= \int x \ dx $$
$$ \frac{-1}{2(y^2+1)} = \frac{x^2}{2} + c$$
where c is a constant of integration.
You can then obtain a value for $c$ using $x =4 \ \text{and}\ y =1$
This should give you $c =\frac{-33}{4}$
Hence, solution:
$$ \frac{2}{y^2+1} =33- 2x^2  $$
</s>