89.6.23 problem 23

Internal problem ID [24406]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 2. Equations of the first order and first degree. Miscellaneous Exercises at page 45
Problem number : 23
Date solved : Thursday, October 02, 2025 at 10:25:40 PM
CAS classification : [_linear]

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