29.20.28 problem 575

Internal problem ID [5169]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 20
Problem number : 575
Date solved : Sunday, March 30, 2025 at 06:46:39 AM
CAS classification : [[_homogeneous, `class D`], _rational, _Bernoulli]

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

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