25.1.1 problem 1

Internal problem ID [4213]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 1
Date solved : Tuesday, March 04, 2025 at 05:56:16 PM
CAS classification : [_separable]

\begin{align*} 3 y^{2} y^{\prime }&=2 x -1 \end{align*}

Maple. Time used: 0.006 (sec). Leaf size: 58
ode:=3*y(x)^2*diff(y(x),x) = 2*x-1; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y \left (x \right ) &= \left (x^{2}+c_{1} -x \right )^{{1}/{3}} \\ y \left (x \right ) &= -\frac {\left (x^{2}+c_{1} -x \right )^{{1}/{3}} \left (1+i \sqrt {3}\right )}{2} \\ y \left (x \right ) &= \frac {\left (x^{2}+c_{1} -x \right )^{{1}/{3}} \left (i \sqrt {3}-1\right )}{2} \\ \end{align*}
Mathematica. Time used: 0.232 (sec). Leaf size: 71
ode=3*y[x]^2*D[y[x],x]==2*x-1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \sqrt [3]{x^2-x+3 c_1} \\ y(x)\to -\sqrt [3]{-1} \sqrt [3]{x^2-x+3 c_1} \\ y(x)\to (-1)^{2/3} \sqrt [3]{x^2-x+3 c_1} \\ \end{align*}
Sympy. Time used: 1.170 (sec). Leaf size: 58
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x + 3*y(x)**2*Derivative(y(x), x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \frac {\left (-1 - \sqrt {3} i\right ) \sqrt [3]{C_{1} + x^{2} - x}}{2}, \ y{\left (x \right )} = \frac {\left (-1 + \sqrt {3} i\right ) \sqrt [3]{C_{1} + x^{2} - x}}{2}, \ y{\left (x \right )} = \sqrt [3]{C_{1} + x^{2} - x}\right ] \]