69.12.22 problem 296

Internal problem ID [18175]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 12. Miscellaneous problems. Exercises page 93
Problem number : 296
Date solved : Thursday, October 02, 2025 at 03:07:05 PM
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.005 (sec). Leaf size: 37
ode:=x^2+y(x)^2+2*x+2*y(x)*diff(y(x),x) = 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: 4.225 (sec). Leaf size: 47
ode=(x^2+y[x]^2+2*x)+(2*y[x])*D[y[x],x]==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.365 (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 ] \]