12.7.24 problem 25

Internal problem ID [1734]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Exact equations. Integrating factors. Section 2.6 Page 91
Problem number : 25
Date solved : Tuesday, March 04, 2025 at 01:41:04 PM
CAS classification : [[_homogeneous, `class D`], _rational, [_Abel, `2nd type`, `class B`]]

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

Maple. Time used: 0.034 (sec). Leaf size: 85
ode:=3*x*y(x)+2*y(x)^2+y(x)+(x^2+2*x*y(x)+x+2*y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {-\sqrt {4+x^{2} \left (x +1\right )^{2} c_1^{2}}+\left (-x^{2}-x \right ) c_1}{2 \left (x +1\right ) c_1} \\ y &= \frac {\sqrt {4+x^{2} \left (x +1\right )^{2} c_1^{2}}+\left (-x^{2}-x \right ) c_1}{2 \left (x +1\right ) c_1} \\ \end{align*}
Mathematica. Time used: 14.388 (sec). Leaf size: 105
ode=(3*x*y[x]+2*y[x]^2+y[x])+(x^2+2*x*y[x]+x+2*y[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {1}{2} \left (-x-\sqrt {x^2+\frac {4 e^{c_1}}{(x+1)^2}}\right ) \\ y(x)\to \frac {1}{2} \left (-x+\sqrt {x^2+\frac {4 e^{c_1}}{(x+1)^2}}\right ) \\ y(x)\to \frac {1}{2} \left (-\sqrt {x^2}-x\right ) \\ y(x)\to \frac {1}{2} \left (\sqrt {x^2}-x\right ) \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(3*x*y(x) + (x**2 + 2*x*y(x) + x + 2*y(x))*Derivative(y(x), x) + 2*y(x)**2 + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out