12.5.33 problem 30

Internal problem ID [1657]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Transformation of Nonlinear Equations into Separable Equations. Section 2.4 Page 68
Problem number : 30
Date solved : Saturday, March 29, 2025 at 11:11:45 PM
CAS classification : [[_homogeneous, `class A`], _rational, _dAlembert]

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

Maple. Time used: 0.008 (sec). Leaf size: 78
ode:=diff(y(x),x) = (y(x)^3+2*x*y(x)^2+x^2*y(x)+x^3)/x/(x+y(x))^2; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= x \left (-1+\left (3 \ln \left (x \right )+3 c_1 \right )^{{1}/{3}}\right ) \\ y &= -\frac {x \left (i \sqrt {3}\, \left (3 \ln \left (x \right )+3 c_1 \right )^{{1}/{3}}+\left (3 \ln \left (x \right )+3 c_1 \right )^{{1}/{3}}+2\right )}{2} \\ y &= \frac {x \left (i \sqrt {3}-1\right ) \left (3 \ln \left (x \right )+3 c_1 \right )^{{1}/{3}}}{2}-x \\ \end{align*}
Mathematica. Time used: 1.407 (sec). Leaf size: 109
ode=D[y[x],x]==(y[x]^3+2*x*y[x]^2+x^2*y[x]+x^3)/(x*(y[x]+x)^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -x+\sqrt [3]{x^3 (3 \log (x)+1+3 c_1)} \\ y(x)\to -x+\frac {1}{2} i \left (\sqrt {3}+i\right ) \sqrt [3]{x^3 (3 \log (x)+1+3 c_1)} \\ y(x)\to -x-\frac {1}{2} \left (1+i \sqrt {3}\right ) \sqrt [3]{x^3 (3 \log (x)+1+3 c_1)} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x**3 + x**2*y(x) + 2*x*y(x)**2 + y(x)**3)/(x*(x + y(x))**2),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : cannot determine truth value of Relational