15.14.8 problem 8

Internal problem ID [3180]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 23, page 106
Problem number : 8
Date solved : Tuesday, March 04, 2025 at 04:05:02 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+3 y^{\prime }+2 y&={\mathrm e}^{x} \sin \left (x \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 30
ode:=diff(diff(y(x),x),x)+3*diff(y(x),x)+2*y(x) = exp(x)*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -{\mathrm e}^{-2 x} \left (\frac {\left (-\sin \left (x \right )+\cos \left (x \right )\right ) {\mathrm e}^{3 x}}{10}-c_2 \,{\mathrm e}^{x}+c_{1} \right ) \]
Mathematica. Time used: 0.054 (sec). Leaf size: 36
ode=D[y[x],{x,2}]+3*D[y[x],x]+2*y[x]==Exp[x]*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to c_1 e^{-2 x}+c_2 e^{-x}+\frac {1}{10} e^x (\sin (x)-\cos (x)) \]
Sympy. Time used: 0.258 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) - exp(x)*sin(x) + 3*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^{- 2 x} + C_{2} e^{- x} + \frac {\left (\sin {\left (x \right )} - \cos {\left (x \right )}\right ) e^{x}}{10} \]