49.22.2 problem 1(b)

Internal problem ID [7748]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 5. Existence and uniqueness of solutions to first order equations. Page 198
Problem number : 1(b)
Date solved : Sunday, March 30, 2025 at 12:22:34 PM
CAS classification : [_quadrature]

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

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