89.17.8 problem 8

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

\begin{align*} y^{\prime \prime }+6 y^{\prime }+14 y&=42 \,{\mathrm e}^{x}-7 \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 34
ode:=diff(diff(y(x),x),x)+6*diff(y(x),x)+14*y(x) = 42*exp(x)-7; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-3 x} \sin \left (\sqrt {5}\, x \right ) c_2 +{\mathrm e}^{-3 x} \cos \left (\sqrt {5}\, x \right ) c_1 +2 \,{\mathrm e}^{x}-\frac {1}{2} \]
Mathematica. Time used: 0.226 (sec). Leaf size: 46
ode=D[y[x],{x,2}]+6*D[y[x],x]+14*y[x]==42*Exp[x]-7; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to 2 e^x+c_2 e^{-3 x} \cos \left (\sqrt {5} x\right )+c_1 e^{-3 x} \sin \left (\sqrt {5} x\right )-\frac {1}{2} \end{align*}
Sympy. Time used: 0.138 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(14*y(x) - 42*exp(x) + 6*Derivative(y(x), x) + Derivative(y(x), (x, 2)) + 7,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} \sin {\left (\sqrt {5} x \right )} + C_{2} \cos {\left (\sqrt {5} x \right )}\right ) e^{- 3 x} + 2 e^{x} - \frac {1}{2} \]