89.20.2 problem 2

Internal problem ID [24758]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 10. Nonhomogeneous Equations: Operational methods. Oral Exercises at page 154
Problem number : 2
Date solved : Thursday, October 02, 2025 at 10:47:45 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }-y&={\mathrm e}^{x} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 20
ode:=diff(diff(y(x),x),x)-y(x) = exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-x} c_1 +\frac {{\mathrm e}^{x} \left (x +2 c_2 \right )}{2} \]
Mathematica. Time used: 0.008 (sec). Leaf size: 29
ode=D[y[x],{x,2}]-y[x]== Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x \left (\frac {x}{2}-\frac {1}{4}+c_1\right )+c_2 e^{-x} \end{align*}
Sympy. Time used: 0.061 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) - exp(x) + Derivative(y(x), (x, 2)),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} \]