89.25.3 problem 3

Internal problem ID [24861]
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 177
Problem number : 3
Date solved : Thursday, October 02, 2025 at 10:48:47 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-4 y^{\prime }+3 y&=\sin \left ({\mathrm e}^{-x}\right ) \end{align*}
Maple. Time used: 0.007 (sec). Leaf size: 33
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+3*y(x) = sin(exp(-x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} \left (\left (c_2 -\cos \left ({\mathrm e}^{-x}\right )-1\right ) {\mathrm e}^{2 x}-{\mathrm e}^{x} \sin \left ({\mathrm e}^{-x}\right )+c_1 \right ) \]
Mathematica. Time used: 0.04 (sec). Leaf size: 42
ode=D[y[x],{x,2}]-4*D[y[x],x]+3*y[x]==  Sin[Exp[-x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x \left (c_2 e^{2 x}-e^x \left (\sin \left (e^{-x}\right )+e^x \cos \left (e^{-x}\right )\right )+c_1\right ) \end{align*}
Sympy. Time used: 2.755 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(3*y(x) - sin(exp(-x)) - 4*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^{2 x} - e^{x} \sin {\left (e^{- x} \right )}\right ) e^{x} \]