# Solve autonomous ODE with Mathematica

I'm given a problem with the ODE

y'[x]=y[x]*Sqrt[4-2y[x]]

I've tried

DSolve[{w'[x] == w[x]*Sqrt[4 - 2*w[x]]}, w[x], x]

which gives me

{{w[x] -> -2 (-1 + Tanh[1/2 (-2 x - Sqrt[2] C[1])]^2)}}
but that doesn't seem correct for some reason.

Can someone please point me in the direction of how to do this problem correctly? I don't really understand Mathematica at all.

-
Why do you think it isn't correct? – Dr. belisarius Oct 25 '12 at 17:27
Do you have boundary conditions by any chance that you could use to plot the solution? {{w[x] -> -2 (-1 + Tanh[1/2 (-2 x - Sqrt[2] C[1])]^2)}} is what I got on Mathematica as well. What were you expecting? – drN Oct 25 '12 at 22:30

here is a soultion by Maple

$$x+\frac{1}{2}\,\ln \left( \sqrt {4-2\,y \left( x \right) }+2 \right)- \frac{1}{2}\, \ln \left( -2+\sqrt {4-2\,y \left( x \right) } \right) +{\it \_C1}=0\,.$$

solving the above equation for $y$, gives

$$y(x) = -{\frac {{{8\rm e}^{2\,x+2\,{\it C1}}}}{ \left( {{\rm e}^{2\,x+2\, {\it C1}}}-1 \right) ^{2}}} \,.$$

The differential equation can be solved by the method of separation of variables

$$\frac{dy}{dx}=y \sqrt{4-2y}\implies \int \frac{dy}{y \sqrt{4-2y}}=\int dx + C \,.$$

You need to work out the above integrals and then solve the resulting equation for y to get y as a function of $x$.

-
How exactly did you come to this solution? – Jay Oct 25 '12 at 17:35
@Jay: I'll try to put more details. – Mhenni Benghorbal Oct 25 '12 at 17:37
Do you have any idea how to do this in Mathematica? – Jay Oct 25 '12 at 17:53
I think I'm close. Clear[eq1, eq2, x, y, func]; eq1 = Integrate[1/(w*Sqrt[4 - 2*w]), w]; eq2 = Integrate[1, x]; func = eq1 == eq2; Solve[func]; gives me {{x -> 1/2 Log[2 - Sqrt[4 - 2 w]] - 1/2 Log[2 + Sqrt[4 - 2 w]]}} – Jay Oct 25 '12 at 18:03