69.17.1 problem 551

Internal problem ID [18337]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.3 Nonhomogeneous linear equations with constant coefficients. Superposition principle. Exercises page 137
Problem number : 551
Date solved : Thursday, October 02, 2025 at 03:10:35 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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