Question: How do I obtain the solutions to this ODE in one go?

The ODE is: 

eqn := y(x)*(2*x*diff(y(x), x) + y(x)*(diff(y(x), x)^2 - 1)) = -1: # How about another ODE 'lhs(eqn) = +1' ?

Maple can solve it, but I find that (to get all four solutions) I have to execute the dsolve command twice
 

restart;

eqn := y(x)*(2*x*(diff(y(x), x))+y(x)*((diff(y(x), x))^2-1)) = -1

dsolve(eqn, {y(x)}, 'parametric', 'singsol' = all)

y(x) = (c__1^2+2*c__1*x+1)^(1/2), y(x) = -(c__1^2+2*c__1*x+1)^(1/2)

(1)

dsolve(eqn, {y(x)}, 'singsol' = all)

y(x) = (-x^2+1)^(1/2), y(x) = -(-x^2+1)^(1/2), Int(-((_a^2+y(x)^2-1)^(1/2)*_a*y(x)^2-_a^2*y(x)^2-y(x)^4+2*_a^2+3*y(x)^2-2)/((y(x)^2+2*_a-2)*(-y(x)^2+2*_a+2)*(_a^2+y(x)^2-1)), _a = _b .. x)+Intat(-_f/(2*(_f^2+x^2-1)^(1/2)*x^2+(_f^2+x^2-1)^(1/2)*_f^2+2*x^3+2*x*_f^2-2*(_f^2+x^2-1)^(1/2)-2*x)-(Int(-(_a*_f^3/(_a^2+_f^2-1)^(1/2)+2*(_a^2+_f^2-1)^(1/2)*_a*_f-2*_a^2*_f-4*_f^3+6*_f)/((_f^2+2*_a-2)*(-_f^2+2*_a+2)*(_a^2+_f^2-1))+2*((_a^2+_f^2-1)^(1/2)*_a*_f^2-_a^2*_f^2-_f^4+2*_a^2+3*_f^2-2)*_f/((_f^2+2*_a-2)^2*(-_f^2+2*_a+2)*(_a^2+_f^2-1))-2*((_a^2+_f^2-1)^(1/2)*_a*_f^2-_a^2*_f^2-_f^4+2*_a^2+3*_f^2-2)*_f/((_f^2+2*_a-2)*(-_f^2+2*_a+2)^2*(_a^2+_f^2-1))+2*((_a^2+_f^2-1)^(1/2)*_a*_f^2-_a^2*_f^2-_f^4+2*_a^2+3*_f^2-2)*_f/((_f^2+2*_a-2)*(-_f^2+2*_a+2)*(_a^2+_f^2-1)^2), _a = _b .. x)), _f = y(x))+c__1 = 0, Int((_a^2*y(x)^2-2*_a^2+y(x)^4-3*y(x)^2+(_a^2+y(x)^2-1)^(1/2)*_a*y(x)^2+2)/((y(x)^2+2*_a-2)*(-y(x)^2+2*_a+2)*(_a^2+y(x)^2-1)), _a = _b .. x)+Intat(_f/(2*(_f^2+x^2-1)^(1/2)*x^2+(_f^2+x^2-1)^(1/2)*_f^2-2*x^3-2*x*_f^2-2*(_f^2+x^2-1)^(1/2)+2*x)-(Int((2*_a^2*_f+4*_f^3-6*_f+_a*_f^3/(_a^2+_f^2-1)^(1/2)+2*(_a^2+_f^2-1)^(1/2)*_a*_f)/((_f^2+2*_a-2)*(-_f^2+2*_a+2)*(_a^2+_f^2-1))-2*(_a^2*_f^2-2*_a^2+_f^4-3*_f^2+(_a^2+_f^2-1)^(1/2)*_a*_f^2+2)*_f/((_f^2+2*_a-2)^2*(-_f^2+2*_a+2)*(_a^2+_f^2-1))+2*(_a^2*_f^2-2*_a^2+_f^4-3*_f^2+(_a^2+_f^2-1)^(1/2)*_a*_f^2+2)*_f/((_f^2+2*_a-2)*(-_f^2+2*_a+2)^2*(_a^2+_f^2-1))-2*(_a^2*_f^2-2*_a^2+_f^4-3*_f^2+(_a^2+_f^2-1)^(1/2)*_a*_f^2+2)*_f/((_f^2+2*_a-2)*(-_f^2+2*_a+2)*(_a^2+_f^2-1)^2), _a = _b .. x)), _f = y(x))+c__1 = 0

(2)

NULL


 

Download dsolve_twice.mw

However, in MATLAB®, the complete solutions can be found just in one go

>> dsolve('y*(2*x*Dy + y*(Dy^2 - 1)) = -1', 'x') % require the Symbolic Math Toolbox™
ans =
                         1
                        -1
 -(-(x - 1)*(x + 1))^(1/2)
  (-(x - 1)*(x + 1))^(1/2)
 (C1^2 + 2*x*C1 + 1)^(1/2)
-(C1^2 + 2*x*C1 + 1)^(1/2)

Does anyone know why?

Please Wait...