75.5.11 problem 110

Internal problem ID [16676]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 5. Homogeneous equations. Exercises page 44
Problem number : 110
Date solved : Monday, March 31, 2025 at 03:05:00 PM
CAS classification : [[_homogeneous, `class C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.186 (sec). Leaf size: 30
ode:=x+y(x)-2+(-y(x)+4+x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\sqrt {2 \left (x +1\right )^{2} c_1^{2}+1}+\left (x +4\right ) c_1}{c_1} \]
Mathematica. Time used: 0.128 (sec). Leaf size: 59
ode=(x+y[x]-2)+(x-y[x]+4)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -i \sqrt {-2 x^2-4 x-16-c_1}+x+4 \\ y(x)\to i \sqrt {-2 x^2-4 x-16-c_1}+x+4 \\ \end{align*}
Sympy. Time used: 1.768 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x + (x - y(x) + 4)*Derivative(y(x), x) + y(x) - 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = x - \sqrt {C_{1} + 2 x^{2} + 4 x} + 4, \ y{\left (x \right )} = x + \sqrt {C_{1} + 2 x^{2} + 4 x} + 4\right ] \]