28.1.22 problem 22

Internal problem ID [4328]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number : 22
Date solved : Sunday, March 30, 2025 at 03:01:34 AM
CAS classification : [_exact, _rational, [_Abel, `2nd type`, `class B`]]

\begin{align*} x y^{2}+x -2 y+3+\left (x^{2} y-2 x -2 y\right ) y^{\prime }&=0 \end{align*}

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