31.2.6 problem 6

Internal problem ID [5727]
Book : Differential Equations, By George Boole F.R.S. 1865
Section : Chapter 3
Problem number : 6
Date solved : Sunday, March 30, 2025 at 10:06:19 AM
CAS classification : [[_homogeneous, `class D`], _exact, _rational, _Bernoulli]

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

Maple. Time used: 0.005 (sec). Leaf size: 37
ode:=exp(x)*(x^2+y(x)^2+2*x)+2*y(x)*exp(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: 6.076 (sec). Leaf size: 47
ode=Exp[x]*(x^2+y[x]^2+2*x)+2*y[x]*Exp[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.653 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x**2 + 2*x + y(x)**2)*exp(x) + 2*y(x)*exp(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 ] \]