15.8.9 problem 9

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

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

Maple. Time used: 0.019 (sec). Leaf size: 21
ode:=x-3*y(x) = (3*y(x)-x+2)*diff(y(x),x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x}{3}+\frac {\operatorname {LambertW}\left (\frac {c_1 \,{\mathrm e}^{\frac {1}{3}-\frac {8 x}{3}}}{3}\right )}{2}-\frac {1}{6} \]
Mathematica. Time used: 4.917 (sec). Leaf size: 43
ode=(x-3*y[x])==(3*y[x]-x+2)*D[y[x],x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {1}{6} \left (3 W\left (-e^{-\frac {8 x}{3}-1+c_1}\right )+2 x-1\right ) \\ y(x)\to \frac {1}{6} (2 x-1) \\ \end{align*}
Sympy. Time used: 3.295 (sec). Leaf size: 105
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x - (-x + 3*y(x) + 2)*Derivative(y(x), x) - 3*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {x}{3} + \frac {W\left (- \frac {\sqrt [3]{C_{1} e^{- 8 x}} e^{\frac {1}{3}}}{3}\right )}{2} - \frac {1}{6}, \ y{\left (x \right )} = \frac {x}{3} + \frac {W\left (\frac {\sqrt [3]{C_{1} e^{- 8 x}} \left (1 - \sqrt {3} i\right ) e^{\frac {1}{3}}}{6}\right )}{2} - \frac {1}{6}, \ y{\left (x \right )} = \frac {x}{3} + \frac {W\left (\frac {\sqrt [3]{C_{1} e^{- 8 x}} \left (1 + \sqrt {3} i\right ) e^{\frac {1}{3}}}{6}\right )}{2} - \frac {1}{6}\right ] \]