87.5.1 problem 1

Internal problem ID [23294]
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 47
Problem number : 1
Date solved : Thursday, October 02, 2025 at 09:28:55 PM
CAS classification : [[_homogeneous, `class C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

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