81.7.4 problem 8-3

Internal problem ID [21578]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 8. Riccati Equation. Page 124.
Problem number : 8-3
Date solved : Thursday, October 02, 2025 at 07:52:56 PM
CAS classification : [_rational, _Riccati]

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