89.24.13 problem 13

Internal problem ID [24850]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 11. Variation of parameters and other methods. Exercises at page 171
Problem number : 13
Date solved : Thursday, October 02, 2025 at 10:48:39 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} 2 y-3 y^{\prime }+y^{\prime \prime }&=\cos \left ({\mathrm e}^{-x}\right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)-3*diff(y(x),x)+2*y(x) = cos(exp(-x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} \left (\left (-\cos \left ({\mathrm e}^{-x}\right )+c_1 -1\right ) {\mathrm e}^{x}+c_2 \right ) \]
Mathematica. Time used: 0.047 (sec). Leaf size: 29
ode=D[y[x],{x,2}]-3*D[y[x],x]+2*y[x]== Cos[Exp[-x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x \left (-e^x \cos \left (e^{-x}\right )+c_2 e^x+c_1\right ) \end{align*}
Sympy. Time used: 2.763 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) - cos(exp(-x)) - 3*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \left (C_{2} - \cos {\left (e^{- x} \right )}\right ) e^{x}\right ) e^{x} \]