40.11.1 problem 26

Internal problem ID [6735]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 16. Linear equations with constant coefficients (Short methods). Supplemetary problems. Page 107
Problem number : 26
Date solved : Sunday, March 30, 2025 at 11:20:59 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y^{\prime }+y&={\mathrm e}^{3 x}+6 \,{\mathrm e}^{x}-3 \,{\mathrm e}^{-2 x}+5 \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 48
ode:=diff(diff(y(x),x),x)+diff(y(x),x)+y(x) = exp(3*x)+6*exp(x)-3*exp(-2*x)+5; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\frac {x}{2}} \sin \left (\frac {\sqrt {3}\, x}{2}\right ) c_2 +{\mathrm e}^{-\frac {x}{2}} \cos \left (\frac {\sqrt {3}\, x}{2}\right ) c_1 +5+\frac {{\mathrm e}^{3 x}}{13}+2 \,{\mathrm e}^{x}-{\mathrm e}^{-2 x} \]
Mathematica. Time used: 3.087 (sec). Leaf size: 70
ode=D[y[x],{x,2}]+D[y[x],x]+y[x]==Exp[3*x]+6*Exp[x]-3*Exp[-2*x]+5; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -e^{-2 x}+2 e^x+\frac {e^{3 x}}{13}+c_2 e^{-x/2} \cos \left (\frac {\sqrt {3} x}{2}\right )+c_1 e^{-x/2} \sin \left (\frac {\sqrt {3} x}{2}\right )+5 \]
Sympy. Time used: 0.307 (sec). Leaf size: 51
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - exp(3*x) - 6*exp(x) + Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 5 + 3*exp(-2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} \sin {\left (\frac {\sqrt {3} x}{2} \right )} + C_{2} \cos {\left (\frac {\sqrt {3} x}{2} \right )}\right ) e^{- \frac {x}{2}} + \frac {e^{3 x}}{13} + 2 e^{x} + 5 - e^{- 2 x} \]