58.5.9 problem 9

Internal problem ID [14603]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 9
Date solved : Thursday, October 02, 2025 at 09:43:58 AM
CAS classification : [_linear]

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