15.3.2 problem 2

Internal problem ID [2895]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 7, page 28
Problem number : 2
Date solved : Sunday, March 30, 2025 at 12:48:30 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class C`], _dAlembert]

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

Maple. Time used: 0.236 (sec). Leaf size: 219
ode:=x+(x-2*y(x)+2)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (4+\left (-12 x^{3}-12 x^{2}\right ) c_1^{3}\right ) \left (-c_1^{3} x^{3}+\sqrt {-2 c_1^{3} x^{3}+1}+1\right )^{{2}/{3}}-6 \left (\left (c_1^{3} x^{3}-\frac {\sqrt {-2 c_1^{3} x^{3}+1}}{3}-\frac {1}{3}\right ) \left (1+i \sqrt {3}\right ) \left (-c_1^{3} x^{3}+\sqrt {-2 c_1^{3} x^{3}+1}+1\right )^{{1}/{3}}+\left (c_1^{3} x^{3}-\frac {2 \sqrt {-2 c_1^{3} x^{3}+1}}{3}-\frac {2}{3}\right ) x \left (i \sqrt {3}-1\right ) c_1 \right ) \left (x +1\right ) c_1}{{\left (\left (\sqrt {3}+i\right ) \left (-c_1^{3} x^{3}+\sqrt {-2 c_1^{3} x^{3}+1}+1\right )^{{2}/{3}}+\left (2 i \left (-c_1^{3} x^{3}+\sqrt {-2 c_1^{3} x^{3}+1}+1\right )^{{1}/{3}}+\left (i-\sqrt {3}\right ) x c_1 \right ) x c_1 \right )}^{2} c_1} \]
Mathematica. Time used: 60.039 (sec). Leaf size: 445
ode=x+(x-2*y[x]+2)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x+2}{2}-\frac {1}{2 \text {Root}\left [\text {$\#$1}^6 \left (16 x^6+16 e^{12 c_1}\right )-24 \text {$\#$1}^4 x^4+8 \text {$\#$1}^3 x^3+9 \text {$\#$1}^2 x^2-6 \text {$\#$1} x+1\&,1\right ]} \\ y(x)\to \frac {x+2}{2}-\frac {1}{2 \text {Root}\left [\text {$\#$1}^6 \left (16 x^6+16 e^{12 c_1}\right )-24 \text {$\#$1}^4 x^4+8 \text {$\#$1}^3 x^3+9 \text {$\#$1}^2 x^2-6 \text {$\#$1} x+1\&,2\right ]} \\ y(x)\to \frac {x+2}{2}-\frac {1}{2 \text {Root}\left [\text {$\#$1}^6 \left (16 x^6+16 e^{12 c_1}\right )-24 \text {$\#$1}^4 x^4+8 \text {$\#$1}^3 x^3+9 \text {$\#$1}^2 x^2-6 \text {$\#$1} x+1\&,3\right ]} \\ y(x)\to \frac {x+2}{2}-\frac {1}{2 \text {Root}\left [\text {$\#$1}^6 \left (16 x^6+16 e^{12 c_1}\right )-24 \text {$\#$1}^4 x^4+8 \text {$\#$1}^3 x^3+9 \text {$\#$1}^2 x^2-6 \text {$\#$1} x+1\&,4\right ]} \\ y(x)\to \frac {x+2}{2}-\frac {1}{2 \text {Root}\left [\text {$\#$1}^6 \left (16 x^6+16 e^{12 c_1}\right )-24 \text {$\#$1}^4 x^4+8 \text {$\#$1}^3 x^3+9 \text {$\#$1}^2 x^2-6 \text {$\#$1} x+1\&,5\right ]} \\ y(x)\to \frac {x+2}{2}-\frac {1}{2 \text {Root}\left [\text {$\#$1}^6 \left (16 x^6+16 e^{12 c_1}\right )-24 \text {$\#$1}^4 x^4+8 \text {$\#$1}^3 x^3+9 \text {$\#$1}^2 x^2-6 \text {$\#$1} x+1\&,6\right ]} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x + (x - 2*y(x) + 2)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
ZeroDivisionError : polynomial division