78.16.5 problem 5

Internal problem ID [18305]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 23. Operator Methods for Finding Particular Solutions. Problems at page 169
Problem number : 5
Date solved : Thursday, March 13, 2025 at 11:53:20 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.006 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)-y(x) = exp(-x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (-x +2 c_{2} \right ) {\mathrm e}^{-x}}{2}+{\mathrm e}^{x} c_{1} \]
Mathematica. Time used: 0.02 (sec). Leaf size: 32
ode=D[y[x],{x,2}]-y[x]==Exp[-x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} e^{-x} \left (-2 x+4 c_1 e^{2 x}-1+4 c_2\right ) \]
Sympy. Time used: 0.086 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) + Derivative(y(x), (x, 2)) - exp(-x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} e^{x} + \left (C_{1} - \frac {x}{2}\right ) e^{- x} \]