17.1.25 problem 2(o)

Internal problem ID [4115]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 2(o)
Date solved : Tuesday, September 30, 2025 at 07:05:40 AM
CAS classification : [_quadrature]

\begin{align*} x +\left (2-x +2 y\right ) y^{\prime }&=x y \left (y^{\prime }-1\right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 17
ode:=x+(2-x+2*y(x))*diff(y(x),x) = x*y(x)*(diff(y(x),x)-1); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -1 \\ y &= x +2 \ln \left (x -2\right )+c_1 \\ \end{align*}
Mathematica. Time used: 0.003 (sec). Leaf size: 20
ode=x+(2-x+2*y[x])*D[y[x],x]==x*y[x]*(D[y[x],x]-1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -1\\ y(x)&\to x+2 \log (x-2)+c_1 \end{align*}
Sympy. Time used: 0.149 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*(Derivative(y(x), x) - 1)*y(x) + x + (-x + 2*y(x) + 2)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = -1, \ y{\left (x \right )} = C_{1} + x + 2 \log {\left (x - 2 \right )}\right ] \]