30.2.17 problem 17

Internal problem ID [7445]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.3, Linear equations. Exercises. page 54
Problem number : 17
Date solved : Tuesday, September 30, 2025 at 04:35:35 PM
CAS classification : [_linear]

\begin{align*} y^{\prime }-\frac {y}{x}&=x \,{\mathrm e}^{x} \end{align*}

With initial conditions

\begin{align*} y \left (1\right )&={\mathrm e}-1 \\ \end{align*}
Maple. Time used: 0.021 (sec). Leaf size: 10
ode:=diff(y(x),x)-y(x)/x = x*exp(x); 
ic:=[y(1) = exp(1)-1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \left ({\mathrm e}^{x}-1\right ) x \]
Mathematica. Time used: 0.033 (sec). Leaf size: 12
ode=D[y[x],x]-y[x]/x==x*Exp[x]; 
ic={y[1]==Exp[1]-1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \left (e^x-1\right ) x \end{align*}
Sympy. Time used: 0.121 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(x) + Derivative(y(x), x) - y(x)/x,0) 
ics = {y(1): -1 + E} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (e^{x} - 1\right ) \]