12.3.3 problem 3

Internal problem ID [1580]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. separable equations. Section 2.2 Page 52
Problem number : 3
Date solved : Tuesday, March 04, 2025 at 12:40:35 PM
CAS classification : [_separable]

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

Maple. Time used: 0.003 (sec). Leaf size: 11
ode:=x*diff(y(x),x)+y(x)^2+y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {1}{c_1 x -1} \]
Mathematica. Time used: 0.245 (sec). Leaf size: 31
ode=x*D[y[x],x]+y[x]^2+y[x]== 0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {e^{c_1}}{-x+e^{c_1}} \\ y(x)\to -1 \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.247 (sec). Leaf size: 7
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + y(x)**2 + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{- C_{1} + x} \]