12.6.26 problem 26

Internal problem ID [1705]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Exact equations. Section 2.5 Page 79
Problem number : 26
Date solved : Saturday, March 29, 2025 at 11:35:13 PM
CAS classification : [_exact, _rational, [_1st_order, `_with_symmetry_[F(x),G(x)]`], [_Abel, `2nd type`, `class A`]]

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

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