58.6.10 problem 10

Internal problem ID [14641]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, Miscellaneous Review. Exercises page 60
Problem number : 10
Date solved : Thursday, October 02, 2025 at 09:45:22 AM
CAS classification : [_linear]

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