30.6.24 problem 25

Internal problem ID [7559]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Review problems. page 79
Problem number : 25
Date solved : Tuesday, September 30, 2025 at 04:50:34 PM
CAS classification : [_rational, [_Abel, `2nd type`, `class B`]]

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