68.5.8 problem 8

Internal problem ID [17259]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.3, page 49
Problem number : 8
Date solved : Thursday, October 02, 2025 at 02:00:06 PM
CAS classification : [_linear]

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