87.6.13 problem 16

Internal problem ID [23330]
Book : Ordinary differential equations with modern applications. Ladas, G. E. and Finizio, N. Wadsworth Publishing. California. 1978. ISBN 0-534-00552-7. QA372.F56
Section : Chapter 1. Elementary methods. First order differential equations. Exercise at page 53
Problem number : 16
Date solved : Thursday, October 02, 2025 at 09:37:30 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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