80.3.33 problem 36

Internal problem ID [21197]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 3. First order nonlinear differential equations. Excercise 3.7 at page 67
Problem number : 36
Date solved : Thursday, October 02, 2025 at 07:26:13 PM
CAS classification : [_linear]

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