81.3.22 problem 22

Internal problem ID [18569]
Book : A short course on differential equations. By Donald Francis Campbell. Maxmillan company. London. 1907
Section : Chapter III. Ordinary differential equations of the first order and first degree. Exercises at page 33
Problem number : 22
Date solved : Monday, March 31, 2025 at 05:43:14 PM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class B`]]

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

Maple. Time used: 0.012 (sec). Leaf size: 22
ode:=x*(-2*y(x)+x)*diff(y(x),x)+x^2+2*y(x)^2 = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x \left (-1-\frac {3 \operatorname {LambertW}\left (-\frac {2 \,{\mathrm e}^{-\frac {2}{3}-\frac {c_1}{3}}}{3 x^{{1}/{3}}}\right )}{2}\right ) \]
Mathematica. Time used: 7.823 (sec). Leaf size: 39
ode=x*(x-2*y[x])*D[y[x],x]+(x^2+2*y[x]^2)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {1}{2} x \left (2+3 W\left (-\frac {2 e^{-\frac {c_1}{3}}}{3 \sqrt [3]{x}}\right )\right ) \\ y(x)\to -x \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2 + x*(x - 2*y(x))*Derivative(y(x), x) + 2*y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
RecursionError : maximum recursion depth exceeded