15.19.2 problem 2

Internal problem ID [3286]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 37, page 171
Problem number : 2
Date solved : Sunday, March 30, 2025 at 01:31:26 AM
CAS classification : [_quadrature]

\begin{align*} x y {y^{\prime }}^{2}+\left (x +y\right ) y^{\prime }+1&=0 \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 32
ode:=x*y(x)*diff(y(x),x)^2+(x+y(x))*diff(y(x),x)+1 = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -\ln \left (x \right )+c_1 \\ y &= \sqrt {-2 x +c_1} \\ y &= -\sqrt {-2 x +c_1} \\ \end{align*}
Mathematica. Time used: 0.073 (sec). Leaf size: 53
ode=x*y[x]*D[y[x],x]^2+(x+y[x])*D[y[x],x]+1==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\sqrt {2} \sqrt {-x+c_1} \\ y(x)\to \sqrt {2} \sqrt {-x+c_1} \\ y(x)\to -\log (x)+c_1 \\ \end{align*}
Sympy. Time used: 0.710 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x)*Derivative(y(x), x)**2 + (x + y(x))*Derivative(y(x), x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = C_{1} - \log {\left (x \right )}, \ y{\left (x \right )} = - \sqrt {C_{1} - 2 x}, \ y{\left (x \right )} = \sqrt {C_{1} - 2 x}\right ] \]