26.8.6 problem Exercise 21.8, page 231

Internal problem ID [7090]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 4. Higher order linear differential equations. Lesson 21. Undetermined Coefficients
Problem number : Exercise 21.8, page 231
Date solved : Tuesday, September 30, 2025 at 04:21:18 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+3 y^{\prime }+2 y&=8+6 \,{\mathrm e}^{x}+2 \sin \left (x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)+3*diff(y(x),x)+2*y(x) = 8+6*exp(x)+2*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -{\mathrm e}^{-2 x} c_1 +4+{\mathrm e}^{x}-\frac {3 \cos \left (x \right )}{5}+\frac {\sin \left (x \right )}{5}+{\mathrm e}^{-x} c_2 \]
Mathematica. Time used: 0.095 (sec). Leaf size: 74
ode=D[y[x],{x,2}]+3*D[y[x],x]+2*y[x]==8+6*Exp[x]+2*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-2 x} \left (\int _1^x-2 e^{2 K[1]} \left (\sin (K[1])+3 e^{K[1]}+4\right )dK[1]+e^x \int _1^x2 e^{K[2]} \left (\sin (K[2])+3 e^{K[2]}+4\right )dK[2]+c_2 e^x+c_1\right ) \end{align*}
Sympy. Time used: 0.149 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) - 6*exp(x) - 2*sin(x) + 3*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 8,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 2 x} + C_{2} e^{- x} + e^{x} + \frac {\sin {\left (x \right )}}{5} - \frac {3 \cos {\left (x \right )}}{5} + 4 \]