2.1.10 problem 10

Internal problem ID [660]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.2. Integrals as general and particular solutions. Page 16
Problem number : 10
Date solved : Tuesday, September 30, 2025 at 04:05:05 AM
CAS classification : [_quadrature]

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

With initial conditions

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