89.21.2 problem 4

Internal problem ID [24774]
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. Exercises at page 154
Problem number : 4
Date solved : Thursday, October 02, 2025 at 10:47:54 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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