47.2.32 problem Example 4

Internal problem ID [7448]
Book : Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section : Chapter 1. First order differential equations. Section 1.2 Homogeneous equations problems. page 12
Problem number : Example 4
Date solved : Wednesday, March 05, 2025 at 04:37:59 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.085 (sec). Leaf size: 196
ode:=2*x-4*y(x)+6+(x+y(x)-2)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {2 \left (\left (\frac {i \sqrt {3}}{72}-\frac {1}{72}\right ) \left (36 \sqrt {3}\, c_{1}^{2} \left (x -\frac {1}{3}\right ) \sqrt {\frac {243 \left (x -\frac {1}{3}\right )^{2} c_{1} -12 x +4}{c_{1}}}+8+972 \left (x -\frac {1}{3}\right )^{2} c_{1}^{2}+\left (-216 x +72\right ) c_{1} \right )^{{2}/{3}}+\left (\frac {1}{18}+\left (-x -\frac {1}{2}\right ) c_{1} \right ) \left (36 \sqrt {3}\, c_{1}^{2} \left (x -\frac {1}{3}\right ) \sqrt {\frac {243 \left (x -\frac {1}{3}\right )^{2} c_{1} -12 x +4}{c_{1}}}+8+972 \left (x -\frac {1}{3}\right )^{2} c_{1}^{2}+\left (-216 x +72\right ) c_{1} \right )^{{1}/{3}}+\left (1+i \sqrt {3}\right ) \left (-\frac {1}{18}+\left (x -\frac {1}{3}\right ) c_{1} \right )\right )}{\left (36 \sqrt {3}\, c_{1}^{2} \left (x -\frac {1}{3}\right ) \sqrt {\frac {243 \left (x -\frac {1}{3}\right )^{2} c_{1} -12 x +4}{c_{1}}}+8+972 \left (x -\frac {1}{3}\right )^{2} c_{1}^{2}+\left (-216 x +72\right ) c_{1} \right )^{{1}/{3}} c_{1}} \]
Mathematica. Time used: 60.098 (sec). Leaf size: 2563
ode=(2*x-4*y[x]+6)+(x+y[x]-2)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

Too large to display

Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x + (x + y(x) - 2)*Derivative(y(x), x) - 4*y(x) + 6,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out