88.23.4 problem 4

Internal problem ID [24178]
Book : Elementary Differential Equations. By Lee Roy Wilcox and Herbert J. Curtis. 1961 first edition. International texbook company. Scranton, Penn. USA. CAT number 61-15976
Section : Chapter 5. Special Techniques for Linear Equations. Miscellaneous Exercises at page 162
Problem number : 4
Date solved : Thursday, October 02, 2025 at 10:00:30 PM
CAS classification : [[_2nd_order, _missing_y]]

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

With initial conditions

\begin{align*} y \left (0\right )&=0 \\ y^{\prime }\left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.009 (sec). Leaf size: 24
ode:=diff(diff(y(x),x),x)+diff(y(x),x) = x+exp(-x); 
ic:=[y(0) = 0, D(y)(0) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = 2+\left (-x -2\right ) {\mathrm e}^{-x}+\frac {x^{2}}{2}-x \]
Mathematica. Time used: 0.075 (sec). Leaf size: 27
ode=D[y[x],{x,2}]+D[y[x],x]==x+Exp[-x]; 
ic={y[0]==0,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{2} \left (x^2-2 x-2 e^{-x} (x+2)+4\right ) \end{align*}
Sympy. Time used: 0.124 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x + Derivative(y(x), x) + Derivative(y(x), (x, 2)) - exp(-x),0) 
ics = {y(0): 0, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x^{2}}{2} - x + \left (- x - 2\right ) e^{- x} + 2 \]