64.6.10 problem 10

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

\begin{align*} \left (x +1\right ) y^{\prime }+x y&={\mathrm e}^{-x} \end{align*}

Maple. Time used: 0.000 (sec). Leaf size: 15
ode:=(1+x)*diff(y(x),x)+x*y(x) = exp(-x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-x} \left (c_{1} x +c_{1} -1\right ) \]
Mathematica. Time used: 0.113 (sec). Leaf size: 69
ode=(x+1)*D[y[x],x]+x*y[x]==Exp[-x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \exp \left (\int _1^x-\frac {K[1]}{K[1]+1}dK[1]\right ) \left (\int _1^x\frac {\exp \left (-K[2]-\int _1^{K[2]}-\frac {K[1]}{K[1]+1}dK[1]\right )}{K[2]+1}dK[2]+c_1\right ) \]
Sympy. Time used: 0.338 (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} \]