6.7.12 problem 12

Internal problem ID [1722]
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 : 12
Date solved : Tuesday, September 30, 2025 at 05:17:43 AM
CAS classification : [_separable]

\begin{align*} x^{2} y+4 x y+2 y+\left (x^{2}+x \right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 18
ode:=x^2*y(x)+4*x*y(x)+2*y(x)+(x^2+x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_1 \,{\mathrm e}^{-x}}{x^{2} \left (x +1\right )} \]
Mathematica. Time used: 0.023 (sec). Leaf size: 26
ode=(x^2*y[x]+4*x*y[x]+2*y[x])+(x^2+x)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {c_1 e^{-x}}{x^2 (x+1)}\\ y(x)&\to 0 \end{align*}
Sympy. Time used: 0.190 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*y(x) + 4*x*y(x) + (x**2 + x)*Derivative(y(x), x) + 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} e^{- x}}{x^{2} \left (x + 1\right )} \]