29.22.5 problem 611

Internal problem ID [5205]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 22
Problem number : 611
Date solved : Sunday, March 30, 2025 at 06:52:06 AM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

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

Maple. Time used: 0.005 (sec). Leaf size: 17
ode:=(x^2+2*y(x)+y(x)^2)*diff(y(x),x)+2*x = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ \left (x^{2}+y^{2}\right ) {\mathrm e}^{y}+c_1 = 0 \]
Mathematica. Time used: 0.162 (sec). Leaf size: 24
ode=(x^2+2 y[x]+y[x]^2)D[y[x],x]+2 x==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x^2 e^{y(x)}+e^{y(x)} y(x)^2=c_1,y(x)\right ] \]
Sympy. Time used: 1.049 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x + (x**2 + y(x)**2 + 2*y(x))*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + \frac {x^{2} e^{y{\left (x \right )}}}{2} + \frac {y^{2}{\left (x \right )} e^{y{\left (x \right )}}}{2} = 0 \]