87.5.13 problem 17

Internal problem ID [23306]
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 : 17
Date solved : Thursday, October 02, 2025 at 09:31:14 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*}

With initial conditions

\begin{align*} y \left (1\right )&=1 \\ \end{align*}
Maple. Time used: 0.068 (sec). Leaf size: 16
ode:=x-y(x)+(-x+y(x)+2)*diff(y(x),x) = 0; 
ic:=[y(1) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = x -2+2 \sqrt {-x +2} \]
Mathematica. Time used: 0.058 (sec). Leaf size: 19
ode=(x-y[x])+( -x+y[x]+2 )*D[y[x],x]==0; 
ic={y[1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x-2 i \sqrt {x-2}-2 \end{align*}
Sympy. Time used: 0.733 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x + (-x + y(x) + 2)*Derivative(y(x), x) - y(x),0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x + 2 \sqrt {2 - x} - 2 \]