29.17.1 problem 460

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

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

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