89.18.21 problem 21

Internal problem ID [24721]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 9. Nonhomogeneous Equations: Undetermined coefficients. Oral Exercises at page 146
Problem number : 21
Date solved : Thursday, October 02, 2025 at 10:47:26 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y+2 y^{\prime }+y^{\prime \prime }&={\mathrm e}^{2 x} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+y(x) = exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left ({\mathrm e}^{3 x}+9 c_1 x +9 c_2 \right ) {\mathrm e}^{-x}}{9} \]
Mathematica. Time used: 0.022 (sec). Leaf size: 28
ode=D[y[x],{x,2}]+2*D[y[x],x]+y[x]==Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {e^{2 x}}{9}+e^{-x} (c_2 x+c_1) \end{align*}
Sympy. Time used: 0.119 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - exp(2*x) + 2*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} + C_{2} x\right ) e^{- x} + \frac {e^{2 x}}{9} \]