56.1.34 problem 35

Internal problem ID [8746]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 35
Date solved : Wednesday, March 05, 2025 at 06:43:48 AM
CAS classification : [[_homogeneous, `class G`], _exact, _rational, _Bernoulli]

\begin{align*} y^{2}+\frac {2}{x}+2 y x y^{\prime }&=0 \end{align*}

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