# 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.

Write this as

$${1\over 2} 2y {dy\over dx} = x((y^2)^2+2y^2+1)$$

Then you have the LHS is ${1\over 2}{d(y^2)\over dx}=x(y^2+1)^2$

So you get

$${1\over 2}{d(y^2)\over (y^2+1)^2}=x\,dx$$

integrate both sides

$$-{1\over 2}(y^2+1)^{-1}={1\over 2}x^2+C$$

Plugging in, we get $-{1\over 4}=8+C$, so $C=-{33\over 4}$.

We conclude the solution is

$$-{1\over 2}(y^2+1)^{-1}={1\over 2}x^2-{33\over 4}.$$

• Well it's like an epiphany, never thought about factoring...Thanks a lot! Jul 24, 2015 at 2:15
• I think $c =\frac{-33}{4}$. Jul 24, 2015 at 2:20
• Could you explain how you got into the $d(y^2)$ step? I'm learning about this and I couldn't understand that part. Jul 24, 2015 at 2:40
• @yotengounlcd it's the chain rule. Jul 24, 2015 at 5:55
• Lol, that was pretty obvious, my head was somewhere else probably. Thanks! Jul 24, 2015 at 6:41

Notice, we have $$y\frac{dy}{dx}=x(y^4+2y^2+1)$$ $$\frac{y}{y^4+2y^2+1}dy=xdx$$ $$\frac{y}{(y^2+1)^2}dy=xdx$$ Now, integrating both the sides we have $$\int \frac{y}{(y^2+1)^2}dy=\int xdx$$ $$\frac{1}{2}\frac{(y^2+1)^{-1}}{-1}=\frac{x^2}{2}+c$$ $$-\frac{1}{2(y^2+1)}=\frac{x^2}{2}+c$$ Substituting $y=1$ & $x=4$, we get $$\frac{-1}{2((1)^2+1)}=\frac{(4)^2}{2}+c\implies c=\frac{-31}{4}$$ Hence, the solution is $$-\frac{1}{2(y^2+1)}=\frac{x^2}{2}-\frac{31}{4}$$

• I think $c = \frac{-33}{4}$. Jul 24, 2015 at 2:16

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$$