64.5.9 problem 9

Internal problem ID [13243]
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 : Wednesday, March 05, 2025 at 09:31:12 PM
CAS classification : [_linear]

\begin{align*} x y^{\prime }+x y+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 {1+c_{1} {\mathrm e}^{-x}}{x} \]
Mathematica. Time used: 0.054 (sec). Leaf size: 21
ode=x*D[y[x],x]+(x*y[x]+y[x]-1)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1+c_1 e^{-x-1}}{x} \]
Sympy. Time used: 0.292 (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} \]